Change partionning (because there is an extended default part with Debian)

This commit is contained in:
nemo 2019-09-09 16:29:34 +02:00
parent a48137052c
commit 2b386333dd
1 changed files with 2 additions and 16 deletions

View File

@ -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'