Volume status changed from error to available
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Matt Riedemann | ||
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Description
===========
After creating a volume which resulted with status = "error", an attempt to attach the volume to VM will fail and will change the volume status to - "available".
Steps to reproduce
==================
1. Create volume with status = "error".
2. Try to attach the volume to the VM.
3. Check the volume status.
Expected result
===============
1. Volume will be created with status = "error".
2. Attachment to VM will failed.
3. Volume status will be - "error"
Actual result
=============
1. Volume created in status = "error".
2. Attachment attempt to VM will fail.
3. Volume status changed from "error" to "available".
Environment
===========
[stack@
openstack 3.14.2
[stack@
openstack-
openstack-
openstack-
openstack-
openstack-
python-
openstack-
python2-
puppet-
[stack@
[stack@
python2-
puppet-
[stack@
[stack@
Vendor: Seabios
Product Name: KVM
Storage:
ceph version 12.2.4
tags: | added: volumes |
Changed in cinder: | |
assignee: | nobody → Matt Riedemann (mriedem) |
OK so nova and cinder are both at the queens release, which means when you attach the volume to the server, the compute API should create a volume attachment record on the given volume. If the volume is in 'error' status I'd expect that to fail like how the old volume reserve action would fail for a volume in error status.
Looking at the cinder volume attachment create code, it should fail if the volume isn't in 'available' or 'downloading' status:
https:/ /github. com/openstack/ cinder/ blob/9bc9a528ef 46522fd727a2a04 7da435c658a15c5 /cinder/ volume/ api.py# L2084
It seems that this is the problem - because there is an instance_uuid, override=True:
https:/ /github. com/openstack/ cinder/ blob/9bc9a528ef 46522fd727a2a04 7da435c658a15c5 /cinder/ volume/ api.py# L2093
And then the volume statis us changed to reserved:
https:/ /github. com/openstack/ cinder/ blob/9bc9a528ef 46522fd727a2a04 7da435c658a15c5 /cinder/ volume/ api.py# L2111
Then once the attach on the compute actually fails, we'd delete the attachment from the nova side and the volume will be back in 'available' status because it no longer has any attachments:
https:/ /github. com/openstack/ cinder/ blob/9bc9a528ef 46522fd727a2a04 7da435c658a15c5 /cinder/ volume/ api.py# L2193
Compare that to how the volume "reserve" action works:
https:/ /github. com/openstack/ cinder/ blob/9bc9a528ef 46522fd727a2a04 7da435c658a15c5 /cinder/ volume/ api.py# L690
If the volume isn't 'available' it will fail.