使用新卷创建OpenStack实例

huangapple go评论143阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月8日 18:01:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/75671612.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定