Comment 4 for bug 1416269

Revision history for this message
Mark Goddard (mgoddard) wrote :

Also seen on a Kilo install using a modified nova & ironic with block device support (which admittedly may be interfering, I'm not sure).

I found that using the legacy --block-device-mapping worked, but --block-device did not.

nova boot --image img --block-device source=volume,dest=volume,id=23d3fd8d-7c54-4c23-afe0-b3361c9c5f74,shutdown=preserve,bootindex=1 --key-name default --flavor ironic_flavor instance
ERROR (BadRequest): Block Device Mapping is Invalid: Boot sequence for the instance and image/block device mapping combination is not valid. (HTTP 400)

I tried bootindex as -1, 0, 1 and absent with the same result.

The exception seems to be thrown at https://github.com/openstack/nova/blob/stable/kilo/nova/compute/api.py#L1278. It's checking that at least one block device has boot index 0 and that all block devices are strictly ascending in boot index.

Adding some debug logging to that method to print the BDMs, I found the following results:

• If you create an instance with just an image, you get one block device, source=image,dest=local,image_id=<ID>,bootindex=0. This is not passed by the nova client (use --debug), so is being generated within Nova.
• If you create an instance with an image and --block-device-mapping, you get the above block device, plus another for the volume.
• If you create an instance with an image and --block-device, you just get the volume block-device. This causes the check for a bootindex 0 device to fail.