Comment 3 for bug 1570107

Revision history for this message
Nodir Kodirov (knodir) wrote :

I am not able to reproduce the bug on devstack (running inside VM). The behaviour I see is correct as per documentation (http://docs.openstack.org/developer/nova/block_device_mapping.html). Note that I am using QEMU as a backend (not KVM). See details below.

I created two volumes:
1) bootable Cirros (volume ID=45d6a4e4-c478-4b28-9850-049b5c9a8d51)
2) bootable Ubuntu (volume ID=2bffb48d-c859-4df1-a2a7-66e98af43837)

When both volumes are "available", I created VM by specifying Ubuntu as a bootable (bootindex=0) and Cirros as (bootindex=-1)
$ nova --debug boot --flavor 2 --block-device source=volume,id=2bffb48d-c859-4df1-a2a7-66e98af43837,dest=volume,size=5,shutdown=preserve,bootindex=0 --block-device source=volume,id=45d6a4e4-c478-4b28-9850-049b5c9a8d51,dest=volume,size=1,shutdown=preserve,bootindex=-1 uvm
[...]
DEBUG (session:248) REQ: curl -g -i -X POST http://192.168.229.137:8774/v2.1/os-volumes_boot -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.25" -H "X-Auth-Token: {SHA1}db2d307d5a2df66c6cb0a53c3cd7b0d8d77314e5" -d '{"server": {"name": "uvm", "imageRef": "", "block_device_mapping_v2": [{"boot_index": "0", "uuid": "2bffb48d-c859-4df1-a2a7-66e98af43837", "volume_size": "5", "source_type": "volume", "destination_type": "volume", "delete_on_termination": false}, {"boot_index": "-1", "uuid": "45d6a4e4-c478-4b28-9850-049b5c9a8d51", "volume_size": "1", "source_type": "volume", "destination_type": "volume", "delete_on_termination": false}], "flavorRef": "2", "max_count": 1, "min_count": 1}}'
[...]

VM successfully created with Ubuntu image (as expected).

I repeated the same experiment by swapping bootable index values, i.e., Ubuntu bootindex=-1 and Cirros bootindex=0.
$ nova --debug boot --flavor 2 --block-device source=volume,id=2bffb48d-c859-4df1-a2a7-66e98af43837,dest=volume,size=5,shutdown=preserve,bootindex=-1 --block-device source=volume,id=45d6a4e4-c478-4b28-9850-049b5c9a8d51,dest=volume,size=1,shutdown=preserve,bootindex=0 cvm
[...]
DEBUG (session:248) REQ: curl -g -i -X POST http://192.168.229.137:8774/v2.1/os-volumes_boot -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.25" -H "X-Auth-Token: {SHA1}12de1ea7163bebdf6a77566061f24036a69941dd" -d '{"server": {"name": "cvm", "imageRef": "", "block_device_mapping_v2": [{"boot_index": "-1", "uuid": "2bffb48d-c859-4df1-a2a7-66e98af43837", "volume_size": "5", "source_type": "volume", "destination_type": "volume", "delete_on_termination": false}, {"boot_index": "0", "uuid": "45d6a4e4-c478-4b28-9850-049b5c9a8d51", "volume_size": "1", "source_type": "volume", "destination_type": "volume", "delete_on_termination": false}], "flavorRef": "2", "max_count": 1, "min_count": 1}}'

VM successfully created with Cirros image (as expected).