[openstack-dev] [nova] Block Device Mapping is Invalid error

aburluka aburluka at parallels.com
Tue Mar 17 13:52:57 UTC 2015


Hello once more!

It turned out that proper "body" arg will be generated if you add 
another --block-device param with source=image like this:

nova boot qwe --flavor vm1 --image cent-os7-vm --block-device 
id=0af1f5a8-8172-4936-a958-90486759d598,source=volume,dest=volume,device=sdb,bootindex=1 
--block-device 
id=1b6fd7a7-16b6-4053-91d1-41a625d6b185,source=image,device=sda,bootindex=0

Can you clarify please if API was changed since Juno release. Is it 
redundant since we specify --image param?

On 03/16/2015 06:55 PM, aburluka wrote:
> Hello Nova!
>
> I'd like to ask community to help me with some unclear things. I'm 
> currently working on adding persistent storage support into a 
> parallels driver.
>
> I'm trying to start VM.
>
> nova boot test-vm --flavor m1.medium --image centos-vm-32 --nic 
> net-id=c3f40e33-d535-4217-916b-1450b8cd3987 --block-device 
> id=26b7b917-2794-452a-95e5-2efb2ca6e32d,bus=sata,source=volume,bootindex=1
>
> Got an error:
> ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for 
> the instance and image/block device mapping combination is not valid. 
> (HTTP 400) (Request-ID: req-454a512c-c9c0-4f01-a4c8-dd0df0c2e052)
>
>
> nova/api/openstack/compute/servers.py
> def create(self, req, body)
> Has such "body" arg:
> {u'server':
>     {u'name': u'test-vm',
>      u'imageRef': u'b9349d54-6fd3-4c09-94f5-8d1d5c5ada5c',
>      u'block_device_mapping_v2': [{u'disk_bus': u'sata',
>                                    u'source_type': u'volume',
>                                    u'boot_index': u'1',
>                                    u'uuid': 
> u'26b7b917-2794-452a-95e5-2efb2ca6e32d'}],
>      u'flavorRef': u'3',
>      u'max_count': 1,
>      u'min_count': 1,
>      u'networks': [{u'uuid': u'c3f40e33-d535-4217-916b-1450b8cd3987'}],
>      'scheduler_hints': {}
>     }
> }
>
> Such block device mapping leads to bad boot indexes list.
> I've tried to watch this argument while executing similiar command 
> with kvm hypervisor on Juno RDO and get something like in "body":
>
> {u'server': {u'name': u'test-vm',
>  u'imageRef': u'78ad3d84-a165-42bb-93c0-a4ad1f1ddefc',
>  u'block_device_mapping_v2': [{u'source_type': u'image',
>                                u'destination_type': u'local',
>                                u'boot_index': 0,
>                                u'delete_on_termination': True,
>                                u'uuid': 
> u'78ad3d84-a165-42bb-93c0-a4ad1f1ddefc'},
>
>                              {u'disk_bus': u'sata',
>                               u'source_type': u'volume',
>                               u'boot_index': u'1',
>                               u'uuid': 
> u'57a27723-65a6-472d-a67d-a551d7dc8405'}],
>  u'flavorRef': u'3',
>  u'max_count': 1,
>  u'min_count': 1,
>  'scheduler_hints': {}}}
>
> Can you answer next questions please:
> 1) Does the first version miss an 'source_type': 'image' arg?
> 2) Where should and image block_device be added to this arg? Does it 
> come from novaclient or is it added by some callback or decorator?
>
> Looking forward for your help!
>

-- 
Regards,
Alexander Burluka




More information about the OpenStack-dev mailing list