diff --git a/deploy_vm.sh b/deploy_vm.sh index 61dde7b..ccdb8fe 100755 --- a/deploy_vm.sh +++ b/deploy_vm.sh @@ -445,16 +445,9 @@ if [ "${VM_DISK_EXTEND}" -ne 0 ]; then exit 1 fi - DEFAULT_VG=$(vgs | awk '/vg/ {print $1}') - - if [ $? -ne 0 ]; then - echo 'ERROR : problem during get the name of the default VG' - exit 1 - fi - echo "INFO : Add new PV to VG ${DEFAULT_VG}... (vgextend ${DEFAULT_VG} /dev/vda4)" - ssh ${SSH_OPT} ${SSH_HOST} "vgextend ${DEFAULT_VG} /dev/vda4" &> /dev/null + ssh ${SSH_OPT} ${SSH_HOST} "vgextend $(vgs | awk '/vg/ {print $1}') /dev/vda4" &> /dev/null if [ $? -ne 0 ]; then echo 'ERROR : problem during add new PV in VG, please finish manually the deploy OR delete VM and IPAM information' @@ -462,15 +455,8 @@ if [ "${VM_DISK_EXTEND}" -ne 0 ]; then fi echo "INFO : Resize LV on disk... (RESIZE VM LV)" - - DEFAULT_LV_ROOT=$(find /dev/mapper -name '*root*') - if [ $? -ne 0 ]; then - echo 'ERROR : problem during get the name of the default root LV' - exit 1 - fi - - ssh ${SSH_OPT} ${SSH_HOST} "lvextend -l +100%FREE ${DEFAULT_LV_ROOT}" &> /dev/null + ssh ${SSH_OPT} ${SSH_HOST} "lvextend -l +100%FREE $(find /dev/mapper -name '*root*')" &> /dev/null if [ $? -ne 0 ]; then echo 'ERROR : problem during resizing LV, please finish manually the deploy OR delete VM and IPAM information'