Backtrack:  
 
edited by lunarg on August 18th 2021, at 13:53

Occassionally, the vCenter may run out of disk space on a specific disk, in which case it may become necessary to resize it. While there are many articles written about resizing a disk (like this), VMware also provides a very useful auto-resize script which automatically does the work for you, significantly improving the user experience even to those who are not familiar with resizing partitions and/or LVM in Linux. The best part is that it can be done online, so no need to stop services.

  1. Log on to the vCenter console through SSH or through VMRC using the root account. If you wish to use SSH, you may need to enable it first through VAM.
  2. Determine which virtual disk needs resizing. VCSA uses LVM on most disks, so you'll need to figure out which virtual disk to resize in ESX/Vcenter itself.
    By querying LVM, you can figure out on which "physical" disk the volume group seat_vg is located:
    pvdisplay
    In the output, look for VG Name = seat_vg. The device node mentioned at PV Name will tell you the disk. The last letter of the name of the device node will tell you which disk it is: /dev/sda for the first disk, /dev/sdb for the second and so on. While this would not always correspond with the disk number in VMWare itself, in this case, it will be. In our case, the device node was /dev/sdh which is Disk 8 in the list of disks in the properties of the VM. Once we've established the correct disk, we can continue with our resize process.
  3. In VCenter/ESXi, resize the disk by editing the VCSA VM and increase the size of the correct disk (see the previous bullet). This resizes the disk but not the partition or LVM volume.
  4. Back in the console, run the following script which will automatically determine which disks have been resized and auto-grow the partition, LVM volume and filesystem:
    /usr/lib/applmgmt/support/scripts/autogrow.sh
  5. After the run, you can check the disk space with df -h. The disk you resized should now show be larger and with more free space. If you don't see the correct disk resized, you may have chosen the wrong disk.