summaryrefslogtreecommitdiffstats
path: root/compass-deck/misc/ci/pxe-prepare.sh
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-11-01 11:56:50 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-11-03 11:48:46 +0800
commit905b0231e93ce2409a45dd6c4f5f983689fdb790 (patch)
tree8b3c8c78773194e048072368fe793135a05e44f1 /compass-deck/misc/ci/pxe-prepare.sh
parent3656ab7b5e3f2f26f7c98f9dcc97b3c461fa2a76 (diff)
Add compass-deck
RESTful API and DB Handlers for Compass Change-Id: I1ce411f279943764c286ea48dca9185d453cf254 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'compass-deck/misc/ci/pxe-prepare.sh')
-rwxr-xr-xcompass-deck/misc/ci/pxe-prepare.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/compass-deck/misc/ci/pxe-prepare.sh b/compass-deck/misc/ci/pxe-prepare.sh
new file mode 100755
index 0000000..08f5eb3
--- /dev/null
+++ b/compass-deck/misc/ci/pxe-prepare.sh
@@ -0,0 +1,29 @@
+#!/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