Robert Harker Technical Wiki
Thoughts and Ideas About Large Sites

[ Prev ] [ Index ] [ Next ]


mkvirtimg shell script

if [ -z $1 ]; then

echo $0 [vmname]
exit
fi

if [ -f /var/lib/libvirt/images/$1.img ]; then
ls -l /var/lib/libvirt/images/$1.img
echo -n "remove $1 instance? "
read x
if [ $x != "y" ]; then
echo aborting
exit
fi
else
echo -n "create $1 instance? "
read x
if [ $x != "y" ]; then
echo aborting
exit
fi
fi

mkdir -p /var/lib/libvirt/images
virt-install \
--connect qemu:///system \
-n $1 \
-r 512 \
--vcpus=2 \
--disk path=/var/lib/libvirt/images/$1.img,size=3 \
--vnc \
--pxe \
--noautoconsole \
--os-type linux \
--os-variant debiansqueeze \
--accelerate \
--network=bridge:br0 \
--hvm


Backlinks: index Start
Created with Zim desktop wiki