In Openstack Horizon UI, I can specify if I want to create a new volume, it gets the same size of the flavour by default and its correctly attached to the root fs, so I can have persistence of the whole instance.
I would like do this in openstack-cli.
Is there any way to do it with the server create
command? In the docs I only found that you have to create and configurate the volume manually, attach it and inside the instance modify the mountpoints.
I would like to know if there is a way with:
openstack server create --flavor foo --image foo --security-group all_in --key-name foo --name foo --wait
It seems like you are searching for this option:
--boot-from-volume <volume-size>
When used in conjunction with the ``--image`` or
``--image-property`` option, this option automatically
creates a block device mapping with a boot index of 0
and tells the compute service to create a volume of
the given size (in GB) from the specified image and
use it as the root disk of the server. The root volume
will not be deleted when the server is deleted. This
option is mutually exclusive with the ``--volume``
option.
I recommend to check out the help pages for the cli commands, in this case openstack help server create
.