Change number of loop device for nova cinder volume groups
By default ubuntu 20.04 uses snap package. It takes loop devices 0...4
for snapd, lxd and core20.
Changed сheck for the initialized of volume group
Related-Prod: PRODX-23899
Change-Id: I4bd3306cc43666170c05a643fbdfe459b372dfa0
diff --git a/de/heat-templates/scripts/instance_boot.sh b/de/heat-templates/scripts/instance_boot.sh
index c6e5006..180659d 100644
--- a/de/heat-templates/scripts/instance_boot.sh
+++ b/de/heat-templates/scripts/instance_boot.sh
@@ -234,8 +234,8 @@
local device_num=$1
local device_size=$2
local vg_name=$3
- if losetup -l | grep /dev/loop${device_num}; then
- echo "Volume /dev/loop${device_num} is already initialize"
+ if vgdisplay | grep ${vg_name}; then
+ echo "Volume group ${vg_name} is already initialize"
else
#configure lvm only on compute nodes
if [[ ${NODE_METADATA} == *"openstack-compute-node"* ]]; then
@@ -267,10 +267,10 @@
}
if [[ "${LVM_LOOP_DEVICE_SIZE}" -gt 0 ]]; then
- _setup_lvm 0 ${LVM_LOOP_DEVICE_SIZE} nova-vol
+ _setup_lvm 10 ${LVM_LOOP_DEVICE_SIZE} nova-vol
fi
if [[ "${CINDER_LVM_LOOP_DEVICE_SIZE}" -gt 0 ]]; then
- _setup_lvm 1 ${CINDER_LVM_LOOP_DEVICE_SIZE} cinder-vol
+ _setup_lvm 11 ${CINDER_LVM_LOOP_DEVICE_SIZE} cinder-vol
fi
}