change pxe image location from /tmp to /home

/tmp can be filled up by those image files, move those to a location
with large space.

Change-Id: I4d57136b3b38dec5cc5cab0807549d57ee6410f6
This commit is contained in:
Jerry Zhao 2014-12-27 09:48:08 -08:00
parent d1ee9e7e36
commit f5944302fd

View File

@ -43,20 +43,21 @@ machines=''
tear_down_machines
echo "setup $VIRT_NUM virt machines"
rm -rf /tmp/pxe*.raw
for i in `seq $VIRT_NUM`; do
if [[ ! -e /tmp/pxe${i}.raw ]]; then
if [[ ! -e /home/pxe${i}.raw ]]; then
echo "create image for instance pxe$i"
qemu-img create -f raw /tmp/pxe${i}.raw ${VIRT_DISK}
qemu-img create -f raw /home/pxe${i}.raw ${VIRT_DISK}
if [[ "$?" != "0" ]]; then
echo "create image /tmp/pxe${i}.raw failed"
echo "create image /home/pxe${i}.raw failed"
exit 1
fi
else
echo "recreate image for instance pxe$i"
rm -rf /tmp/pxe${i}.raw
qemu-img create -f raw /tmp/pxe${i}.raw ${VIRT_DISK}
rm -rf /home/pxe${i}.raw
qemu-img create -f raw /home/pxe${i}.raw ${VIRT_DISK}
if [[ "$?" != "0" ]]; then
echo "create image /tmp/pxe${i}.raw failed"
echo "create image /home/pxe${i}.raw failed"
exit 1
fi
fi
@ -68,7 +69,7 @@ for i in `seq $VIRT_NUM`; do
--network=bridge:installation \
--network=bridge:installation \
--name pxe${i} --ram=${VIRT_MEM} \
--disk /tmp/pxe${i}.raw,format=raw \
--disk /home/pxe${i}.raw,format=raw \
--vcpus=${VIRT_CPUS} \
--graphics vnc,listen=0.0.0.0 \
--noautoconsole \
@ -185,6 +186,7 @@ if [[ $rc != 0 ]]; then
echo "deployment failed"
exit 1
fi
tear_down_machines
#if [[ $tempest == true ]]; then
# ./tempest_run.sh
# if [[ $? != 0 ]]; then