Created
February 1, 2013 17:22
-
-
Save whytheplatypus/4692705 to your computer and use it in GitHub Desktop.
Create a new vm in smartos (I have the brand coded to joyent so it's really only for smartos builds I guess) first argument should be the UUID of the image second is the desired hostname for the new vm and the third is an alias for it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export GATEWAY=$(netstat -r | grep default | awk '{ print $2 }') | |
echo "{ | |
\"brand\": \"joyent\", | |
\"dataset_uuid\": \"$1\", | |
\"hostname\": \"$2\", | |
\"alias\": \"$3\", | |
\"nics\": [ | |
{ | |
\"nic_tag\": \"admin\", | |
\"ip\": \"dhcp\", | |
\"netmask\": \"255.255.255.0\", | |
\"gateway\":\"${GATEWAY}\" | |
} | |
] | |
}" | vmadm create |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment