summaryrefslogtreecommitdiffstats
path: root/create-new-vm.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-03-12 15:09:01 +0100
committerFlorian Pritz <bluewind@xinu.at>2014-03-12 15:09:01 +0100
commitfd48e4001be8f0094abeda644dad900fd93127fc (patch)
tree9ea8764eda8a41876f6194bcc1084b27701cee65 /create-new-vm.sh
parenta224a91ca291db138d6a656306221539c990df7f (diff)
downloadbin-fd48e4001be8f0094abeda644dad900fd93127fc.tar.gz
bin-fd48e4001be8f0094abeda644dad900fd93127fc.tar.xz
vm setup: misc changes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'create-new-vm.sh')
-rwxr-xr-xcreate-new-vm.sh14
1 files changed, 5 insertions, 9 deletions
diff --git a/create-new-vm.sh b/create-new-vm.sh
index dd4a4ed..8e51a15 100755
--- a/create-new-vm.sh
+++ b/create-new-vm.sh
@@ -9,6 +9,11 @@ TMPDIR="`mktemp -d "/tmp/fb-client-up.XXXXXX"`"
trap "rm -rf '${TMPDIR}'" EXIT TERM
cd "$TMPDIR"
+if [[ ! -f /srv/http/vms/network/$name ]]; then
+ echo "Missing vm network definition /srv/http/vms/network/$name" >&2
+ exit 1
+fi
+
cat <<EOF >vm.xml
<domain type='kvm'>
<name>$name</name>
@@ -36,25 +41,19 @@ cat <<EOF >vm.xml
<driver name='qemu' type='qcow2'/>
<source file='/mnt/data/libvirt/storage/${name}.img'/>
<target dev='vda' bus='virtio'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
<controller type='usb' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='scsi' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<controller type='scsi' index='1' model='virtio-scsi'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</controller>
<interface type='network'>
<source network='mynet'/>
<model type='virtio'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
@@ -65,14 +64,11 @@ cat <<EOF >vm.xml
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ich6'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>