SoftLayer命令行界面 - SLCLI - 仅限实例的私有节点

时间:2016-05-12 19:18:34

标签: 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/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

enter image description here

1138是我必须作为ID的唯一整数值​​...

感谢 EJK

***********更新

Nelson是对的,VLAN ID位于URL中,因此我的

https://control.softlayer.com/network/vlans/1227409

这条线现在正常工作,机器正在私有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

为我分配公众的主要问题是所有附加到Chef等的postinstall引导程序现在正在注册公众的FQDN - 哎呀! 干杯 EJK

************更新

现在全部工作......我错过了上述SLCLI命令中的“--private”选项...非常感谢Nelson !!!

1 个答案:

答案 0 :(得分:2)

运行命令:

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