Hide Forgot
Cloned from launchpad bug 1336127 Description: when specifying a volume or an image with a user volume to create a virtual machine, if the virtual machine fails to be created for the first time with the parameter delete_on_termination being set “true”, the specified volume or the user volume will be deleted, which causes that the rescheduling fails. for example: 1. upload a image | 62aa6627-0a07-4ab4-a99f-2d99110db03e | cirros-0.3.2-x86_64-uec | ACTIVE 2.create a boot volume by the above image cinder create --image-id 62aa6627-0a07-4ab4-a99f-2d99110db03e --availability-zone nova 1 | b821313a-9edb-474f-abb0-585a211589a6 | available | None | 1 | None | true | | 3. create a virtual machine nova boot --flavor m1.tiny --nic net-id=28216e1d-f1c2-463b-8ae2-330a87e800d2 tralon_disk1 --block-device-mapping vda=b821313a-9edb-474f-abb0-585a211589a6::1:1 ERROR (BadRequest): Block Device Mapping is Invalid: failed to get volume b821313a-9edb-474f-abb0-585a211589a6. (HTTP 400) (Request-ID: req-486f7ab5-dc08-404e-8d4c-ac570d4f4aa1) 4. use the "cinder list" to find that the volume b821313a-9edb-474f-abb0-585a211589a6 has been deleted +----+--------+------+------+-------------+----------+-------------+ | ID | Status | Name | Size | Volume Type | Bootable | Attached to | +----+--------+------+------+-------------+----------+-------------+ +----+--------+------+------+-------------+----------+-------------+
Following Block device mapping invalid exception with delete-on-terminate set to 1, the volume does not get deleted. *************** Version *************** [root@rhos-compute-node-02 ~(keystone_admin)]# yum list installed | grep openstack-nova openstack-nova-api.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-cert.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-common.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-compute.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-conductor.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-console.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-novncproxy.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle openstack-nova-scheduler.noarch 2014.1.5-27.el7ost @rhelosp-5.0-el7-puddle [root@rhos-compute-node-02 ~(keystone_admin)]# **************** Logs **************** [root@rhos-compute-node-02 ~(keystone_admin)]# cinder create --display-name vol1 1 +---------------------+--------------------------------------+ | Property | Value | +---------------------+--------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | created_at | 2016-03-01T21:08:40.346666 | | display_description | None | | display_name | vol1 | | encrypted | False | | id | d52baabc-f7ed-4da3-9cff-387d4d27e39b | | metadata | {} | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | volume_type | None | +---------------------+--------------------------------------+ [root@rhos-compute-node-02 ~(keystone_admin)]# cinder list +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ | ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ | d52baabc-f7ed-4da3-9cff-387d4d27e39b | available | vol1 | 1 | None | false | | +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ [root@rhos-compute-node-02 ~(keystone_admin)]# [root@rhos-compute-node-02 ~(keystone_admin)]# cinder reset-state --state error vol1 [root@rhos-compute-node-02 ~(keystone_admin)]# cinder list +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ | ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ | d52baabc-f7ed-4da3-9cff-387d4d27e39b | error | vol1 | 1 | None | false | | +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ [root@rhos-compute-node-02 ~(keystone_admin)]# [root@rhos-compute-node-02 ~(keystone_admin)]# [root@rhos-compute-node-02 ~(keystone_admin)]# nova boot --image cirros --flavor 2 --block-device-mapping vdc=d52baabc-f7ed-4da3-9cff-387d4d27e39b:::1 vm1 ERROR: Block Device Mapping is Invalid: failed to get volume d52baabc-f7ed-4da3-9cff-387d4d27e39b. (HTTP 400) (Request-ID: req-94cd257a-751e-463c-a808-b9e043c5112a) [root@rhos-compute-node-02 ~(keystone_admin)]# cinder list +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ | ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ | d52baabc-f7ed-4da3-9cff-387d4d27e39b | error | vol1 | 1 | None | false | | +--------------------------------------+--------+--------------+------+-------------+----------+-------------+ [root@rhos-compute-node-02 ~(keystone_admin)]#
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0361.html