Reputation: 164
I'm looking to instance a private only virtual machine on SoftLayer using the SLCLI. So far this command creates an instance but critically it automatically assigns a Public Interface which I do not want and does not create the machine on the specific Private VLAN I want either:
# 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
Any ideas from the community on what to change the commands to to get the desired result? I'll keep hacking away in parallel ...
Thanks EJK
***************** UPDATE
So having tried some more I now have the correct structure for the command line:
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
But this errors with:
SoftLayerAPIError(SoftLayer_Exception_Public): Could not obtain network VLAN with id #1138.
Cheers EJK
**************** UPDATE
Definitely the right VLAN ... 1138
And 1138 is the only integer value I have to act as an ID ...
Thank EJK
*********** UPDATE
Nelson was right the VLAN ID is located in the URL so mine was
https://control.softlayer.com/network/vlans/1227409
this line now works and machines are creating on the right private VLAN .. BUT!!! They are coming with a public VLAN too even though I don't want that .. command so far that works
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
The major trouble with the assignment of a public for me is that all of the postinstall bootstrap with attaches to Chef etc. is now registering the FQDN of the public - yuck! Cheers EJK
************ UPDATE
All working now ... I missed out the "--private" option on the above SLCLI command ... Many thanks Nelson !!!
Upvotes: 0
Views: 1056
Reputation: 4396
run the command:
slcli vs create --help
you will see that to create a VSI in a private network you only need to add the --private
paramter. also it list how to create the VSI in a specific VLAN:
$ 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
Upvotes: 2