Symptoms:
Root is not LVM enabled or snapshot volume is not present.
VMware vCenter Server 8.x
VMware vCenter Server 7.x
VMware vCenter Server 6.x
If the VCSA appliance VM is self managed (must exist within the inventory of itself), then run the script: prepare_vc_for_lvm_snapshot.sh
SSH to vCenter appliance using root user.
Copy the prepare_vc_for_lvm_snapshot.sh script attached to this article to any directory except /tmp.
Make the script executable by running:
chmod +x prepare_vc_for_lvm_snapshot.sh
Execute the script with option --precheck to know if LVM is enabled on root and snapshot disk is configured:
If LVM is not enabled on root:
Precheck
root@vcsa_name [ ~ ]# ./prepare_vc_for_lvm_snapshot.sh --precheck
INFO Check if LVM is enabled on root and snapshot disk is configured.
INFO Root is not on LVM
Run /prepare_vc_for_lvm_snapshot.sh to prepare VC for LVM snapshot.
If LVM is enabled on root and snapshot disk is not configured:
Precheck
root@vcsa_name [ ~ ]# ./prepare_vc_for_lvm_snapshot.sh --precheck
INFO Check if LVM is enabled on root and snapshot disk is configured.
INFO Root is on LVM
INFO Snapshot volume is not configured
Run /root/prepare_vc_for_lvm_snapshot.sh to prepare VC for LVM snapshot.
If LVM is not enabled on root or snapshot disk is not configured, take Virtual Machine level snapshot and execute the script. Provide SSO user name and password when prompted by script.
If LVM is not enabled on root:
root@vcsa_name [ ~ ]# ./prepare_vc_for_lvm_snapshot.sh
Enter SSO user name : sso_user_name
Enter SSO password :
Enter SDK port ( default : 443 ) :
INFO Root is not on LVM
Configuring VC takes more than 10 minutes.
Please follow this document: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/6-7/vsphere-virtual-machine-administration-guide-6-7/managing-virtual-machines/using-snapshots-to-manage-virtual-machines/managing-existing-snapshots/take-snapshots-of-a-virtual-machine.html
to take a VM level snapshot, to revert the appliance in case of any issues.
Do you want to proceed? (y/n) Y
********************* Enabling LVM ***********************
If LVM is enabled on root and snapshot disk is not configured:
root@vcsa_name [ ~ ]# ./prepare_vc_for_lvm_snapshot.sh
Enter SSO user name : sso_user_name
Enter SSO password :
Enter SDK port ( default : 443 ) :
INFO Root is on LVM
INFO Snapshot volume is not configured
.
.
.
Successfully configured snapshot volume.
root@vcsa_name [ ~ ]# ./prepare_vc_for_lvm_snapshot.sh --precheck
INFO Check if LVM is enabled on root and snapshot disk is configured.
INFO Root is on LVM
INFO Snapshot volume is already configured
VC is prepared for LVM snapshot.
If the vCenter is not self managed, then use the script: non_self_managed_vc_LVM_cleanup.py.
The script performs a LVM snapshot clean-up workflow (clears all the created snapshot volumes and re-creates the lvm_snapshot logical volume)
Execute the scipt using:
python non_self_managed_vc_LVM_cleanup.py