Volume auto attach can fail if there is a swap or ephemeral device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Vish Ishaya |
Bug Description
The following behavior has been reported:
Images are set up so that the root partition is on the /dev/xvda device, and swap is on /dev/xvdc:
root@singularity:~# ll /dev/xv*
brw-rw---- 1 root disk 202, 0 Sep 6 20:03 /dev/xvda
brw-rw---- 1 root disk 202, 1 Sep 6 20:03 /dev/xvda1
brw-rw---- 1 root disk 202, 32 Sep 6 20:03 /dev/xvdc
brw-rw---- 1 root disk 202, 33 Sep 6 20:03 /dev/xvdc1
Attach a volume:
adr-ego:~$ supernova dfw volume-attach SERVER_ID 1411650e-
+------
| Property | Value |
+------
| device | None |
| id | 1411650e-
| serverId | 38d17e58-
| volumeId | 1411650e-
+------
A few moments later, I see this:
root@singularity:~# ll /dev/xv*
brw-rw---- 1 root disk 202, 0 Sep 6 20:03 /dev/xvda
brw-rw---- 1 root disk 202, 1 Sep 6 20:03 /dev/xvda1
brw-rw---- 1 root disk 202, 16 Sep 21 15:46 /dev/xvdb <=== new volume
brw-rw---- 1 root disk 202, 32 Sep 6 20:03 /dev/xvdc
brw-rw---- 1 root disk 202, 33 Sep 6 20:03 /dev/xvdc1
Cool beans. Now to attach another…..
adr-ego:~$ supernova dfw volume-attach SERVER_ID 0cb2b905-
+------
| Property | Value |
+------
| device | None |
| id | 0cb2b905-
| serverId | 38d17e58-
| volumeId | 0cb2b905-
+------
The volume fails to attach, and the following error is in the logs (Ths is Xenserver):
Unable to use SR OpaqueRef:
It would appear that it is trying to auto-attach to /dev/xvdc even though it is already in use, and just to verify:
adr-ego:~$ supernova dfw volume-attach SERVER_ID 0cb2b905-
+------
| Property | Value |
+------
| device | None |
| id | 0cb2b905-
| serverId | 38d17e58-
| volumeId | 0cb2b905-
+------
Moments later, it showed up on the guest as expected:
root@singularity:~# ll /dev/xv*
brw-rw---- 1 root disk 202, 0 Sep 6 20:03 /dev/xvda
brw-rw---- 1 root disk 202, 1 Sep 6 20:03 /dev/xvda1
brw-rw---- 1 root disk 202, 16 Sep 21 15:46 /dev/xvdb
brw-rw---- 1 root disk 202, 32 Sep 6 20:03 /dev/xvdc
brw-rw---- 1 root disk 202, 33 Sep 6 20:03 /dev/xvdc1
brw-rw---- 1 root disk 202, 48 Sep 21 16:07 /dev/xvdd <=== new volume
Hoping that I have now forced it to start counting from the correct point, I tried to auto-attach another volume:
adr-ego:~$ supernova dfw volume-attach SERVER_ID 302bf831-
+------
| Property | Value |
+------
| device | None |
| id | 302bf831-
| serverId | 38d17e58-
| volumeId | 302bf831-
+------
Nope, generated another fault, with the same error.
It seems that the "auto" method of selecting a guest block device needs to be a little smarter, and take into consideration what the default volumes are called.
Changed in nova: | |
status: | New → Triaged |
importance: | Undecided → High |
summary: |
- Volume auto attach fails if other devices are already specified + Volume auto attach can fail if there is a swap device |
summary: |
- Volume auto attach can fail if there is a swap device + Volume auto attach can fail if there is a swap or ephemeral device |
tags: | added: folsom-rc-potential |
Changed in nova: | |
milestone: | none → folsom-rc3 |
tags: | removed: folsom-rc-potential |
Changed in nova: | |
milestone: | folsom-rc3 → 2012.2 |
Fix proposed to branch: master /review. openstack. org/13649
Review: https:/