Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vSphere 4 and Thin Provisioning

Posted on 2010-08-16
22
Medium Priority
?
1,518 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +3
22 Comments
 
LVL 28

Expert Comment

by:bgoering
ID: 33451075
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
ID: 33451178
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
ID: 33452225
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 24

Expert Comment

by:Luciano Patrão
ID: 33453173
Hi

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

Jail
0
 
LVL 20

Author Comment

by:compdigit44
ID: 33453416
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 24

Expert Comment

by:Luciano Patrão
ID: 33453460
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 20

Author Comment

by:compdigit44
ID: 33454825
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
ID: 33454988
"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
ID: 33455026
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 24

Expert Comment

by:Luciano Patrão
ID: 33455223
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
ID: 33465015
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
 
LVL 20

Author Comment

by:compdigit44
ID: 33478703
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
ID: 33478863
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 20

Author Comment

by:compdigit44
ID: 33478902
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
ID: 33478967
And the vmdk file it is currently using is how large?  50 GB?
0
 
LVL 5

Expert Comment

by:chkdsk01
ID: 33479044
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 20

Author Comment

by:compdigit44
ID: 33479056
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 20

Author Comment

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

Expert Comment

by:chkdsk01
ID: 33479168
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 20

Author Comment

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

Expert Comment

by:bgoering
ID: 33487367
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 2000 total points
ID: 33487452
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …

604 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