Solved

vSphere 4 and Thin Provisioning

Posted on 2010-08-16
22
1,486 Views
Last Modified: 2012-05-10
I'm running vSphere 4 Update 1 on an HP Dl585 G5 with local storage. In vCenter i tried to take a power off VM and use he Migrate feature to chage the HD type from thick to thin. After the process completely sucessfuly the properties to the Vm still show the VM as THICK ??

What up wit this>
0
Comment
Question by:compdigit44
  • 7
  • 6
  • 3
  • +3
22 Comments
 
LVL 28

Expert Comment

by:bgoering
Comment Utility
You indicated that you are using local storage. Are you trying to migrate it to the same datastore? Or do you have multiple local datastores. Reason I ask is that I believe any migration to the same datastore doesn't actually do anything, yet it completes normally - that is my experience on 4.1 anyway.

What you can do if only a single local datastore exists is to clone the machine and specify thin format, then if you wish to keep the original name and folder structure you can delete the original then clone it back.

Good Luck
0
 
LVL 2

Expert Comment

by:jlprasadreddy
Comment Utility
Try this
To convert a thick format disk to a thin format disk, clone the virtual disk with the destination disk type set to thin.   To clone a disk and convert it to thin format, run this command from the Service Console or from the VMware Command-Line Interface:   vmkfstools -i <srcDisk> -d thin <dstDisk>
For example:
vmkfstools -i vDiskName.vmdk -d thin vDiskNameThin.vmdk
 http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013052
 
 JLP
0
 
LVL 5

Expert Comment

by:Kevin_Leadbeater
Comment Utility
Note also that thin provisioned disks cannot exist on NFS volumes - a disk will always be fat there, even if you specify thin in the Storage VMotion or vmkfstools command line.

In case you are using ESXi, the command will need to be issued on the management server (where the CLI is installed), be aware you need to specify the server name as well:

# ./vmkfstools.pl --username root --password "" --server <ip> --diskformat thin --clonevirtualdisk /vmfs/volumes/local-storage/source/vm.vmdk /vmfs/volumes/iscsi-storage/target/vm.vmdk
0
 
LVL 22

Expert Comment

by:Luciano Patrão
Comment Utility
Hi

First how you did this migration? From thick to thin? With vmkfstools?

Jail
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
ALl of my ESX server are using a local data source and I'm trying to migrate and change the VM's from thick to thin using the same source and desentation source
0
 
LVL 22

Expert Comment

by:Luciano Patrão
Comment Utility
Hi

You to clone the disk; not migrate

Go to console and vmkfstools -i <srcDisk> -d thin <dstDisk>

Just clone to another disk(vmdk) that will use the thin option. This can be done to the same Storage.

Just go to the vfms volume and in the VM folder create the new disk with thin

Hope this can help

Jail
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
OK..
What will I gain by using thin provisioning?
Is there more I/O over head?
If I clone the disk, can I clone the vm to the same name on the same data store?
0
 
LVL 5

Expert Comment

by:Kevin_Leadbeater
Comment Utility
"When a virtual machine is created, the thin-provisioned disk only consumes what’s needed. Then, the virtual disk grows over time when more storage space is required."

The vmfstools.pl script just clones the vmdk file.  So yes, you can clone to the same name on the same datastore, but you also need to copy the other files as well (using Browse on the datastores).  Once you have copied the files, remove the first VM from the inventory and add the second one - with the same name if you wish.  You can also rename the folders.  Then you have the same VM taking up a lot less disk space - depending on how much is used in the operating system.

Check here for videos
http://www.vmware.com/products/vstorage-thin-provisioning/

I can't find any definitive answer to the performance question, but writing to a fat disk (that is zeroed) will be marginally faster - so for best performance you'd be best sticking with a fat disk.
0
 
LVL 28

Expert Comment

by:bgoering
Comment Utility
Thin provisioning gains you the ability to overcommit space on your datastore. You can run more vms, but you have to keep a good eye on the actual space utilization.

Any penalty you might pay is minimal, the default thick format reserves all the space, but when you go to write into new areas VMware writes zeros first to prepare the space, then allows the OS level write to go through. With thin provisioning the space is not reserved, but VMware incurs the same overhead of writeing the zeros before the OS write.

There is another way of provisioning disks called eagerzeroedthick (or someething like that) where VMware allocates all the space and writes the zeros when the disk is created, so you don't incur that tiny bit of overhead at run time when the space is written to.

Hope this helps
0
 
LVL 22

Expert Comment

by:Luciano Patrão
Comment Utility
Hi

You are not cloning the VM but only the Virtual Disk and yes you can into the same Storage, but with different name. Regarding the VM clone, no the VM name must be different(the VM machine name i another issue) in the same Storage and also in the same ESX host or Virtual Center

Regarding gain by using thin or thick, have advantages and disadvantages. Depending on the type of server, APP, Database, File Server etc. But thin principal advantage is the space that can

Take a look at this

http://virtualgeek.typepad.com/virtual_geek/2009/04/thin-on-thin-where-should-you-do-thin-provisioning-vsphere-40-or-array-level.html

http://searchvmware.techtarget.com/tip/0,289483,sid179_gci1348873,00.html

Hope this can help you

Jail
0
 
LVL 5

Expert Comment

by:chkdsk01
Comment Utility
Thin provisioning a disk will not incur a lot of additional overhead.  I try to thin provision most of my virtual disks.  The only problem I see a lot of admins running into is over allocating storage and then having problems down the road.  

Getting back to the issue, changing the provision type during the migrate should work.  Just a quick question, is this a standalone host or is this managed by vCenter?  If it is a standalone host, you should try using the VM converter.  Changing the provisioning type during migration utilizes the converter agent in vCenter.  If you don't have it, or it's not installed, the migration will work but the provisioning change won't.  If this is managed by vCenter, check to make sure the converter plugin is installed and enabled.

Just as a side note @Kevin Leadbeater, on NFS all disks are thin provisioned by default.  
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 19

Author Comment

by:compdigit44
Comment Utility
Here is some additional information...
1) All of my vSphere servers are managed by vCenter
2) I do not see the I have Converter Standalone installed on other workstation but I do not see it installed on my vCenter server.
3) I rean Conver on a power off VM and changed the disk type from thick to thin with the source and destination ESX server being the same. ONce the clone completed, I removed the orginal VM and powered on my new one which listed the disk a thin provisioned yet I noticed by over all disk space on my ESX server stayed the same?? I also noticed when i removed the Vm from dsik I still see the old VM's folder and VMDK file present?

What's going on?
0
 
LVL 5

Expert Comment

by:chkdsk01
Comment Utility
When you removed the old VM, did you just remove it from inventory or remove it and delete it?  Also, you only see a benefit with thin provisioning when there is free space inside the VMs virtual hard disk.  If your 20 GB Data drive has 20 GB of data, the disk can be set thin all you want, but you won't see any size difference in the vmdk.  Can you confirm how large the vmdk file is, the capacity of the virtual disks, and the free space inside the guest OS.
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
My vm that I changed to thin was orgianlly slated to used 50GB but the OS was only using 25GB!!!
0
 
LVL 5

Expert Comment

by:chkdsk01
Comment Utility
And the vmdk file it is currently using is how large?  50 GB?
0
 
LVL 5

Expert Comment

by:chkdsk01
Comment Utility
Ok.  It just dawned on me.  Your disk was originally 50 GB.  Then you converted it to thin, but the conversion doesn't reclaim that empty space.  You need to reclaim the free space back.  Had you started with a thin disk you would notice the size difference right away.  
Check out this link http://searchvmware.techtarget.com/tip/0,289483,sid179_gci1360516,00.html
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
ALso when I did the clone I did it with the Vm powered on should I do a cold clone in order for this to work properly....

Current VMDK file size when I SSH to the server is 50GB yet the vCenter GUIis shoing it only using 25???

I did get an error I I tried to remove the orginal VM stating the if other vm are reference this VM not all of the files will be deleted
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
The article you provide doesn't tell me what tools to use.
0
 
LVL 5

Expert Comment

by:chkdsk01
Comment Utility
You need to scroll down to the bottom to read the rest of the article.

Is this a test VM?  Also, take a look at the link I posted above.  I'm pretty sure this is the reason your seeing what you're seeing.  

Did you take a clone or a snapshot?  If this is a test VM, I would get rid of any clones, snapshots, and any other changes you made and go back to the original VM.  Reference the link I posted.  You can reclaim the free space by a storage vMotion or sDelete.  I havent used sDelete so I can vouch for its succesfullness.  But there's no harm in a storage vmotion.
0
 
LVL 19

Author Comment

by:compdigit44
Comment Utility
I cannot read the article becuase I do not have a login to few the full article
0
 
LVL 28

Expert Comment

by:bgoering
Comment Utility
The article pointed to the SDelete tool from Sysinternals. The Sysinternals (now part of Microsoft) tools are available from http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx.

Look into SDelete with the "-c" option.

The article also mentioned using the "Shrink" option in VMware Tools - but I am not sure if that even works in an ESX environment, though I have used it on both VMware Workstation and Server.

Good Luck

From the article:
"Using sdelete to reclaim space
The tool I used next is from Sysinternals called sdelete. To reclaim space on a Windows VMDK, download sdelete to the local hard disk. In my example, I used sdelete to clean the E: drive of the VM. Running sdelete with the following command will clear all lost space: "sdelete - c E:". Since this is a rather heavy I/O operation, you should plan this action very carefully in a production environment. Also note that after clearing, the blocks will really be empty. If a file is deleted by accident, it is almost impossible to use data recovery tools on that disk. So have good backups available before experimenting with this.

After sdelete has cleared your drive, vCenter will still show maximum disk usage, so the last step in reclaiming space is to use Storage VMotion. Since the disk is already in thin-provision format, you can choose the wizard to "Keep Disk Format" or "Change to Thin Provisioned Disk." Both options will now really free unused space. After the Storage VMotion has finished, you might have to press "Update storage usage" to force vCenter to recalculate storage usage, but after that, the VM will use far less storage then previously."
0
 
LVL 5

Accepted Solution

by:
chkdsk01 earned 500 total points
Comment Utility
Like I stated before.  You need to scrool all the way down the page to the very bottom.  I don't have an account either.
And @bqoering... yes, you're correct.  The shrink does not work in ESX.  
Also, a storage vMotion is supposed to do the trick too.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now