After attachment-delete nova still sees volume as attached
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Medium
|
Unassigned |
Bug Description
Using cinder attachment-delete command to detach a volume from a stopped instance seems to be affecting only what cinder sees but not what nova sees.
Here are rough steps to reproduce:
1. Create a volume from an image, say the volume's UUID is $VOL
2. Create an instance using that volume as storage:
$ openstack server create --volume $VOL --flavor some_flavor test-instance
3. Verify the volume is attached to the instance:
$ openstack server show test-instance -fvalue -cvolumes_attached
id='$VOL'
4. Get the attachment id using, suppose it's $ATT:
$ os volume show $VOL -fvalue -c attachments | python -c 'import sys,pprint;
[{'
'
'device': '/dev/vda',
'host_name': 'some-hostname',
'id': '$VOL',
'server_id': '...',
'volume_id': '$VOL'}]
5. Stop the instance
6. Detach the volume:
$ cinder --os-volume-
Now the volume will show as not being attached according to openstack volume show:
$ os volume show $VOL -fvalue -c attachments | python -c 'import sys,pprint;
[]
But it will still be listed as volumes_attached by server show:
$ openstack server show test-instance -fvalue -cvolumes_attached
id='$VOL'
I believe this to be related with the fact that the volume being a boot device, it cannot actually be detached. This indeed happens is I try to remove the volume by means of the openstack CLI:
$ os server remove volume test-instance $VOL
Cannot detach a root device volume (HTTP 403) (Request-ID: req-...)
I think cinder should error in the same way.
Changed in cinder: | |
importance: | Undecided → High |
Changed in cinder: | |
importance: | High → Medium |
tags: | added: attachment-delete nova volume |
This looks like the right behaviour.
If you delete the attachment from Cinder and don't detach from Nova, this is what you would expect to happen.