openstack-cluster-installer-start 1.1 KB
Newer Older
Thomas Goirand's avatar
Thomas Goirand committed
1 2 3
#!/bin/sh

set -e
4
set -x
Thomas Goirand's avatar
Thomas Goirand committed
5 6 7 8 9 10

if ! [ -r /etc/openstack-cluster-installer/openstack-cluster-installer.conf ] ; then
	echo "Could not load /etc/openstack-cluster-installer/openstack-cluster-installer.conf"
	exit 1
fi

11 12 13 14
TMPFILE=$(mktemp -t openstack-cluster-installer.XXXXXX)
cat /etc/openstack-cluster-installer/openstack-cluster-installer.conf | grep -v '^\[' >${TMPFILE}
. ${TMPFILE}
rm ${TMPFILE}
15

16
qemu-img create /var/lib/openstack-cluster-installer/openstack-cluster-installer-scratch-disk.dat 10G
Thomas Goirand's avatar
Thomas Goirand committed
17 18 19 20 21

/usr/bin/kvm \
	-m size=6G \
	-smp cpus=8 \
	-cpu host \
22
	-display sdl \
Thomas Goirand's avatar
Thomas Goirand committed
23 24 25 26 27 28 29 30 31 32
	-pidfile /var/lib/openstack-cluster-installer/vm.pid \
	-daemonize \
	-name openstack-install-vm \
	-drive if=virtio,file=/var/lib/openstack-cluster-installer/openstack-cluster-installer-scratch-disk.dat,index=0,media=disk,format=raw \
	-boot n \
	-option-rom /usr/lib/ipxe/qemu/pxe-e1000.rom \
        -device e1000,netdev=net0,mac=${QEMU_VM_MAC} \
        -netdev tap,id=net0,ifname=${PXE_VM_VIRTAP_NAME},script=no,downscript=no \
        -device e1000,netdev=net1,mac=08:00:27:06:CC:DE \
        -netdev user,id=net1,net=172.17.1.0/24,dhcpstart=172.17.1.1