[英]How to add a security group to a VM via the nova-client
I'm trying to use the OpenStack Nova client and create a script in order to launch an instance. 我正在尝试使用OpenStack Nova客户端并创建脚本以启动实例。 I was able to create a VM with a specific key but the problem is that i can't add an existing security group to that instance.
我能够使用特定的密钥创建VM,但是问题是我无法将现有的安全组添加到该实例。
I know how to create a security group and add some rules to it using the nova client. 我知道如何使用nova客户端创建安全组并向其中添加一些规则。
Thank you in advance 先感谢您
After launching an instance you can add a security group to it using the CLI 启动实例后,可以使用CLI向其添加安全组。
nova add-secgroup my-special-server sec-group-3
See the help for more info 请参阅帮助以获取更多信息
nova help add-secgroup
usage: nova add-secgroup <server> <secgroup>
Add a Security Group to a server.
Positional arguments:
<server> Name or ID of server.
<secgroup> Name or ID of Security Group.
Personally I would add the security group during the boot of an instance using the --security-groups
like below 我个人将在实例启动期间使用如下所示的
--security-groups
添加安全组。
nova boot --image cirros-0.3.1-x86_64-uec --flavor m1.tiny --security-groups my-sec-group
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.