Fail to boot VM from image with one ephemeral disk

Bug #1442501 reported by Qin Zhao
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Confirmed
High
BalaGopalaKrishna

Bug Description

Kilo latest code

I attempt to boot a VM from qcow2 image, and also create one ephemeral disk, but my request is refused by nova-api.

[root@icm ~]# nova boot --flavor 1 --image cirros --ephemeral size=2 zhaoqin
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-6e272b55-a20e-4e1c-9b76-c1fb9d232fa6)

The error is raised from _validate_bdm() in nova/compute/api.py. Since there is only one ephemeral disk in block_device_mapping_v2 list and its boot_index is -1, boot_indexes becomes an empty list. And the error is raised, because 0 is not in boot_indexes list:

        if 0 not in boot_indexes or not _subsequent_list(boot_indexes):
            raise exception.InvalidBDMBootSequence()

Revision history for this message
jichenjc (jichenjc) wrote :

well , not sure it's related to https://review.openstack.org/#/c/165932/
can you check whether your novaclient has the update?

--image should insert a boot index 0 record so this validation should pass

Revision history for this message
Qin Zhao (zhaoqin) wrote :

@Ji Chen, if I add the image to block_device_mapping_v2, I get a new error:

[root@icm ~]# curl -g -i -X POST http://10.104.0.30:8774/v2/a33ebeca3172404aad880a3d3996f66c/servers -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 7f33401505cd479a8d4c9a6480a54803" -d '{"server": {"name": "zhaoqin", "imageRef": "0e3af016-30bb-4b87-b0fc-f88e29744d05", "block_device_mapping_v2": [{"source_type": "image", "boot_index": 0, "delete_on_termination": true, "destination_type": "local", "uuid": "0e3af016-30bb-4b87-b0fc-f88e29744d05"}, {"source_type": "blank", "boot_index": -1, "delete_on_termination": true, "volume_size": "2", "destination_type": "local"}], "flavorRef": "1", "max_count": 1, "min_count": 1}}'
HTTP/1.1 400 Bad Request
Content-Length: 117
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-658dacc8-d7fa-4d15-b9d4-c5d8ad4d7804
Date: Fri, 10 Apr 2015 14:38:34 GMT

{"badRequest": {"message": "Block Device Mapping is Invalid: Mapping image to local is not supported.", "code": 400}}

Revision history for this message
Qin Zhao (zhaoqin) wrote :

If our assumption is that block_device_mapping_v2 must contains one entry whose boot_index is 0, we will need an entry whose source type is image as I does in comment #2. However, api does not allow me to place this image disk on local drive.

What is the correct api request which can create a instance from image, place boot disk on local drive, and also create one ephemeral disk on local drive for this instance?

Revision history for this message
Qin Zhao (zhaoqin) wrote :

Thanks, Ji Chen. I feel https://review.openstack.org/#/c/166401/ should make it work. Let me have a test.

jichenjc (jichenjc)
Changed in nova:
importance: Undecided → High
status: New → Confirmed
Changed in nova:
assignee: nobody → Noel Nelson Dsouza (noelnelson)
Revision history for this message
Noel Nelson Dsouza (noelnelson) wrote :
Download full text (3.8 KiB)

jichenjc (jichenjc) ,

I am not able to reproduce above bug.

My Environment
I am using Juno Version of Devstack.

Scenario I tried

stack@onecloud-Standard-PC-i440FX-PIIX-1996:~/devstack$ nova boot --image cirros-0.3.4-x86_64-uec --flavor 8 --ephemeral size=1 vm5
+--------------------------------------+----------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000009 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | m3dMTKpvpEUC |
| config_drive | |
| created | 2015-05-14T11:39:11Z |
| flavor | flv_5_root_2_eph_1_swap (8) |
| hostId | |
| id | 73c9401d-88bc-4d8a-830a-b41df5ac16f9 |
| image | cirros-0.3.4-x86_64-uec (b25c32d5-6c13-4c30-a36f-34e7f694446e) |
| key_name | - |
| metadata | {} |
| name | vm5 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default ...

Read more...

Revision history for this message
BalaGopalaKrishna (bala-9) wrote :

I've reproduces the isuue with kilo version.

stack@openstack:~/devstack$ nova boot --image cirros-0.3.2-x86_64-uec --flavor 1 --ephemeral size=1 VM1
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-ae01afac-7770-4e28-a201-0bfb454d0091)

Revision history for this message
BalaGopalaKrishna (bala-9) wrote :

Thanks jichenjc, This bug is because of python-novaclient version difference

as you said we need to backport https://review.openstack.org/#/c/165932/ to stable/kilo to resolve this bug.

affects: nova → python-novaclient
Changed in python-novaclient:
assignee: Noel Nelson Dsouza (noelnelson) → BalaGopalaKrishna (bala-9)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/216401

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-novaclient (stable/kilo)

Change abandoned by BalaGopalaKrishna (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/216401
Reason: I had sent another patch for the same.

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.