File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,25 @@ for (( i = 1 ; i <= $NB_INST ; i++ )); do
5656 kub_path=" $POOL_PATH /kubernetes"
5757 machines=" $( echo -n ' 192.168.10.1' ; for (( i = 2 ; i <= $NB_INST ; i++ )) ; do echo -n " ,192.168.10.$i " ; done)"
5858
59- virsh vol-clone coreos_production_qemu_image.img $name .img --pool $POOL
60- sed -e " s| %N%| $i | ; s| %NAME%| $name | ; s| %IMAGE%| $image | ; s| %CONFIG%| $config | ; s| %KUB_PATH%| $kub_path | " < coreos.xml > .run/$name .xml
59+ if [ -w " $POOL_PATH " ]; then
60+ pushd " $POOL_PATH "
61+ qemu-img create -f qcow2 -b coreos_production_qemu_image.img $name .img
62+ popd
63+ else
64+ echo " You miss write access to $POOL_PATH to benefit from COW"
65+ virsh vol-clone coreos_production_qemu_image.img $name .img --pool $POOL
66+ fi
67+ sed -e " s| %N%| $i | ; \
68+ s| %NAME%| $name | ; \
69+ s| %IMAGE%| $image | ; \
70+ s| %CONFIG%| $config | ; \
71+ s| %KUB_PATH%| $kub_path | " < coreos.xml > .run/$name .xml
6172 mkdir -p " $config /openstack/latest"
62- sed -e " s| %N%| $i | ; s| %NAME%| $name | ; s| %SSH_KEYS%| $( cat ~ /.ssh/id_* .pub | sed ' s/^/ - /' ) | ; s| %DISCOVERY%| $discovery | ; s| %MACHINES%| $machines | " < user_data.yml | \
73+ sed -e " s| %N%| $i | ; \
74+ s| %NAME%| $name | ; \
75+ s| %SSH_KEYS%| $( cat ~ /.ssh/id_* .pub | sed ' s/^/ - /' ) | ; \
76+ s| %DISCOVERY%| $discovery | ; \
77+ s| %MACHINES%| $machines | " < user_data.yml | \
6378 ( if [ $i -eq 1 ]; then
6479 egrep -v " ^%(END)? IF MASTER%$" ;
6580 else
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ while virsh destroy coreos$(printf "%02d" $i) 2> /dev/null; do
1010 (( i++ ))
1111done
1212
13+ virsh pool-refresh $POOL > /dev/null
1314i=1
1415while virsh vol-delete coreos$( printf " %02d" $i ) .img --pool $POOL 2> /dev/null; do
1516 (( i++ ))
You can’t perform that action at this time.
0 commit comments