Attach volume with libvirt disregards target device but still reserves it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
Medium
|
Nikola Đipanov |
Bug Description
Running devstack with libvirt/qemu - the problem is that attaching a volume (either by passing it with --block_
The following session is how to reproduce it:
[ndipanov@devstack devstack]$ cinder list
+------
| ID | Status | Display Name | Size | Volume Type | Attached to |
+------
| 5792f1ed-
| abc77933-
| b4de941a-
+------
[ndipanov@devstack devstack]$ nova list
[ndipanov@devstack devstack]$ nova boot --image c346fdd1-
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | CqgT4dXkq64t |
| config_drive | |
| created | 2012-11-
| flavor | m1.tiny |
| hostId | |
| id | caa459d5-
| image | cirros-
| key_name | nova_key |
| metadata | {} |
| name | w_vol |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | 5f68e605463940d
| updated | 2012-11-
| user_id | 104895e85fe54ae
+------
[ndipanov@devstack devstack]$ nova list
| ID | Name | Status | Networks |
+------
| caa459d5-
+------
[ndipanov@devstack devstack]$ ssh -o StrictHostKeyCh
@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
57:ca:fe:
Please contact your system administrator.
Add correct host key in /home/ndipanov/
Offending RSA key in /home/ndipanov/
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-
$ cat /proc/partitions
major minor #blocks name
253 0 24576 vda
253 16 1048576 vdb
$ ls -la /dev | grep vd.*
lrwxrwxrwx 1 root root 3 Nov 7 07:03 root -> vda
brw------- 1 root root 253, 0 Nov 7 07:02 vda
brw------- 1 root root 253, 16 Nov 7 07:02 vdb
$ Connection to 10.0.0.2 closed.
[ndipanov@devstack devstack]$ cinder list
+------
| ID | Status | Display Name | Size | Volume Type | Attached to |
+------
| 5792f1ed-
| abc77933-
| b4de941a-
+------
(reverse-
[ndipanov@devstack devstack]$ nova volume-attach w_vol abc77933-
ERROR: The supplied device path (/dev/vda) is in use.
Traceback (most recent call last):
File "/opt/stack/
rval = self.proxy.
File "/opt/stack/
return getattr(proxyobj, method)(ctxt, **kwargs)
File "/opt/stack/
temp_level, payload)
File "/usr/lib64/
self.gen.next()
File "/opt/stack/
return f(*args, **kw)
File "/opt/stack/
pass
File "/usr/lib64/
self.gen.next()
File "/opt/stack/
return function(self, context, *args, **kwargs)
File "/opt/stack/
kwargs[
File "/usr/lib64/
self.gen.next()
File "/opt/stack/
return function(self, context, *args, **kwargs)
File "/opt/stack/
return do_reserve()
File "/opt/stack/
retval = f(*args, **kwargs)
File "/opt/stack/
device)
File "/opt/stack/
raise exception.
DevicePathInUse: The supplied device path (/dev/vda) is in use.
(HTTP 400) (Request-ID: req-76852a0d-
[ndipanov@devstack ~]$ nova volume-attach w_vol abc77933-
+------
| Property | Value |
+------
| device | /dev/vdc |
| id | abc77933-
| serverId | caa459d5-
| volumeId | abc77933-
+------
This seems to be somehow related to the changes introduced by https:/
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in nova: | |
assignee: | nobody → Nikola Đipanov (ndipanov) |
Since it is now possible to both boot instances and attach volumes without specifying device names after https:/ /blueprints. launchpad. net/nova/ +spec/improve- block-device- handling BP has been implemented. in which case the device names will be handled properly by Nova.
It is still possible to supply device names (for backwards compatibility's sake), which would cause the same behavior as described above. This is really an issue due to the fact that there is no way to make sure libvirt uses the same device name as supplied to it since libvirt only takes this as ordering hints. the best solution really _is_ to rely on Nova to actually choose the device name as per implemented BP.