Last active
October 30, 2017 14:26
-
-
Save yantze/92270e1908d6cb54a783aacaa34130bf to your computer and use it in GitHub Desktop.
Create vultr server from snapshot by script
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
#!/usr/bin/env bash | |
# author: yantze | |
# date: 2017-10-30 | |
VULTR_API_KEY=KEYKEYKEYKEYKEYKEYKEYKEYKEY | |
snapshot_id="get snapshot_id from end" | |
subid=$(vultr server create -n "vultr-cli" -r 7 -p 201 --snapshot=$snapshot_id | tail -n 1 | awk '{print $1}') | |
sleep 30 | |
server_ip=$(vultr server list-ipv4 $subid | tail -n 1 | awk '{print $1}') | |
echo "server ip:" $server_ip | |
# command repo: https://github.com/JamesClonk/vultr | |
# snapshot id | |
# vultr snapshot list | |
# pay info: | |
# vultr info | |
# server list | |
# vultr server list | |
# vultr server show 11264771 | awk '/Pending/ {print $NF}' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment