Comment 2 for bug 1707238

Revision history for this message
melanie witt (melwitt) wrote :

Here are the steps to reproduce the bug:

1. Create an instance.
$ nova boot --flavor m1.nano --image cirros-0.3.5-x86_64-disk repro

2. Create a volume.
$ cinder create --name repro 1

3. Attach the volume to the instance.
$ nova volume-attach repro 552e833a-5c56-45c0-a670-7cfddaa8112b

4. See the device on the domain.
$ virsh domblklist 1
Target Source
------------------------------------------------
vda /opt/stack/data/nova/instances/b626887f-aa9a-4d91-864b-ce4733f5cc24/disk
vdb /dev/sdc

5. Create XML to use for the detach from persistent domain only.
$ cat detach.xml
<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='native'/>
  <source dev='/dev/sdc'/>
  <backingStore/>
  <target dev='vdb' bus='virtio'/>
  <serial>552e833a-5c56-45c0-a670-7cfddaa8112b</serial>
  <alias name='virtio-disk1'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>

6. Detach from persistent domain only.
$ virsh detach-device 1 detach.xml --config
Device detached successfully

7. Detach the volume via the Nova API.
$ nova volume-detach repro 552e833a-5c56-45c0-a670-7cfddaa8112b

Expected Result: Device is no longer attached to the live domain.
$ virsh domblklist 1
Target Source
------------------------------------------------
vda /opt/stack/data/nova/instances/b626887f-aa9a-4d91-864b-ce4733f5cc24/disk

Actual Result: Device is still attached to the live domain.
$ virsh domblklist 1
Target Source
------------------------------------------------
vda /opt/stack/data/nova/instances/b626887f-aa9a-4d91-864b-ce4733f5cc24/disk
vdb /dev/sdc