Ask Your Question
0

How do I detach a volume from a running instance

asked 2014-12-18 13:38:10 -0500

dt.turner gravatar image

updated 2014-12-19 14:29:58 -0500

  • Running Icehouse 2014.1.2

  • Control nodes are running Oracle Enterprise Linux 6.5

  • Compute nodes are running Oracle Virtual Server 3.3.2 (Xen-based kernel)

I'm trying to detach secondary volumes from instances that need to remain up. When I attempt this using nova volume-detach, I receive errors on the compute node reporting that the device is in use and cannot be disconnected.

Message in /var/log/messages on compute node:

Error: Device 51744 (tap) disconnect failed - Device in use; refusing to close.

The instance console shows a similar message. This is an idle instance that I've spun up specifically for this test. I can spin up additional instances and see the same behavior.

If I delete the instance, the volume is detached and becomes available. This only occurs if I'm trying to detach a secondary volume while keeping the instance alive.

I've seen similar issues reported for EBS on AWS as well as RackSpace. They recommend unmounting the volume from within the instance, then attempt a volume detach. Makes sense, however when I try this Nova now complains that the device is missing. So, I ask... If you want to detach a volume from an instance that needs to remain running, how are you supposed to go about this?

Compute logs from the node hosting the instance have the following errors:

2014-12-18 11:36:34.667 9752 ERROR nova.compute.manager [req-98525048-1df6-4a22-9ebb-a54130f96761 f778784adfc2458faa17e77b6cf0617c eafc492e2912424faa4a1903977c2b92] [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae] Failed to detach volume d6911785-00b3-4145-86df-2bd48c301cde from /dev/xvdb
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae] Traceback (most recent call last):
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4203, in _detach_volume
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]     encryption=encryption)
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 1418, in detach_volume
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]     virt_dom.detachDeviceFlags(xml, flags)
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 179, in doit
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]     result = proxy_call(self._autowrap, f, *args, **kwargs)
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 139, in proxy_call
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]     rv = execute(f,*args,**kwargs)
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 77, in tworker
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]     rv = meth(*args,**kwargs)
2014-12-18 11:36:34.667 9752 TRACE nova.compute.manager [instance: cbefdb38-3022-41ce-a7ef-3aae4a5784ae]   File "/usr/lib64/python2.6/site-packages/libvirt.py", line 823, in ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-07-21 23:53:21 -0500

Pranay Sagar gravatar image

use the following command to detach the volume with running instance

1 nova volume-detach instance_id volume_id

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-12-18 13:38:10 -0500

Seen: 2,007 times

Last updated: Jul 21 '17