NBD device doesn't get disconnected after terminating LXC instance

Bug #806647 reported by bastichelaar
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chuck Short

Bug Description

Steps to reproduce:

- Create a LXC instance
- Terminate the instance
- The qemu-nbd device is still connected

Attached is a proposed solution. I'm not a very good Python programmer, but this does the job.

Tags: lxc

Related branches

Revision history for this message
bastichelaar (bas-t) wrote :
Thierry Carrez (ttx)
tags: added: lxc
Revision history for this message
Chuck Short (zulcss) wrote :

lgtm

Revision history for this message
Chuck Short (zulcss) wrote :

Im not able to reproduce this.

Thierry Carrez (ttx)
Changed in nova:
status: New → Incomplete
Revision history for this message
Thierry Carrez (ttx) wrote :

@bas-t: can you still reproduce ? Could you give us more details ?

Revision history for this message
bastichelaar (bas-t) wrote :

Ok, a little bit more details. My situation:

- I'm not using NBD anymore, so this is for normal LXC mounted chroots
- I'm using Nova Cactus

To reproduce this bug:

- Run an instance with Nova (with LXC / Libvirt hypervisor)
- Reboot the system while having a running instance
- When the system is rebooted, the instances are not mounted anymore, so when I try to terminate the instance it complains that it cannot unmount the LXC chroot, and therefore cannot terminate the instance

I created a small two line patch, that first checks if that directory is mounted. If so, it unmounts the directory. If not, it continues. I have no errors anymore.

Let me know if anybody can reproduce this bug.

Revision history for this message
Thierry Carrez (ttx) wrote :

Maybe it's a Cactus-specific issue, which would explain why Chuck doesn't reproduce it... it's great that you have a workaround for it. Any chance you could spin up a diablo-4 setup and doublecheck that the issue is gone ?

Revision history for this message
bastichelaar (bas-t) wrote :

I upgraded to Diablo (without many problems btw), and the problem is still there. In fact, it's a combination of two bugs:

- While terminating, it tries to unmount the mounted root of the instance. If the root is not mounted (due to a reboot), it fails.
- When it is mounted, it umounts correctly, but then tries to umount the loop device. There is a bug in this command.

Attached a patch, which will fix both issues.

Revision history for this message
Thierry Carrez (ttx) wrote :

Sounds sane -- Chuck can you confirm the fix ?

Changed in nova:
importance: Undecided → High
status: Incomplete → Triaged
Revision history for this message
Thierry Carrez (ttx) wrote :

See also duplicate bug 841051

Revision history for this message
Thierry Carrez (ttx) wrote :
Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Chuck Short (zulcss)
status: Triaged → In Progress
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.3
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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