Prepare cloudinit to growroot VCP with LVM
This patch adds cloudinit data that will grow LVM
based VCP image.
New soft param is introduced:
* salt_control_cluster_vcp_lvm_device
it defines name of partition drive that is included to
PVS by default ('/dev/vda3'). Is dependent on disk model
that is used by VCP.
Change-Id: I070280f830c76b42a9a2c4522f0adb0648d33757
Related-Prod: PROD-24537
diff --git a/salt/control/cluster/init.yml b/salt/control/cluster/init.yml
index 20ae7fa..580784d 100644
--- a/salt/control/cluster/init.yml
+++ b/salt/control/cluster/init.yml
@@ -1,6 +1,7 @@
parameters:
_param:
salt_control_cluster_rng_backend: "/dev/random"
+ salt_control_cluster_vcp_lvm_device: '/dev/vda3'
salt:
control:
cluster:
@@ -13,3 +14,15 @@
salt_minion:
conf:
master: ${_param:infra_config_deploy_address}
+ # This part is needed to grow disk for LVM based VCP
+ # NOTE: device name here is dependent on Disk model we connecting
+ # to particular VCP. By default it is virtio.
+ growpart:
+ mode: auto
+ devices:
+ - '/'
+ - ${_param:salt_control_cluster_vcp_lvm_device}
+ ignore_growroot_disabled: false
+ runcmd:
+ - 'if lvs vg0; then pvresize ${_param:salt_control_cluster_vcp_lvm_device}; fi'
+ - 'if lvs vg0; then /usr/bin/growlvm.py --image-layout-file /usr/share/growlvm/image-layout.yml; fi'