Ask Your Question
1

API inconsistency in list-volumes response on cinder vs nova?

asked 2013-10-30 14:20:49 -0500

steve-gregory gravatar image

Hello,

I noticed that when I directly call the cinder API and ask for a 'list-volumes' the response returned differs from the same list-volumes call made in nova.

Here is the object returned by cinder: (/volumes/detail?all_tenants=1)

{'volumes': [{'attachments': [{'device': '/dev/vdb',
 'id': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317',
 'server_id': '0445014a-7028-443b-a97c-d098fc22a55d',
 'volume_id': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317'}],
'availability_zone': 'ValhallaRegion',
'bootable': 'false',
'created_at': '2013-10-24T18:50:57.000000',
'display_description': u'',
'display_name': 'Volumename',
'id': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317',
'metadata': {},
'os-vol-host-attr:host': 'thor',
'os-vol-tenant-attr:tenant_id': '8a5cd2e83dba4b8888c078fe6236acba',
'size': 45,
'snapshot_id': None,
'source_volid': None,
'status': 'in-use',
'volume_type': 'None'}]}

Here is the object returned by nova (/os-volumes extension):

{'volumes': [{'attachments': [{'device': '/dev/vdb',
 'id': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317',
 'serverId': '0445014a-7028-443b-a97c-d098fc22a55d',
 'volumeId': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317'}],
 'availabilityZone': 'ValhallaRegion',
 'createdAt': '2013-10-24T18:50:57.000000',
 'displayDescription': u'',
 'displayName': 'RExplorer_temp2',
 'id': '8b9b1db6-fbcb-4ff5-8e46-375556a8b317',
 'metadata': {},
 'size': 45,
 'snapshotId': None,
 'status': 'in-use',
 'volumeType': 'None'}]}

Is there a reason the API returns an inconsistent value? Which one is 'correct', camelCased or separated_by_underscores?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-11-22 07:26:31 -0500

cyeoh-0 gravatar image

Both are correct - its the same underlying data, just with different keynames for the values. They are different because in the first case you are accessing the cinder API directly. With the latter, list-volumes is a request to the Nova API which then calls the cinder REST API and proxies the data back. However in doing so, it slightly transforms it, changing the keynames in some cases to CamelCase rather than snake_case.

In the Nova V3 API os-volumes interface is removed and it is expected that clients will just access the cinder API directly (there is no advantage in going via Nova to get the same information).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-10-30 14:20:49 -0500

Seen: 186 times

Last updated: Nov 22 '13