VMware Cloud Community
khoe
Contributor
Contributor

Problems reclaiming space on virtual server

Hi

In our esx 4.1 enviroment I have trouble to reclaim space from some virtual servers.

I have tried with storage vmotion

I have tried using sdelete -c and then after storage vmotion.

I have also tried swithing to thick and then thin provisioned, without any luck.

I have tried the storage vmotion when the machines are turned off.

But my servers do not release the unused space.

Any idead what I could do?

Best regards

Kim Hørsted

-------------------------------------- Best Regards Kim Hørsted
Reply
0 Kudos
24 Replies
Troy_Clavell
Immortal
Immortal

have you tried VMware Converter to resize? Step 3 of the Standalone Converter will allow you to resize.

Reply
0 Kudos
AndreTheGiant
Immortal
Immortal

Have you tried to do first a defrag and then a sdelete?

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
Reply
0 Kudos
pcerda
Virtuoso
Virtuoso

Hi

Remember that when you use Storage vMotion to convert your virtual disks from Thick to Thin, you have to select a different Datastore. When you use Storage vMotion to move a VM into the same Datastore, the disk format doesn't change at all.

Also make sure your VMs aren't using snapshots for too long.




Regards / Saludos

-


Patricio Cerda !http://www.images.wisestamp.com/linkedin.png!

VMware VCP-410

Join to Virtualizacion en Español group in Likedin

See My Blog

See My Linkedin Profile

-


Si encuentras que esta o cualquier otra respuesta ha sido de utilidad, vótalas. Gracias.

If you find this or any other answer useful please consider awarding points by marking the answer helpful or correct. Thank you.

Regards / Saludos - Patricio Cerda - vExpert 2011 / 2012 / 2013
Reply
0 Kudos
akidanov
Contributor
Contributor

Kim,

I see same issue... After several hours of defrag/sdelete and migrations I gave up and came up with another way of doing things, simply use some disk cloning iso and clone old disk to new thin provisioned disk.

I wrote more details in my thread: http://communities.vmware.com/message/1600351

I only tried x64 2003, but will stick to my way for the time...

Reply
0 Kudos
AWo
Immortal
Immortal

Storage vMotion while the guest is on from one datastore to another one should do it when the guest uses thin disks. You must select the thin disk type again in sVMotion.


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
Reply
0 Kudos
khoe
Contributor
Contributor

I have tried using storage vMotion without any luck.

I have also tried to make a defrag, then a sdelete and the storage vMotion from one datastore to another without any luck.

Best regards

Kim Hørsted

-------------------------------------- Best Regards Kim Hørsted
Reply
0 Kudos
AWo
Immortal
Immortal

1. Is the disk thin provisioned?

2. Have you moved the disk from one datastore to another?

3. Describe the steps you took in detail.


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
Reply
0 Kudos
khoe
Contributor
Contributor

1: Yes disk is thin provisioned.

2. Yes I have moved it from one datestore to antoher.

3:

I have triede the following thing:

#1 try

- Vmotion from one datestore to antoher.

#2 try

- sdelete -c

- vmotion from one datastore to another

#3 try

-sdelete -c

- turn off virutal machine

- storage vmtion from one datastore to another

-------------------------------------- Best Regards Kim Hørsted
Reply
0 Kudos
Dace07
Contributor
Contributor

I also have tried the following (ESXi 4.1 and Windows 2003 32bit Enterprise VM)

sdelete - c, storage vmotion to a different datastore, selecting thin provision.

sdelete -c, storage vmotion to a different datastore, selecting same as source

storage vmotion to a different datastore, select thick provision, then run vmware tools - shrink disk option, storage vmotion to a different datastore and selecting thin provision

It seems no combination of zeroing out the free space and storage vmotion in ESX 4.1 is working to reclaim thin provision disk space. All of the above scenarios caused the opposite, the diskspace was fully consumed (was 5 GB used of 30GB provisioned before, afterwards it was 30 GB used of 30 GB provisioned).

Anyone have an idea why storage vmotion in 4.1 is not behaving like it did in 4.0, leaving the zero'd blocks out of the svmotion and reclaiming the space?

Reply
0 Kudos
rpatty
Contributor
Contributor

Still no answers to this? I'm having this problem, too. I've used sdelete and storage vmotion in the past to reclaim space many times on our ESXi 4.0 setup. But with a new datacenter which is 4.1 when I try to reclaim space it's simply not working.

Well, technically it reclaimed about 2 GB, but this is on a disk where only 20 of 50 GB are being used. It went from saying it was using 50 GB to saying it's using 48 GB, but there should be another 28 GB to reclaim.

Reply
0 Kudos
Dace07
Contributor
Contributor

I opened up a ticket with VMware and was told that the disk lib used to copy during a cold or hot migration to another datastore is not operating as documented (copying only the non-zeroed blocks).

My tested workaround is to do the following to reclaim space:

1) Run defrag inside the VM

2) Run sdelete -s -c on the disk inside the VM or use the vmware tools "Prepare Disk for Shrinking" operation which I was told by VMware will do the same task as sdelete, but is supported by VMware.

3) Convert VM to a eager zero thick format as follows using vmkfstools:

i) Enable local tech support mode on host that VM resides on, and log in

ii) cd \vmfs\volumes\.vmdk (to convert a zero thick to an eager zero thick vmdk) or vmkfstools - j to convert a thin to an eager zero thick vmdk.

v) cold or hot migrate the VM to a new datastore, this will now shrink the disk as it will properly recognize the zeroed out blocks written during the eager zero thick format. (migration to thin provision disk)

Feel free to award points if this is helpful!

Reply
0 Kudos
rpatty
Contributor
Contributor

It may be helpful, but right now it's kind of confusing. Did they simply break this functionality in 4.1? Are they planning on fixing it?

I've never heard of "eager zero thick" before, so I've got to do some research before messing with those formats. Also, the instructions look like it ends up in thick rather than thin at the end of your steps, which isn't what I'm after. (Or is there an implied "convert back to thin" in step 5 that I'm missing?)

Honestly, if a VMware operation involves messing around with command-line tools, I consider it something they don't properly support I don't want to bother with. At least until I absolutely have to. Of course if they've broken space reclaiming on thin provisioned disks, that may not take very long.

Reply
0 Kudos
rpatty
Contributor
Contributor

Also, this looks like it's broken on all levels. I've tried migration when powered off, and cloning, and it's still keeping the drive maxed out. Guess I'll try a convert next, to see if that'll work. Unfortunately we can't afford the interruption caused by converting most of our production machines, so that's a really bad solution.

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

The simplest method is to use VMware standalone converter. You have an option to change disk size. It doesn't matter up or down in size. When you change size Converter creates a new blank disk and does a file copy to the new disk. No complicated command line and the operation is relatively quick. You can have Converter run against a running VM, shut down services on the Old, quiesce and sync the changes to the new VM, shut down the old and start the new.






Forum Upgrade Notice - the VMware Communities forums will be upgraded the weekend of December 12th. The forum will be in read-only mode from Friday, December 10th 6 PM PST until Sunday, December 12th 2 AM PST.

-- David -- VMware Communities Moderator
Reply
0 Kudos
Dace07
Contributor
Contributor

I edited the original post to include the implied migration in step V to convert thick to thin provision, to reclaim the space as a thin provisioned VM.

Converter will work, but that is creating a new VM, not reclaiming space on an existing VM.

VMware indicated that this is being registered as a bug and hopefully will be fixed in an update / patch so we can just use storage vMotion with no interuption of service.

Reply
0 Kudos
rpatty
Contributor
Contributor

Figured it had been a while, wanted to check back in and see if there were any reports of the bug getting fixed, or estimates on when it might be?

Reply
0 Kudos
DaGSUMan
Contributor
Contributor

Problem has not been fixed. I have 1TB of disk space wasted and can be reclaimed if this is corrected. Can anyone or VM come with a fix.

Reply
0 Kudos
AWo
Immortal
Immortal

Which guest OS? Have you tried DSTAVERT's hint to use the Converter?

AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
Reply
0 Kudos
rpatty
Contributor
Contributor

Using the converter is no good for production machines that we don't want to turn off.

Reply
0 Kudos