英文:
Create Openstack instance with a new volume
问题
在Openstack Horizon UI中,我可以指定是否要创建一个新的卷,它默认会与flavour相同的大小,并且会正确地附加到根文件系统,这样我就可以保持整个实例的持久性。我想在openstack-cli中执行类似的操作。是否有办法在server create
命令中实现这一点?在文档中,我只找到了需要手动创建和配置卷,然后附加它,并在实例内部修改挂载点的说明。我想知道是否有以下方式可以实现:
openstack server create --flavor foo --image foo --security-group all_in --key-name foo --name foo --wait
英文:
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
答案1
得分: 0
看起来你正在搜索这个选项:
--boot-from-volume
当与“--image”或“--image-property”选项一起使用时,此选项会自动创建一个引导索引为0的块设备映射,并告诉计算服务创建一个指定大小(以GB为单位)的卷,使用指定的镜像作为服务器的根磁盘。当删除服务器时,根卷不会被删除。此选项与“--volume”选项互斥。
我建议查看CLI命令的帮助页面,本例中使用 openstack help server create
。
英文:
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论