Created
May 29, 2013 18:06
-
-
Save d6e/5672375 to your computer and use it in GitHub Desktop.
Creates a new vm on kvm/qemu
This file contains hidden or 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 | |
host="[email protected]" | |
if [ ! -f vm-namelist.txt ]; | |
then | |
echo "vm-namelist.txt does not exist. You should create a it. (Make a list of names for the VMs)" | |
fi | |
for vmname in $(cat vm-namelist.txt); do | |
( | |
virt-install \ | |
--connect=qemu+ssh://$host/system \ | |
--name=$vmname \ | |
--pxe --ram=2048 \ | |
--noautoconsole \ | |
--os-type=linux --os-variant=ubuntuquantal \ | |
--network bridge=br3 --network bridge=br5 \ | |
--disk path=/var/lib/libvirt/images/$vmname.img,size=10,sparse=true | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment