vCenter Server patch warning: "LVM Snapshot based auto-backup will not be taken during vcenter patching" and autogrow.sh partition resize failure.
search cancel

vCenter Server patch warning: "LVM Snapshot based auto-backup will not be taken during vcenter patching" and autogrow.sh partition resize failure.

book

Article ID: 370818

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article addresses an issue where orphaned LVM snapshots on the vCenter Server prevent standard maintenance tasks. This issue typically presents with one of the following two symptoms:

  • During a vCenter patching operation, the Pre-Update Check Results displays the following warning:
    Warning: LVM Snapshot based auto-backup of vCenter Server will not be taken during vCenter patching
    Resolution: Please ensure a valid LVM snapshot disk and altroot disk is present on the vCenter Server and LVM snapshot disk has sufficient space available on it to take the backup

  • When attempting to increase a partition size on vCenter Server, the autogrow.sh script fails to extend the logical volumes because they are locked by an active snapshot. The script returns output similar to the following:

    <Timestamp> Disk Util: INFO: LV Resizing /dev/vtsdblog_vg/vtsdblog
      Snapshot origin volumes can be resized only while inactive: try lvchange -an.
    <Timestamp> Disk Util: INFO: LV Resizing /dev/vtsdblog_vg/vtsdblog_vg_vtsdblog_snap
    fsck from util-linux 2.37.4
    /dev/mapper/vtsdblog_vg-vtsdblog_vg_vtsdblog_snap: clean, 15/565248 files, 65189/2246656 blocks
      Size of logical volume vtsdblog_vg/vtsdblog_vg_vtsdblog_snap unchanged from 8.57 GiB (1097 extents).
      Logical volume vtsdblog_vg/vtsdblog_vg_vtsdblog_snap successfully resized.
    resize2fs 1.46.5 (<Timestamp>)
    The filesystem is already 2246656 (4k) blocks long.  Nothing to do!


    <Timestamp> Disk Util: INFO: LV Resizing /dev/updatemgr_vg/updatemgr
      Snapshot origin volumes can be resized only while inactive: try lvchange -an.
    <Timestamp> Disk Util: INFO: LV Resizing /dev/updatemgr_vg/updatemgr_vg_updatemgr_snap
    fsck from util-linux 2.37.4
    /dev/mapper/updatemgr_vg-updatemgr_vg_updatemgr_snap: clean, 4704/1564672 files, 4480727/6248448 blocks
      Size of logical volume updatemgr_vg/updatemgr_vg_updatemgr_snap unchanged from <23.84 GiB (3051 extents).
      Logical volume updatemgr_vg/updatemgr_vg_updatemgr_snap successfully resized.
    resize2fs 1.46.5 (<Timestamp>)
    The filesystem is already 6248448 (4k) blocks long.  Nothing to do!

  • When run the command "lsblk -o NAME,HCTL,MOUNTPOINT,SIZE", following the instructions of KB Increasing the disk space for the vCenter Server Appliance in vSphere 6.5, 6.7, 7.0 and 8.0 it returns logical volumes snapshots for each volume.

    NAME                                                      HCTL       MOUNTPOINT             SIZE
    sda                                                       2:0:0:0                          48.6G
    |-sda1                                                                                        4M
    |-sda2                                                               /boot/efi               10M
    |-sda3                                                               /boot                  512M
    |-sda4                                                                                       48G
      |-vg_root_0-lv_root_0-real                                                                 48G
        |-vg_root_0-lv_root_0                                            /                       48G
        |-vg_root_0-vg_root_0_lv_root_0_snap                                                     48G
    sdb                                                       2:0:1:0                           6.8G
    sdc                                                       2:0:2:0                            25G
    |-swap_vg-swap1                                                      [SWAP]                  25G
    sdd                                                       2:0:3:0                            50G
    |-core_vg-core-real                                                                          50G
      |-core_vg-core                                                     /storage/core           50G
      |-core_vg-core_vg_core_snap                                                                50G
    sde                                                       2:0:4:0                            10G
    |-log_vg-log                                                         /storage/log            10G
    sdf                                                       2:0:5:0                            10G
    |-db_vg-db-real                                                                              10G
      |-db_vg-db                                                         /storage/db             10G
      |-db_vg-db_vg_db_snap                                                                      10G
    sdg                                                       2:0:6:0                            50G
    |-dblog_vg-dblog-real                                                                        15G
      |-dblog_vg-dblog                                                   /storage/dblog          15G
      |-dblog_vg-dblog_vg_dblog_snap                                                             15G
    sdh                                                       2:0:8:0                            25G
    |-seat_vg-seat-real                                                                          25G
      |-seat_vg-seat                                                     /storage/seat           25G
      |-seat_vg-seat_vg_seat_snap                                                                25G

     

Environment

VMware vCenter Server

Cause

  • This issue occurs when the automated LVM snapshot clean-up workflow fails to execute successfully after a vCenter Server upgrade (this is most commonly observed when upgrading from vCenter 7.0 U3 to 8.0 U1b).
  • Under normal circumstances, the post-upgrade workflow clears all temporary snapshot volumes and recreates the lvm_snapshot logical volume. When this process fails, the orphaned snapshots remain locked on the disks. Consequently, subsequent patching attempts (e.g., updating to 8.0 U2a) or disk expansion scripts will fail because they cannot manipulate the locked volumes.

Resolution

To resolve this issue, clear the orphaned logical volume snapshots manually using the Python script 'performVMCleanup.py' provided in this article.

Note: Take a Snapshot of the vCenter Server appliance before following the workaround. 

  1. Download the performLVMCleanup.py script attached to this KB article.
  2. Using an SCP client (such as WinSCP) or the scp command line tool, upload the performLVMCleanup.py file to the /tmp directory on the vCenter Server Appliance.
  3. Connect to the vCenter Server Appliance via SSH and log in as root.
  4. Navigate to the /tmp directory where the script is uploaded. 
  5. Execute the script: 
    python performLVMCleanup.py

Attachments

performLVMCleanup.py get_app