novaClient.servers.create call fails with block_device_mapping_v2 option

Bug #1521272 reported by john Z
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Won't Fix
Undecided
Arvinder Singh

Bug Description

I was able to create an instance with CLI
$ nova boot --flavor gc1.small --image c85b0898-2bbd-46be-8950-3c031f07cb93 --key-name dev_key --block-device id=c85b0898-2bbd-46be-8950-3c031f07cb93,source=image,dest=volume,type=disk,device=vda,size=30,bootindex=1,shutdown=remove --availability-zone dev_zone --security-groups dev_tech --nic net-id=6fc22c46-b895-408f-b005-b2c4de916d8c ins_from_cl

However, when I run code via Python API:
net = novaClient.networks.find(label='dev_net')
image = novaClient.images.find(name='Base RHEL 6.7 Cloud')
flavor = novaClient.flavors.find(name='gc1.small')
dev_mapping = [{ 'source_type' : 'image', "image_id" : image.id, 'device_name' : 'vda', "volume_id" : "f7c90ef0-925d-4c19-b499-a951793d7572", "volume_size" : 30, "boot_index" : 1, 'destination_type' : 'volume'}]
novaClient.servers.create('ins_from_python', image,flavor , key_name = 'dev_key' ,block_device_mapping_v2 =dev_mapping, availability_zone ='dev_zone', nics = [{'net-id': net.id}])

I got the following error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/share/lib/python2.7/site-packages/novaclient/v2/servers.py", line 995, in create *boot_kwargs)
File "/usr/share/lib/python2.7/site-packages/novaclient/v2/servers.py", line 541, in _boot return_raw=return_raw, *kwargs)
File "/usr/share/lib/python2.7/site-packages/novaclient/base.py", line 172, in _create _resp, body = self.api.client.post(url, body=body)
File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 449, in post return self._cs_request(url, 'POST', *kwargs)
File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 424, in _cs_request resp, body = self._time_request(url, method, *kwargs)
File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 397, in _time_request resp, body = self.request(url, method, **kwargs)
File "/usr/share/lib/python2.7/site-packages/novaclient/client.py", line 391, in request raise exceptions.from_response(resp, body, url, method)
BadRequest: Block Device Mapping is Invalid: Missing device UUID. (HTTP 400) (Request-ID: req-9b4b44fb-659f-4f25-90e2-465343431a21)

And I noticed the a new item was added to dev_mapping list. I tried with "boot_index":0, it still failed.

I am using python-novaclient (2.35.0) with Python 2.7.9.

Changed in python-novaclient:
assignee: nobody → Arvinder Singh (arvinder-singh)
Changed in python-novaclient:
status: New → Confirmed
status: Confirmed → New
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

This bug has been open about two years without any activity.
It is not clear whether this bug can be reproduced in master, latest version (11.0.0), stable/rocky, stable/queens, stable/pike, stable/ocata or not.
This bug can be reopened (set back to "New") if it can be reproduced in master, latest version (11.0.0), stable/rocky, stable/queens, stable/pike or stable/ocata.

Changed in python-novaclient:
status: New → Incomplete
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

This bug has been open for about 3 years without any activity.
I'm going to move it to "Won't Fix".
This bug can be reopened (set back to "New") if someone decides to work on this.

Changed in python-novaclient:
status: Incomplete → Won't Fix
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.