lxc container rootfs is attached to more than one device when rebooted or resized

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

Bug Description

Operation details are as following:
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+---------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+---------+------------+-------------+------------------+
| b91adccc-408a-4bac-8835-9843afb904b9 | lxc1 | ACTIVE | None | Running | private=10.0.0.2 |
+--------------------------------------+------+---------+------------+-------------+------------------+
ubuntu@lxc-gq:~$ sudo losetup -a
/dev/loop1: [fd01]:134374 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9/disk)
ubuntu@lxc-gq:~$ nova reboot lxc1 --hard
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+-------------+----------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+-------------+----------------+-------------+------------------+
| b91adccc-408a-4bac-8835-9843afb904b9 | lxc1 | HARD_REBOOT | rebooting_hard | Running | private=10.0.0.2 |
+--------------------------------------+------+-------------+----------------+-------------+------------------+
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+---------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+---------+------------+-------------+------------------+
| b91adccc-408a-4bac-8835-9843afb904b9 | lxc1 | ACTIVE | None | Running | private=10.0.0.2 |
+--------------------------------------+------+---------+------------+-------------+------------------+
ubuntu@lxc-gq:~$ sudo losetup -a
/dev/loop0: [fd01]:134374 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9/disk)
/dev/loop1: [fd01]:134374 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9/disk)

ubuntu@lxc-gq:~$ nova resize lxc1 m1.lxc
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+---------------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+---------------+------------+-------------+------------------+
| b91adccc-408a-4bac-8835-9843afb904b9 | lxc1 | VERIFY_RESIZE | None | Running | private=10.0.0.2 |
+--------------------------------------+------+---------------+------------+-------------+------------------+

ubuntu@lxc-gq:~$ sudo losetup -a
/dev/loop0: [fd01]:136419 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9_resize/disk)
/dev/loop1: [fd01]:134374 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9/disk)

ubuntu@lxc-gq:~$ nova resize-confirm lxc1
ubuntu@lxc-gq:~$ nova list
+--------------------------------------+------+---------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+---------+------------+-------------+------------------+
| b91adccc-408a-4bac-8835-9843afb904b9 | lxc1 | ACTIVE | None | Running | private=10.0.0.2 |
+--------------------------------------+------+---------+------------+-------------+------------------+
ubuntu@lxc-gq:~$ vir list
Id Name State
----------------------------------------------------
9312 instance-00000052 running

ubuntu@lxc-gq:~$ sudo losetup -a
/dev/loop0: [fd01]:136419 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9_resize/disk (deleted))
/dev/loop1: [fd01]:134374 (/opt/stack/data/nova/instances/b91adccc-408a-4bac-8835-9843afb904b9/disk)

Tags: 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/53069

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

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

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