image still attached to loopback device after deleting lxc instance

Bug #1208387 reported by QiangGuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
QiangGuan

Bug Description

root@debian:/opt/stack/data/nova/instances# nova list
+--------------------------------------+------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+------------------+
| 513d2fab-9232-495a-a121-4cbedd8249f7 | lxc5 | ACTIVE | None | Running | private=10.0.0.3 |
+--------------------------------------+------+--------+------------+-------------+------------------+
root@debian:/opt/stack/data/nova/instances# losetup -a
/dev/loop1: [fe01]:931805 (/opt/stack/data/nova/instances/513d2fab-9232-495a-a121-4cbedd8249f7/disk)
root@debian:/opt/stack/data/nova/instances# nova delete lxc5
root@debian:/opt/stack/data/nova/instances# nova list
+--------------------------------------+------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+------------------+
| 513d2fab-9232-495a-a121-4cbedd8249f7 | lxc5 | ACTIVE | deleting | Running | private=10.0.0.3 |
+--------------------------------------+------+--------+------------+-------------+------------------+
root@debian:/opt/stack/data/nova/instances# nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
root@debian:/opt/stack/data/nova/instances# losetup -a
/dev/loop1: [fe01]:931805 (/opt/stack/data/nova/instances/513d2fab-9232-495a-a121-4cbedd8249f7/disk (deleted))

Tags: lxc
melanie witt (melwitt)
tags: added: lxc
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit aab3c6178571456ea3f2523f401d0a18c04e573c
Author: Guan Qiang <email address hidden>
Date: Tue Oct 22 16:52:19 2013 +0800

    LXC: Image device should be reset in mount() and teardown()

    When fixing bug#1208387, image device name is returned in function
    setup_container. But it's missed to reset in function mount() and
    teardown().

    This patch is to fix it. We now just return the device name when
    mounting disk image during setting up container and remove the
    member variable 'device' from Class _DiskImage added in last patch.

    Closes-bug: #1243108
    Related-bug: #1208387

    Change-Id: I2aaed6f3367edce4fb23b78f0e979440954609a8

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit 0fcbb7b286888d642d329db1299eb9f3708d1f50
Author: Guan Qiang <email address hidden>
Date: Tue Oct 22 16:32:25 2013 +0800

    Fix lxc rootfs attached two devices in some action

    During resizing/rebooting a lxc container, create_domain action
    will be called and lxc rootfs will be attached to device again.
    So before this action, We need to teardown the container to
    make sure lxc_root_device is detached when container is destroyed.

    Closes-bug: #1243083
    Related-bug: #1208387

    Change-Id: Idd1862c7f212dc253b6273b07b020c86a94e658e

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.