File tree 2 files changed +19
-3
lines changed
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
56
56
kub_path=" $POOL_PATH /kubernetes"
57
57
machines=" $( echo -n ' 192.168.10.1' ; for (( i = 2 ; i <= $NB_INST ; i++ )) ; do echo -n " ,192.168.10.$i " ; done)"
58
58
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
61
72
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 | \
63
78
( if [ $i -eq 1 ]; then
64
79
egrep -v " ^%(END)? IF MASTER%$" ;
65
80
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
10
10
(( i++ ))
11
11
done
12
12
13
+ virsh pool-refresh $POOL > /dev/null
13
14
i=1
14
15
while virsh vol-delete coreos$( printf " %02d" $i ) .img --pool $POOL 2> /dev/null; do
15
16
(( i++ ))
You can’t perform that action at this time.
0 commit comments