HEAT update failed on block volume operation
Dear friends, again need your assistance.
Summary: HEAT stack update fails when adding new block volume to 'block_device_mapping_v2' section in OS::Nova::Server resource.
I'm trying, using Heat, manipulate VM's block volume allocation, using the following template:
centos_v7:
type: OS::Glance::Image
properties:
[ ... ]
location: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
din3_volume:
type: OS::Cinder::Volume
properties:
size: 30
name: din3_boot
image: { get_resource: centos_v7 }
# Aux volume, will be used later in the example
din3_aux:
type: OS::Cinder::Volume
properties:
size: 15
name: din3_aux
din3_init:
type: OS::Heat::MultipartMime
properties: [ ... ]
din3:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
block_device_mapping_v2:
- delete_on_termination: true
swap_size: 512
- delete_on_termination: false
boot_index: 0
volume_id: { get_resource: din3_volume }
networks:
- port: { get_resource: din3-i2e }
user_data_format: SOFTWARE_CONFIG
user_data: { get_resource: din3_init }
There are other resources in the stack and creation of stack ends with success and both volumes are exist in the stack:
doka/doka@doka.ua:~/heat $ openstack volume list | e15795cb-bea1-4a3b-b910-d39b18541ca3 | din3_boot | in-use | 32 | Attached to din3 on /dev/vda | f709ab08-0f9d-4ae3-9645-7af7e1ea9659 | din3_aux | available | 16 |
As soon as I add din3_aux to "block_device_mapping_v2" section, changing nothing more:
din3:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
block_device_mapping_v2:
- delete_on_termination: true
swap_size: 512
- delete_on_termination: false
boot_index: 0
volume_id: { get_resource: din3_volume }
- delete_on_termination: true
boot_index: 1
volume_id: { get_resource: din3_aux }
networks:
- port: { get_resource: din3-i2e }
user_data_format: SOFTWARE_CONFIG
user_data: { get_resource: din3_init }
update of stack fails with the following message:
stack_status | UPDATE_FAILED
stack_status_reason | Resource CREATE failed: BadRequest: resources.din3: Invalid volume:
volume 'e15795cb-bea1-4a3b-b910-d39b18541ca3' status must be 'available'.
Currently in 'in-use' (HTTP 400)
(Request-ID: req-203313ac-e81d-42f5-8a56-c17ad02eb14f)
Of course, din3_volume is in use since VM is running and din3_volume is bootable one. Questions are:
1) is it a bug or a feature? :-)
2) adding new volume is atomic operation and can be successfully done using Openstack CLI - why same operation in Heat results in reconfiguration of existing volumes? Are there ways to make them atomic in Heat as well?
Any recommendations on how to avoid reconfiguration of block volume on update which don't touch this block volume are highly welcome.
Thanks!
Please raise a bug.
Hi Zaneb, thanks! Done - https://bugs.launchpad.net/heat/+bug/...