openstackclient: booting from image-created volume w/ delete_on_termination

Kurt Garloff openstack at garloff.de
Wed Jul 6 20:51:13 UTC 2022


Hi Dmitriy,

thanks for your response!
It looks like this option is new in Wallaby and it looks like it would 
address my use-case.
I'll grab newer client utils and see whether it works.

-- Kurt

On 06.07.22 13:56, Dmitriy Rabotyagov wrote:
>   Hey!
>
> delete_on_termination is a flag that is provided to nova during volume
> attachment basically.
> So in case of attaching volume to existing server, you can provide
> that flag to attachment:
>
> openstack server add volume --enable-delete-on-termination
> --os-compute-api-version 2.79 $UUID
>
> It's more complex when we're talking about server creation though.
> What openstackclient allows you to do, is to provide --block-device
> flag, where you can provide extra specs to the mapping. You can check
> doc on how to use it here
> https://docs.openstack.org/python-openstackclient/yoga/cli/command-objects/server.html#cmdoption-openstack-server-create-block-device
>
> For API call it would be block_device_mapping_v2 option provided with
> request which supports kind of same format:
> https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#create-server
>
> ср, 6 июл. 2022 г. в 13:21, Kurt Garloff <openstack at garloff.de>:
>> Hi openstack CLI wizards,
>>
>> Having flavors without disks, I want volumes to be created from images on the fly that I can boot from.
>> But I don't want to do bookkeeping for these volumes; they should disappear once the server disappears.
>>
>> On the command line with nova, I can do this:
>> nova boot --nic net-name=$MYNET --key-name $MYKEY --flavor $MYFLAVOR \
>> --block-device "id=$MYIMGIFD,source=image,dest=volume,size=$MYSIZE,shutdown=remove,bootindex=0" $MYNAME
>>
>> I did not find a way to do this with openstack server create.
>> Is there one?
[...]



More information about the openstack-discuss mailing list