compass-core/misc/ci/pxe-prepare.sh
zhaoxinyu 885609ef39 Add tempest run scripts and prepare scripts
Also change some hardcoded network config to dynamic
Change-Id: I5dc1df89b32436a41cf7d7c46e30be879207b224
2014-04-03 23:59:01 +00:00

30 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -x
if [[ ! -e /tmp/pxe01.raw ]]; then
qemu-img create -f raw /tmp/pxe01.raw 20G
else
rm -rf /tmp/pxe01.raw
qemu-img create -f raw /tmp/pxe01.raw 20G
fi
virsh list |grep pxe01
vmrc=$?
if [[ $vmrc -eq 0 ]] ; then
virsh destroy pxe01
virsh undefine pxe01
else
echo "no legacy pxe vm found"
fi
virt-install --accelerate --hvm --connect qemu:///system \
--network=bridge:installation,mac=00:11:20:30:40:01 --pxe \
--network=network:default \
--name pxe01 --ram=8192 \
--disk /tmp/pxe01.raw,format=raw \
--vcpus=10 \
--graphics vnc,listen=0.0.0.0 --noautoconsole \
--os-type=linux --os-variant=rhel6
rm -rf switch-file
echo "machine,10.145.81.220,5,1,00:11:20:30:40:01" > switch-file
echo "switch,10.145.81.220,huawei,v2c,public,under_monitoring" >> switch-file
/usr/bin/python /opt/compass/bin/manage_db.py set_switch_machines --switch_machines_file switch-file
/usr/bin/python /opt/compass/bin/manage_db.py clean_clusters
/usr/bin/python /opt/compass/bin/manage_db.py clean_installation_progress