Show volume attachment exception does not looks good if server is in shelved_offloaded state

Bug #1554440 reported by Ghanshyam Mann on 2016-03-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Matt Riedemann

Bug Description

In microversion v2.20, Nova allows to attach/detach volume on server in shelved or shelved_offloaded state.

When server is in shelved_offloaded state, it means server is not on any host. And volume attach operation is done directly via cinder.
In that case device volume mount will be defered until the instance is unshelved. Which is valid case and all fine till here.

Now issue is if users does the list attachments for server in shelved_offloaded state, it return the attachements without 'device' But
Show volume attachment throw exception as there is no mount point for that attachment

List and show attachments should be consistent for server in shelved_offloaded state.

Although error message if volume not mount - "volume_id not found: %s" does not sounds very nice here for other case too.

Tags: api Edit Tag help
Changed in nova:
assignee: nobody → Ghanshyam Mann (ghanshyammann)
tags: added: api
Changed in nova:
importance: Undecided → High
status: New → Triaged
Andrea Rosa (andrea-rosa-m) wrote :

Good catch, so we need to check the status of the VM (and the API versions as well??) before raising the excpetion.

Fix proposed to branch: master

Changed in nova:
status: Triaged → In Progress

Change abandoned by Michael Still (<email address hidden>) on branch: master
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

Sean Dague (sdague) wrote :

Patch stalled

Changed in nova:
status: In Progress → Confirmed
importance: High → Medium
assignee: Ghanshyam Mann (ghanshyammann) → nobody
Nazeema Begum (nazeema123) wrote :

Can someone provide the reproduction steps for this bug ...!Thanks in advance

Matt Riedemann (mriedem) wrote :

Nazeema, I think these are the steps:

1. Boot a server
2. Shelve the server (it should offload by default, which sets in the database).
3. With microversion 2.20, attach a volume to the server. Since the server doesn't have a host, this is all just information stored in the database and the bdm.device_name is None.
4. List/Show volume attachments for the server using the os-volume_attachments API - that results in a 404 error here because the bdm doesn't have a device_name set:

Matt Riedemann (mriedem) wrote :

By the way, I don't agree with needing a microversion to fix this. This was clearly a regression introduced with the 2.20 microversion.

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers