Created
April 22, 2013 03:51
-
-
Save coldfire-x/5432339 to your computer and use it in GitHub Desktop.
script for creating kvm virtual machine from a raw partition which has DDed the vm image.
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/sh | |
USAGE='Usage: ./create_kvm.sh kvm_name lvm hd1' | |
# kvm_name is the virtual machine's name | |
# lvm is the virtual machine's image disk path | |
# hd1 is the addtional disk we want to attach to this kvm | |
if [ "$1" = "help" ] | |
then | |
echo $USAGE | |
elif [ "$1" = "--help" ] | |
then | |
echo $USAGE | |
elif [ "$1" = "" ] | |
then | |
echo $USAGE | |
else | |
virt-install --connect qemu:///system -n $1 -r 2048 --vcpus=2 --cpuset=18,19 \ | |
--disk path=$2 --import $2 --disk path=$3 --vnc --noautoconsole --os-type linux \ | |
--os-variant rhel5.4 --accelerate \ | |
--network=bridge:br0 --network=bridge:br1 --hvm --autostart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment