Hi there!
I currently setup a server running on ESXi having a thin provisioned hdd of 40gb. Seeing the actual VM size in VM server datastore is 7.9gb
I then decided to copy the whole thing to another storage, but then checking the size became this 41gb.
How was that possible? Does this mean that the actual VM size follows the provisioned space?
Thanks a lot
Jessie
Hi jessieboy2
Logon to your ESX host and nagivate to the sourcedisk_1.vmdk file. Edit the VMDK file and look for “Extent description” section as below: - # Extent description RW 62914560 VMFS "sourcedisk_1-flat.vmdk" The value between ‘RW’ and ‘VMFS’ is the size of disk. You can use the formula below to determine the value whereby DiskSize is in GB. (DiskSize * 1024 * 1024 * 1024)/512 = 62914560 So, we will then change the value to 10485760 to represent 5GB and it should look like below: - # Extent description RW 10485760 VMFS "sourcedisk_1-flat.vmdk" Next, run the vmkfstool to clone to a new disk and called it targetdisk_2.vmdk as below: - vmkfstool -i sourcedisk_1.vmdk targetdisk_2.vmdk Once the clone is completed, you will discover that the cloned disk now has a new size of 5GB as below: - -rw------- 1 root root 5368709120 Jun 9 18:08 targetdisk_2-flat.vmdk -rw------- 1 root root 423 Jun 9 18:08 targetdisk_2.vmdk Now, this is an important part. Edit the targetdisk_2.vmdk file and comment the following line as below: - #ddb.geometry.sectors = "63" #ddb.geometry.heads = "255" #ddb.geometry.cylinders = "7832" Next, remove the sourcedisk_1.vmdk from the VM in Edit Settings and do not delete disk. You can delete it later in the datastore browser. Then, add the new targetdisk_2.vmdk in Edit Settings of the VM. Finally, power up the VM but you will not be able to see the 5GB hard disk. You’ll need to switch the disk to “Online” status in Disk Management.
Hi,
How did you copied?
Have you used vmkfstools with Thin option?
Hi!
I just used a hotcopy, via ssh on a terminal. The usual copying.
Hi jessieboy2
Logon to your ESX host and nagivate to the sourcedisk_1.vmdk file. Edit the VMDK file and look for “Extent description” section as below: - # Extent description RW 62914560 VMFS "sourcedisk_1-flat.vmdk" The value between ‘RW’ and ‘VMFS’ is the size of disk. You can use the formula below to determine the value whereby DiskSize is in GB. (DiskSize * 1024 * 1024 * 1024)/512 = 62914560 So, we will then change the value to 10485760 to represent 5GB and it should look like below: - # Extent description RW 10485760 VMFS "sourcedisk_1-flat.vmdk" Next, run the vmkfstool to clone to a new disk and called it targetdisk_2.vmdk as below: - vmkfstool -i sourcedisk_1.vmdk targetdisk_2.vmdk Once the clone is completed, you will discover that the cloned disk now has a new size of 5GB as below: - -rw------- 1 root root 5368709120 Jun 9 18:08 targetdisk_2-flat.vmdk -rw------- 1 root root 423 Jun 9 18:08 targetdisk_2.vmdk Now, this is an important part. Edit the targetdisk_2.vmdk file and comment the following line as below: - #ddb.geometry.sectors = "63" #ddb.geometry.heads = "255" #ddb.geometry.cylinders = "7832" Next, remove the sourcedisk_1.vmdk from the VM in Edit Settings and do not delete disk. You can delete it later in the datastore browser. Then, add the new targetdisk_2.vmdk in Edit Settings of the VM. Finally, power up the VM but you will not be able to see the 5GB hard disk. You’ll need to switch the disk to “Online” status in Disk Management.
You can try using VMKFSTOOLS as suggested here
Thanks a lot for the reply. Will try and test the above items mentioned. Will update you after
Jessie
Just a quick note. Thin provisioning is a feature of the VMFS file system and tools like hotcopy are not aware of this and only "see" the provisioned file size rather than the currently used disk space.
André
PS: You can savely ignore jimraina's post.