Nbd device is still connected after deleting a lxc Container

Bug #1203927 reported by QiangGuan
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
QiangGuan

Bug Description

Nbd device is still connected after deleting a lxc Container. Operation details are list as following:

ubuntu@lxc-gq:~$ nova boot --image 8f30a356-f01c-4c91-b32f-4710a1e79b88 --flavor m1.small --key-name kp-lxc lxc3
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | ubuntu-12.04-amd64-lxc |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-0000003c |
| OS-SRV-USG:launched_at | None |
| flavor | m1.small |
| id | b52ab8f1-b270-4a01-929b-a3e0d7b17c22 |
| security_groups | [{u'name': u'default'}] |
| user_id | fad1205006184105a3fc03d57f0230d2 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-07-23T01:44:00Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| OS-SRV-USG:terminated_at | None |
| key_name | kp-lxc |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | lxc3 |
| adminPass | GeENhmP6qp93 |
| tenant_id | 6151530887f2468d8ad3808ca380740c |
| created | 2013-07-23T01:43:59Z |
| metadata | {} |
+-------------------------------------+--------------------------------------+
+-------------------------------------+--------------------------------------+
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+------------------+
| b52ab8f1-b270-4a01-929b-a3e0d7b17c22 | lxc3 | BUILD | spawning | NOSTATE | private=10.0.0.2 |
+--------------------------------------+------+--------+------------+-------------+------------------+
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+------------------+
| b52ab8f1-b270-4a01-929b-a3e0d7b17c22 | lxc3 | ACTIVE | None | Running | private=10.0.0.2 |
+--------------------------------------+------+--------+------------+-------------+------------------+
ubuntu@lxc-gq:~$ ps -ef|grep qemu-nbd
root 16595 1 6 01:44 ? 00:00:00 qemu-nbd -c /dev/nbd11 /opt/stack/data/nova/instances/b52ab8f1-b270-4a01-929b-a3e0d7b17c22/disk
ubuntu 19480 16062 0 01:44 pts/0 00:00:00 grep --color=auto qemu-nbd
ubuntu@lxc-gq:~$ nova delete lxc3
ubuntu@lxc-gq:~$ nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
ubuntu@lxc-gq:~$ ps -ef|grep qemu-nbd
root 16595 1 2 01:44 ? 00:00:01 qemu-nbd -c /dev/nbd11 /opt/stack/data/nova/instances/b52ab8f1-b270-4a01-929b-a3e0d7b17c22/disk
ubuntu 19833 16062 0 01:44 pts/0 00:00:00 grep --color=auto qemu-nbd

Tags: libvirt
tags: added: libvirtt
tags: added: libvirt
removed: libvirtt
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/41891

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

Reviewed: https://review.openstack.org/41891
Committed: http://github.com/openstack/nova/commit/6277f8aa9af4785170c7d750682093992320e785
Submitter: Jenkins
Branch: master

commit 6277f8aa9af4785170c7d750682093992320e785
Author: hzguanqiang <email address hidden>
Date: Wed Aug 14 18:56:06 2013 +0800

    Fix root disk not be detached after deleting lxc container

    Add teardown_container action when cleanup lxc instance to make
    sure root disk be detached and no resource leak.

    Fixes: bug #1208387
           bug #1203927

    Change-Id: I063fd3a9856bba089bcde5cdefd2576e2eb2b0e9

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
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.