VMware Cloud Community
marnow
Enthusiast
Enthusiast

vCenter 6.7 - How to decrease VMDK size?

Hello folks,

How to safely shrink one of the vCenter disks? I know how to increase the space, well described process, but there is nothing about reducing the drive size.

/dev/mapper/seat_vg-seat                  1.4T  2.2G  1.4T   1% /storage/seat

We've upgraded to 6.7 from 6.5, we had only one options to choose xLarge storage options....the results is above, we ended up with 1.4TB disk for the SEAT.

There is a bug and vCenter support confirmed that PR has been filled with engineering, but they are helpless how to fix this, they recommended to install a new v Center and migrate everything....

I don't want to do that....now, my case has been moved to operation and they gave me a generic procedure how to decrease vmdk size, but no specifics regarding vCenter, I don't want to break anything!

Thanks!

Mario

8 Replies
rajen450m
Hot Shot
Hot Shot

Hi,

What is the generic procedure the Ops Team referred you?

Did you inform them its vCenter Disks you are trying to decrease.

I usually do shrinking of VMs using VMware converter, even though shrinking takes time because of file level copying with converter, i prefer this way.

Try to shrink using vmware converter

Regards,

Raj M Please mark helpful or correct if my answer resolved your issue. Visit www.hypervmwarecloud.com for my blog posts, step-by-step procedures etc.,
0 Kudos
marnow
Enthusiast
Enthusiast

The Ops team said:

**********************************

Shrinking

  • Virtual disk shrinking is supported when using VMware Converter converting source virtual machine as a machine source (not as virtual to virtual).
    Note: You cannot shrink virtual disks using vmkfstools in ESXi as the hypervisor is not aware of the file system layout and cannot ensure a safe shrink operation.

Before shrinking

  • Migrate the data away from the end of the disk consume to ensure the data is not lost (because the disk area is effectively removed). For example, in Windows GuestOS use Disk Management tool.
  • Shrink the partition residing within a disk before reducing the size of a virtual disk.
  • Non operating system disks users can also add a new smaller VMDK to the virtual machine and copy the data between the larger and new smaller disk using tools within the guest such as Robocopy.

Growing, thinning, and shrinking virtual disks for VMware ESX and ESXi (https://kb.vmware.com/kb/1002019)

**************************

I've seen some other thread somewhere that someone tried the VMware Converter but did not work anyway....

How about creating a new drive, mount it to the file system and copy the content and simply replace it? I know that would be a process that needs to be stopped to accomplish it. It is a just one single drive.

0 Kudos
Vijay2027
Expert
Expert

I helped one of my customer to sort this issue:

Action Plan:

  • Copy the existing data from /storage/seat to /storage/core (or any volume) where we have 50 GB free space.
  • Deploy a new vCSA of the same build and expand /storage/seat to 100 GB.
  • Unmount /storage/seat from existing vCSA and mount /storage/seat from new vCSA to the existing one.
  • Post this you will have to copy the data from /storage/core to /storage/seat.



Pre-requisite:

  • Deploy a new vCSA with the same build.
  • Stop vpxd service

Vijay2027
Expert
Expert

How about creating a new drive, mount it to the file system and copy the content and simply replace it? I know that would be a process that needs to be stopped to accomplish it. It is a just one single drive.

--> If you go through this route you might encounter issues during next major upgrade as there will be change in device name of /storage/seat (/dev/sdh).

0 Kudos
rbeam
Contributor
Contributor

there will be change in device name of /storage/seat (/dev/sdh)

Actually, that won't make any difference. They use LVM, so the actual device holding the volume is irrelevant. (only sda matters as that's the boot/root volume) But it's easy enough to put the new disk back at the same place.

I would say, just mark it "thin" and vmotion it. It won't actually use 1.4T.

0 Kudos
marnow
Enthusiast
Enthusiast

I will agree with you rbeam​. The drive is a "thin" already, so this is the size number that bothers me. The Ops team back to me and they want to schedule an appointment and check this again.

0 Kudos
bhards4
Hot Shot
Hot Shot

Hi Mario,

Seat_vg-seat  or /storage/seat is the one of the database partition which is used to store task and events of vCenter.

You can clear the space of /storage/seat partition by  truncating large table from below commands.

VCDB=# truncate table vpx_event cascade;

VCDB=# truncate table vpx_event_arg cascade;

truncate table vpx_task;

Running above command does not require downtime on vCenter.

For more information please refer below link.

VMware Knowledge Base

Regards,

Sachin

0 Kudos
Vijay2027
Expert
Expert

Agreed. All the mounts are in lvm except /dev/sda.

My concerns is for example in lvm backup file the physical volume is tied up with /dev/sdh which might cause issue in next major upgrade.

pv0 {

                        id = "Y87ulS-UoOO-0ibV-rzuL-Wlcm-Vdqf-gCTAHz"

                        device = "/dev/sdh"    

                        status = ["ALLOCATABLE"]

                        flags = []

                        dev_size = 20971520     # 10 Gigabytes

                        pe_start = 2048

                        pe_count = 1279 # 9.99219 Gigabytes

                }

0 Kudos