Link to home
Start Free TrialLog in
Avatar of SeeDk
SeeDk

asked on

ESXI 5.5 : Shrink vmdk of a Linux VM?

I am trying to clone this VM to another host and noticed it has 450GB allocated as "Thick Provisioned Lazy Zeroed"
On the OS level though I see only 188GB of this is actually used.
 I would like to reduce the disk size to say 300GB and then clone it but am not sure how to do this.
I think I need to use vMotion somehow but first wouldn't I need to make sure the data in the OS level is not located at the end of the disk?
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

The easiest and VMware supported method, if the Linux Distribution is supported is to use VMware Converter, and complete a V2V, and perform a re-size/clone as part of the procedure.

Please see my EE Articles

HOW TO: FAQ VMware P2V Troubleshooting

HOW TO:  P2V, V2V for FREE - VMware vCenter Converter Standalone 6.1
Avatar of Anil_dasmala
Anil_dasmala

Another way to do this online is to migrate the vm to a different block size formatted datastore.
I think usually luns allocated to vmware are formatted with vmfs5 and a block size of 1MB by default(v5.5).
selecting vmfs3 while formatting the lun gives an option to select different block size like 2/4/8MB.
so data-store migrate the vm to this newly created different block sized datastore(selecting thin prov).
After the migration completes,  the vm becomes thin provisioned. You can then move migrate back the vm to the original lun.
Avatar of SeeDk

ASKER

I tried doing the conversion using Converter Standalone 5.5 and also 6.1. See this same issue on both:

When I try connecting to the destination host - this error appears:
"The access to the host resource settings is restricted. Use the management server as a destination "

Ok, so I then try connecting to the management server and get this error:
Unable to recognize the server type or version when connecting to the host 'x.x.x.x

My other option is to choose 'VMware workstation or other VMware virtual machine' but then not sure what to VMware product to select.
And even when I do select one of the available product, on the next screen I cannot edit the size of the Disk. It is fixed at 450GB.

Not sure if this is going to work?

Another question: If I export an OVF of the VM - would that OVF only export the disk space that is actually used? So when I import the OVF the disk size would be closer to the actual used space of 200GB?
Avatar of SeeDk

ASKER

Also, I made a mistake in the title - both these hosts are running ESXI 5.1 not 5.5.
The OVF will only export the space in use, but when imported it will create the same size disk as was exported.

 VMware virtual machine is what to select.

Do you have vCenter Server, you are supposed to connect to this....

also make sure you distro of Linux is supported.
Avatar of SeeDk

ASKER

For OVF I tested an export on much smaller VM:
Thick provisioned 32GB but only 21GB in use.
Exported OVF and imported on a different host.

On import - was given the option to either thick provision again or thin provision.
Choosing thin provision created the .vmdk file of only 21GB in size BUT the disk is still configured to grow up to 32GB.
Not ideal but seems this might work to get the large VM on the other host at least.

On the standalone converter, default option is "VMware Infrastructure Virtual Machine' and that is where I see this errors.
Choosing the other option gives me a second drop down menu with:
VMware Workstation x.x.x
VMware Fusion x.x.x
VMware Player x.x.x


Yes, vCenter Server is version 5.5.0 Build 2646482
Linux distro is Red Hat Enterprise 6
what are you really wanting to do here... convert from thin provisioned to thick, thick to thin, or SHRINK the disk.

Yes, if you Import an OVF, it will give you options of what you want to do with the disk, if you use Storage vMotion, it will ask you the same options, if you want to convert disk type, but it will not shrink the disk!

what version of converted are you using ?

When converting the first screen for Source, you should select Remote Linux machine, and enter IP Address, username and password.

and then destination, is your vCenter Server... IP Address or Name, username and password

and this option

VMware Infrastructure Virtual Machine.

You cannot use ESXi Host as Destination any more. (if managed by vCenter server)
Avatar of SeeDk

ASKER

My bad...a colleague had configured this server to connect on port 444...so I had to enter IP of vCenter Server as x.x.x.x:444.

Ideally, I want to SHRINK the disk.

So now I was able to select Destination and am on the 'Options page but do not see how to shrink the disk? I can only choose between Thick and ThinUser generated image
what option do you have if you select the dropdown ?

because you've selected, Copy all disks, and maintain layout ?
Avatar of SeeDk

ASKER

That's the only option available. Clicking on it shows that as the only option in the dropdown.
if you click Edit, in the Left Hand panel, otherwise it's not supported for re-size.
Avatar of SeeDk

ASKER

Clicking edit doesn't show any shrink option either. I guess for now I will just have to thin provision it. Is there any option for shrinking - even if more complicated?
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SeeDk

ASKER

Thanks for your help - haven't tried the shrinking but will due the v2v conversion with 'thin disk provision'.
Will try shrinking on the copied VM.