cinder v3 api: show hides some attachments

Bug #1697775 reported by Steve Noyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

OS_VOLUME_API_VERSION=3.27

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-7efd-49a7-8f8f-bbde13bc6d75 |
...
| status | in-use |

...

But on the volume object you can see several attachments:

(Pdb) volume.volume_attachment
VolumeAttachmentList(objects=[VolumeAttachment(03717a2b-def0-4c81-bc4e-26321201e7b2),VolumeAttachment(08f54892-5239-4728-a8d0-372909ed92b0),VolumeAttachment(24c8102a-8e21-4549-ba91-462b27f2bd32),VolumeAttachment(533e1307-c3be-4c97-99e2-c5985c0db6a4),VolumeAttachment(91324508-3747-4a2a-88c5-7ed6aef93a61),VolumeAttachment(c9e8e17b-834a-42f4-a700-b27e6d4f3d52),VolumeAttachment(d95e3cb3-e870-4c3c-baeb-742804cd4ae4),VolumeAttachment(de35d101-22d2-4a10-86b5-c411de6c847a),VolumeAttachment(fc7ec819-4df1-4ee9-b373-420559aa8d0d)])

(Pdb) volume.volume_attachment[0]
VolumeAttachment(attach_mode=None,attach_status='reserved',attach_time=None,attached_host=None,connection_info={},created_at=2017-06-12T17:13:05Z,deleted=False,deleted_at=None,detach_time=None,id=03717a2b-def0-4c81-bc4e-26321201e7b2,instance_uuid=756f2c2f-57fd-4b0e-a656-03c4aceac594,mountpoint=None,updated_at=2017-06-12T17:13:05Z,volume=Volume(383f401e-7efd-49a7-8f8f-bbde13bc6d75),volume_id=383f401e-7efd-49a7-8f8f-bbde13bc6d75)

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-def0-4c81-bc4e-26321201e7b2 | 383f401e-7efd-49a7-8f8f-bbde13bc6d75 | NULL | 756f2c2f-57fd-4b0e-a656-03c4aceac594 | NULL | NULL | NULL | NULL |

I tracked it down to this statement on api/v3/volumes.py:

    volumes = self._view_builder.detail_list(req, volumes)

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.)

Revision history for this message
Steve Noyes (steve-noyes) wrote :

Actually, OS_VOLUME_API_VERSION=2

Changed in cinder:
assignee: nobody → NidhiMittalHada (nidhimittal19)
Revision history for this message
Steve Noyes (steve-noyes) wrote :

Importantly, I did not mention that this is running with John Griffith's new cinder v3 api POC code- https://review.openstack.org/#/c/330285/

I cannot say whether this problem exists in master.

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: NidhiMittalHada (nidhimittal19) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.