There isn't effect when attach/detach interface for paused instance

Bug #1299331 reported by Alex Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Alex Xu
Icehouse
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

$ nova boot --flavor 1 --image 76ae1239-0973-44cf-9051-0e1bc8f41cdd --nic net-id=a15cfbed-86d8-4660-9593-46447cb9464e vm1

$ nova list
+--------------------------------------+------+--------+------------+-------------+-------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+-------------------+
| f7e2877d-c7f5-4493-89d4-c68e9839a7ff | vm1 | ACTIVE | - | Running | private=10.0.0.22 |
+--------------------------------------+------+--------+------------+-------------+-------------------+

$ brctl show
bridge name bridge id STP enabled interfaces
br-eth0 0000.fe989d8bd148 no
br-ex 0000.8a1d06d8854e no
br-ex2 0000.4a98bdebe544 no
br-int 0000.229ad5053a41 no
br-tun 0000.2e58a2f0e047 no
docker0 8000.000000000000 no
lxcbr0 8000.000000000000 no
qbr0ad6a86e-d9 8000.9e5491dd719a no qvb0ad6a86e-d9
       tap0ad6a86e-d9

$ neutron port-list
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| 0ad6a86e-d967-424e-9bf5-e6821cc0cd0d | | fa:16:3e:3a:3e:5a | {"subnet_id": "94575a05-796f-4ff5-b892-3c3b8231b303", "ip_address": "10.0.0.22"} |
| 1e6bed8d-aece-4d3e-abcc-3ad7957d6d72 | | fa:16:3e:9e:dc:83 | {"subnet_id": "e5dbc790-c26f-45b7-b2c7-574f12ad8b41", "ip_address": "172.24.4.12"} |
| 5f522a9a-2856-4a95-8bd8-c354c00abf0f | | fa:16:3e:01:47:43 | {"subnet_id": "94575a05-796f-4ff5-b892-3c3b8231b303", "ip_address": "10.0.0.1"} |
| 6226f6d3-3814-469c-bf50-8c99dfec481e | | fa:16:3e:46:0e:35 | {"subnet_id": "94575a05-796f-4ff5-b892-3c3b8231b303", "ip_address": "10.0.0.2"} |
| a3f2ab1c-a634-446d-8885-d7d8e5978fa1 | | fa:16:3e:cf:02:d6 | {"subnet_id": "94575a05-796f-4ff5-b892-3c3b8231b303", "ip_address": "10.0.0.20"} |
| c10390a9-6f84-44f5-8a17-91cb330a9e12 | | fa:16:3e:41:7c:34 | {"subnet_id": "e5dbc790-c26f-45b7-b2c7-574f12ad8b41", "ip_address": "172.24.4.15"} |
| c814425c-be1a-4c06-a54b-1788c7c6fb31 | | fa:16:3e:f5:fc:d3 | {"subnet_id": "e5dbc790-c26f-45b7-b2c7-574f12ad8b41", "ip_address": "172.24.4.2"} |
| ebd874b7-43e6-4d18-b0ed-f86bb349d8b9 | | fa:16:3e:e6:b5:09 | {"subnet_id": "e5dbc790-c26f-45b7-b2c7-574f12ad8b41", "ip_address": "172.24.4.19"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+

$ nova pause vm1

$ nova interface-detach vm1 0ad6a86e-d967-424e-9bf5-e6821cc0cd0d

$ nova list
+--------------------------------------+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+----------+
| f7e2877d-c7f5-4493-89d4-c68e9839a7ff | vm1 | PAUSED | - | Paused | |
+--------------------------------------+------+--------+------------+-------------+----------+

$ brctl show
bridge name bridge id STP enabled interfaces
br-eth0 0000.fe989d8bd148 no
br-ex 0000.8a1d06d8854e no
br-ex2 0000.4a98bdebe544 no
br-int 0000.229ad5053a41 no
br-tun 0000.2e58a2f0e047 no
docker0 8000.000000000000 no
lxcbr0 8000.000000000000 no

But tap still alive

$ ifconfig|grep tap0ad6a86e-d9
tap0ad6a86e-d9 Link encap:Ethernet HWaddr fe:16:3e:3a:3e:5a

And login into instance, exec 'ifconfig', it will found the interface still attach to the instance

Alex Xu (xuhj)
Changed in nova:
assignee: nobody → Alex Xu (xuhj)
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/83959

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/83959
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a868fcedf8e46070cae6aa8e59e61934fa23db1c
Submitter: Jenkins
Branch: master

commit a868fcedf8e46070cae6aa8e59e61934fa23db1c
Author: He Jie Xu <email address hidden>
Date: Sat Mar 29 15:35:47 2014 +0800

    Attach/detach interface to paused instance with affect live flag

    Currently attach/detach interface to paused instance is only with
    VIR_DOMAIN_AFFECT_CONFIG flags. After instance unpause, there isn't
    any effect on the instance, unless restart the instance. So add
    flag VIR_DOMAIN_AFFECT_LIVE when attach/detach interface.

    Change-Id: Iedfc7f6fc06e72d8e3eecebede1274582c8043fd
    Closes-Bug: #1299331

Changed in nova:
status: In Progress → Fix Committed
tags: added: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/101828

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/93190
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ead9cfca93c9b5ca55e3ba269213c98d5e6e1d38
Submitter: Jenkins
Branch: master

commit ead9cfca93c9b5ca55e3ba269213c98d5e6e1d38
Author: Thang Pham <email address hidden>
Date: Sat May 10 01:41:31 2014 -0400

    libvirt: Use VIR_DOMAIN_AFFECT_LIVE for paused instances

    When a volume is attached to a paused instance, it does not
    appear in the instance's block devices list (i.e. lsblk)
    after the instance has resumed. A similar situation
    happens when detaching a volume from a paused instance; the
    block device continues to exists in the block devices list,
    where it should not. It was found that the volume is only
    persisted in the domain's config settings and not its active
    settings, since only the VIR_DOMAIN_AFFECT_CONFIG flag was used
    on attach and detach volume. In order to affect the active
    settings, the VIR_DOMAIN_AFFECT_LIVE flag has to be added when
    attaching and detaching volumes.

    Change-Id: I9c90a410a7ecb91f5a4de28acee21fe7da49242c
    Closes-Bug: #1242366
    Related-Bug: #1299331

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/icehouse)

Related fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/102456

Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/101828
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0e1580e5ebfc6a7d612235a444ce9843a44479fb
Submitter: Jenkins
Branch: stable/icehouse

commit 0e1580e5ebfc6a7d612235a444ce9843a44479fb
Author: He Jie Xu <email address hidden>
Date: Sat Mar 29 15:35:47 2014 +0800

    Attach/detach interface to paused instance with affect live flag

    Currently attach/detach interface to paused instance is only with
    VIR_DOMAIN_AFFECT_CONFIG flags. After instance unpause, there isn't
    any effect on the instance, unless restart the instance. So add
    flag VIR_DOMAIN_AFFECT_LIVE when attach/detach interface.

    Conflicts:
     nova/tests/virt/libvirt/test_libvirt.py

    Change-Id: Iedfc7f6fc06e72d8e3eecebede1274582c8043fd
    Closes-Bug: #1299331
    (cherry picked from commit a868fcedf8e46070cae6aa8e59e61934fa23db1c)

tags: added: in-stable-icehouse
Chuck Short (zulcss)
tags: removed: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/102456
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=520aa4c0829da9ba4b2beb8f90995f4bdec9b1f2
Submitter: Jenkins
Branch: stable/icehouse

commit 520aa4c0829da9ba4b2beb8f90995f4bdec9b1f2
Author: Thang Pham <email address hidden>
Date: Sat May 10 01:41:31 2014 -0400

    libvirt: Use VIR_DOMAIN_AFFECT_LIVE for paused instances

    When a volume is attached to a paused instance, it does not
    appear in the instance's block devices list (i.e. lsblk)
    after the instance has resumed. A similar situation
    happens when detaching a volume from a paused instance; the
    block device continues to exists in the block devices list,
    where it should not. It was found that the volume is only
    persisted in the domain's config settings and not its active
    settings, since only the VIR_DOMAIN_AFFECT_CONFIG flag was used
    on attach and detach volume. In order to affect the active
    settings, the VIR_DOMAIN_AFFECT_LIVE flag has to be added when
    attaching and detaching volumes.

    This change adjusts little about the unit test:
    add two imports.

    Change-Id: I9c90a410a7ecb91f5a4de28acee21fe7da49242c
    Closes-Bug: #1242366
    Related-Bug: #1299331
    (cherry picked from commit ead9cfca93c9b5ca55e3ba269213c98d5e6e1d38)

Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.