Python SoftLayer命令行界面-SLCLI-仅实例专用节点
我希望使用SLCLI在SoftLayer上实现一个专用虚拟机实例。到目前为止,此命令创建了一个实例,但关键是它会自动分配一个我不想要的公共接口,并且不会在我想要的特定专用VLAN上创建机器:Python SoftLayer命令行界面-SLCLI-仅实例专用节点,python,ibm-cloud-infrastructure,Python,Ibm Cloud Infrastructure,我希望使用SLCLI在SoftLayer上实现一个专用虚拟机实例。到目前为止,此命令创建了一个实例,但关键是它会自动分配一个我不想要的公共接口,并且不会在我想要的特定专用VLAN上创建机器: # slcli vs create --image 1060669 --hostname ejkpoc --domain ejk.co.uk --cpu 1 --memory 1 --datacenter lon02 --postinstall https://10.1.1.13/files/bootstr
# slcli vs create --image 1060669 --hostname ejkpoc --domain ejk.co.uk --cpu 1 --memory 1 --datacenter lon02 --postinstall https://10.1.1.13/files/bootstrap-rhel-5.sh --billing hourly
社区有没有关于如何更改命令以获得所需结果的想法?我会同时继续黑客攻击
谢谢
EJK
*****************更新
因此,在尝试了更多之后,我现在有了正确的命令行结构:
slcli vs create --billing=hourly --image=1060669 --hostname=ejkpoc --domain=ejk.co.uk --cpu=1 --memory=1 --datacenter=lon02 --postinstall=https://10.1.1.13/files/bootstrap-rhel-5.sh --vlan-private=1138
但这是一个错误:
SoftLayerAPIError(SoftLayer_Exception_Public): Could not obtain network VLAN with id #1138.
干杯
EJK
****************更新
绝对是正确的VLAN。。。1138
1138是唯一一个作为ID的整数值
谢谢
EJK
***********更新
Nelson是对的VLAN ID位于URL中,所以我的是
这条线路现在可以工作了,机器正在正确的专用VLAN上创建。。但是虽然我不想那样,但他们也会提供一个公共VLAN。。命令到目前为止,这是有效的
slcli vs create --billing=hourly --image=1060669 --hostname=ejkpoc --domain=ejk.co.uk --cpu=1 --memory=1 --datacenter=lon02 --postinstall=https://10.1.1.13/files/bootstrap-rhel-5.sh --vlan-private=1227409
对我来说,分配一个public的主要问题是,所有带有attaches to Chef等的postinstall引导现在都在注册public的FQDN-真恶心!
干杯
EJK
************更新
现在都在工作。。。我在上面的SLCLI命令中遗漏了“-private”选项。。。非常感谢尼尔森 运行命令:
slcli vs create --help
您将看到,要在专用网络中创建VSI,只需添加--private
参数。还列出了如何在特定VLAN中创建VSI:
$ slcli vs create --help
Usage: slcli vs create [OPTIONS]
Order/create virtual servers.
Options:
-H, --hostname TEXT Host portion of the FQDN [required]
-D, --domain TEXT Domain portion of the FQDN [required]
-c, --cpu INTEGER Number of CPU cores [required]
-m, --memory INTEGER Memory in mebibytes [required]
-d, --datacenter TEXT Datacenter shortname [required]
-o, --os TEXT OS install code. Tip: you can specify
<OS>_LATEST
--image TEXT Image ID. See: 'slcli image list' for reference
--billing [hourly|monthly] Billing rate [default: hourly]
--dedicated / --public Create a dedicated Virtual Server (Private Node)
--san Use SAN storage instead of local disk.
--test Do not actually create the virtual server
--export PATH Exports options to a template file
-i, --postinstall TEXT Post-install script to download
-k, --key TEXT SSH keys to add to the root user (multiple
occurrence permitted)
--disk TEXT Disk sizes (multiple occurrence permitted)
--private Forces the VS to only have access the private
network
--like TEXT Use the configuration from an existing VS
-n, --network TEXT Network port speed in Mbps
-g, --tag TEXT Tags to add to the instance (multiple occurrence
permitted)
-t, --template PATH A template file that defaults the command-line
options
-u, --userdata TEXT User defined metadata string
-F, --userfile PATH Read userdata from file
--vlan-public INTEGER The ID of the public VLAN on which you want the
virtual server placed
--vlan-private INTEGER The ID of the private VLAN on which you want the
virtual server placed
--wait INTEGER Wait until VS is finished provisioning for up to
X seconds before returning
-h, --help Show this message and exit.
See 'slcli vs create-options' for valid options
$slcli vs创建--help
用法:slcli vs创建[选项]
订购/创建虚拟服务器。
选项:
-H、 --FQDN的主机名文本主机部分[必需]
-D、 --FQDN的域文本域部分[必需]
-c、 --cpu内核的cpu整数[必需]
-m、 --内存整数内存(以兆字节为单位)[必需]
-d、 --数据中心文本数据中心短名称[必需]
-o、 --操作系统文本操作系统安装代码。提示:您可以指定
_最近的
--图像文本图像ID。有关参考信息,请参阅:“slcli图像列表”
--计费[每小时|每月]计费费率[默认值:每小时]
--专用/--公共创建专用虚拟服务器(专用节点)
--san使用san存储而不是本地磁盘。
--测试不实际创建虚拟服务器
--导出路径将选项导出到模板文件
-i、 --要下载的安装后文本安装后脚本
-k、 --要添加到根用户的密钥文本SSH密钥(多个)
(允许发生)
--磁盘文本磁盘大小(允许多次出现)
--private强制VS只能访问private
网络
--与文本类似,使用现有VS中的配置
-n、 --网络文本网络端口速度(Mbps)
-g、 --要添加到实例的标记文本标记(多次出现
允许的)
-t、 --模板路径默认为命令行的模板文件
选择权
-u、 --用户数据文本用户定义的元数据字符串
-F、 --用户文件路径从文件中读取用户数据
--vlan public INTEGER您要在其上执行操作的公共vlan的ID
虚拟服务器已放置
--vlan private INTEGER您要在其上执行操作的专用vlan的ID
虚拟服务器已放置
--等待整数等待,直到VS完成配置,最多
返回前X秒
-h、 --帮助显示此消息并退出。
有关有效选项,请参阅“slcli vs创建选项”
运行以下命令:
slcli vs create --help
您将看到,要在专用网络中创建VSI,只需添加--private
参数。还列出了如何在特定VLAN中创建VSI:
$ slcli vs create --help
Usage: slcli vs create [OPTIONS]
Order/create virtual servers.
Options:
-H, --hostname TEXT Host portion of the FQDN [required]
-D, --domain TEXT Domain portion of the FQDN [required]
-c, --cpu INTEGER Number of CPU cores [required]
-m, --memory INTEGER Memory in mebibytes [required]
-d, --datacenter TEXT Datacenter shortname [required]
-o, --os TEXT OS install code. Tip: you can specify
<OS>_LATEST
--image TEXT Image ID. See: 'slcli image list' for reference
--billing [hourly|monthly] Billing rate [default: hourly]
--dedicated / --public Create a dedicated Virtual Server (Private Node)
--san Use SAN storage instead of local disk.
--test Do not actually create the virtual server
--export PATH Exports options to a template file
-i, --postinstall TEXT Post-install script to download
-k, --key TEXT SSH keys to add to the root user (multiple
occurrence permitted)
--disk TEXT Disk sizes (multiple occurrence permitted)
--private Forces the VS to only have access the private
network
--like TEXT Use the configuration from an existing VS
-n, --network TEXT Network port speed in Mbps
-g, --tag TEXT Tags to add to the instance (multiple occurrence
permitted)
-t, --template PATH A template file that defaults the command-line
options
-u, --userdata TEXT User defined metadata string
-F, --userfile PATH Read userdata from file
--vlan-public INTEGER The ID of the public VLAN on which you want the
virtual server placed
--vlan-private INTEGER The ID of the private VLAN on which you want the
virtual server placed
--wait INTEGER Wait until VS is finished provisioning for up to
X seconds before returning
-h, --help Show this message and exit.
See 'slcli vs create-options' for valid options
$slcli vs创建--help
用法:slcli vs创建[选项]
订购/创建虚拟服务器。
选项:
-H、 --FQDN的主机名文本主机部分[必需]
-D、 --FQDN的域文本域部分[必需]
-c、 --cpu内核的cpu整数[必需]
-m、 --内存整数内存(以兆字节为单位)[必需]
-d、 --数据中心文本数据中心短名称[必需]
-o、 --操作系统文本操作系统安装代码。提示:您可以指定
_最近的
--图像文本图像ID。有关参考信息,请参阅:“slcli图像列表”
--计费[每小时|每月]计费费率[默认值:每小时]
--专用/--公共创建专用虚拟服务器(专用节点)
--san使用san存储而不是本地磁盘。
--测试不实际创建虚拟服务器
--导出路径将选项导出到模板文件
-i、 --要下载的安装后文本安装后脚本
-k、 --要添加到根用户的密钥文本SSH密钥(多个)
(允许发生)
--磁盘文本磁盘大小(允许多次出现)
--private强制VS只能访问private
网络
--与文本类似,使用现有VS中的配置
-n、 --网络文本网络端口速度(Mbps)
-g、 --要添加到实例的标记文本标记(多次出现
允许的)
-t、 --模板路径默认为命令行的模板文件
选择权
-u、 --用户数据文本用户定义的元数据字符串
-F、 --用户文件路径读取用户数据