cinder v3 api: show hides some attachments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Undecided
|
Unassigned |
Bug Description
OS_VOLUME_
While debugging nova's use of the new v3 cinder attachment api, I noticed that the cinderclient show command would return attachment results inconsistent with what is in the volume object and in the database. An example:
$ cinder show vol1
+------
| Property | Value |
+------
| attachments | [] |
| availability_zone | nova |
...
| id | 383f401e-
...
| status | in-use |
...
But on the volume object you can see several attachments:
(Pdb) volume.
VolumeAttachmen
(Pdb) volume.
VolumeAttachmen
And in the db is this (just showing the first attachment):
mysql> select * from volume_attachment;
...
| created_at | updated_at | deleted_at | deleted | id | volume_id | attached_host | instance_uuid | mountpoint | attach_time | detach_time | attach_mode | attach_status | connection_info |
...
| 2017-06-12 17:13:05 | 2017-06-12 17:13:05 | NULL | 0 | 03717a2b-
I tracked it down to this statement on api/v3/volumes.py:
volumes = self._view_
The volumes going into this method have the attachments listed above, but are stripped out by this function. What's odd is that when I create a new attachment, it is visible in the show command.
(This is problematic as the user doesn't see these attachments. For example, when I deleted an instance with a bfv disk, the status of the volume stayed 'in-use' because of these hidden attachments and I had no idea why that is happening. If I knew they were there I could have deleted them.)
Changed in cinder: | |
assignee: | nobody → NidhiMittalHada (nidhimittal19) |
Actually, OS_VOLUME_ API_VERSION= 2