boot from image created with nova image-create from a volume backed instance is rejected

Bug #1381598 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Balazs Gibizer

Bug Description

It is not possible to boot the image that was created with nova image-create from a volume backed instance.

Steps to reproduce:
stack@stack:~/devstack$ nova boot --flavor 100 --block-device source=image,id=70b5a8e8-846f-40dc-a52d-558d37dfc7f1,dest=volume,bootindex=0,size=1 volume-backed
+--------------------------------------+-------------------------------------------------+
| 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-00000017 |
| 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 | wvUa22QCTaoR |
| config_drive | |
| created | 2014-10-15T15:07:39Z |
| flavor | install-test (100) |
| hostId | |
| id | 9ad985f6-5e76-4545-9702-0b8a6058ef57 |
| image | Attempt to boot from volume - no image supplied |
| key_name | - |
| metadata | {} |
| name | volume-backed |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | 89dda4659c7e403392e9bcfc14ca6c80 |
| updated | 2014-10-15T15:07:39Z |
| user_id | 4c9283c1cbc54d688e2dda83fbc4aa11 |
+--------------------------------------+-------------------------------------------------+

stack@stack:~/devstack$ nova show 9ad985f6-5e76-4545-9702-0b8a6058ef57
+--------------------------------------+----------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | stack |
| OS-EXT-SRV-ATTR:hypervisor_hostname | stack |
| OS-EXT-SRV-ATTR:instance_name | instance-00000017 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | - |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2014-10-15T15:07:47.000000 |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2014-10-15T15:07:39Z |
| flavor | install-test (100) |
| hostId | 337fdcb2bd1ee3ad5bbe5e498310984745f473c82ef41b7276d1b449 |
| id | 9ad985f6-5e76-4545-9702-0b8a6058ef57 |
| image | Attempt to boot from volume - no image supplied |
| key_name | - |
| metadata | {} |
| name | volume-backed |
| os-extended-volumes:volumes_attached | [{"id": "fdcc1414-a42e-42f7-803e-d40f8b872787"}] |
| private network | 10.0.0.2 |
| progress | 0 |
| security_groups | default |
| status | ACTIVE |
| tenant_id | 89dda4659c7e403392e9bcfc14ca6c80 |
| updated | 2014-10-15T15:07:47Z |
| user_id | 4c9283c1cbc54d688e2dda83fbc4aa11 |
+--------------------------------------+----------------------------------------------------------+
stack@stack:~/devstack$ nova image-create 9ad985f6-5e76-4545-9702-0b8a6058ef57 image-from-volume-backed
stack@stack:~/devstack$ nova image-show image-from-volume-backed
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-EXT-IMG-SIZE:size | 0 |
| created | 2014-10-15T15:10:40Z |
| id | c0283b1b-e567-48ce-b784-0ff1ce8245bb |
| metadata bdm_v2 | True |
| metadata block_device_mapping | [{"guest_format": null, "boot_index": 0, "no_device": null, "image_id": null, "snapshot_id": "ed729800-36ab-4ba1-89c2-36f99bd398a9", "disk_bus": "virtio", "volume_size": null, "source_type": "snapshot", "device_type": "disk", "volume_id": null, "destination_type": "volume", "delete_on_termination": null}] |
| metadata checksum | 4eada48c2843d2a262c814ddc92ecf2c |
| metadata container_format | ami |
| metadata disk_format | ami |
| metadata image_id | 70b5a8e8-846f-40dc-a52d-558d37dfc7f1 |
| metadata image_name | cirros-0.3.2-x86_64-uec |
| metadata kernel_id | 3d8e1ae1-7e24-45d8-9064-adfcf18d1b80 |
| metadata min_disk | 0 |
| metadata min_ram | 0 |
| metadata ramdisk_id | 5634fe26-f909-4c88-a455-e6e44fa8ee56 |
| metadata root_device_name | /dev/vda |
| metadata size | 25165824 |
| minDisk | 0 |
| minRam | 0 |
| name | image-from-volume-backed |
| progress | 100 |
| status | ACTIVE |
| updated | 2014-10-15T15:10:40Z |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

stack@stack:~/devstack$ nova boot --flavor 100 --block-device source=image,id=c0283b1b-e567-48ce-b784-0ff1ce8245bb,dest=volume,bootindex=0,size=1 volume-backed-from-snap-image
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-87ae0d82-65dc-4b7b-ac99-88f70b7fe32c)

It seems that it is only a validation problem on API level as the same image can be booted with --image parameter.

Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/128891

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/128891
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=48fca2fa32bf9f8cf2bba035fc3ad6fd9170e6f4
Submitter: Jenkins
Branch: master

commit 48fca2fa32bf9f8cf2bba035fc3ad6fd9170e6f4
Author: Balazs Gibizer <email address hidden>
Date: Wed Oct 15 16:58:55 2014 +0200

    Fix bdm transformation for volume backed servers

    When volume backed server is snapshoted with nova image-create
    then the image is created with a proper bdm. However when this
    image is booted with image->volume bdm the two bdms are not
    merged properly and the server cannot be booted as it gets two
    boot_index = 0 device

    This patch solves the issue by removing the unnecessary device
    from the mapping.

    Closes-bug: #1381598

    Change-Id: I170e80d35fe8a8d906370a507148351926763a13

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-3 → 2015.1.0
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.