Last active
August 29, 2015 14:23
-
-
Save Sekhmet/3e762bf6927147bf984a to your computer and use it in GitHub Desktop.
Deploy many VZ containers from backup.
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 | |
for i in {1..126} | |
do | |
if [ $(($i%2)) -eq 0 ]; | |
then | |
vzrestore /var/backup/dump/vzdump-openvz-100-2015_06_26-12_29_41.tar.lzo $(($i + 100)) -storage second | |
else | |
vzrestore /var/backup/dump/vzdump-openvz-100-2015_06_26-12_29_41.tar.lzo $(($i + 100)) | |
fi | |
vzctl set $(($i + 100)) --hostname node$i.muzari.com | |
vzctl set $(($i + 100)) --ipdel 104.161.36.3 --save | |
vzctl set $(($i + 100)) --ipadd 104.161.36.$i | |
#vzctl start $(($i + 100)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment