VMware Cloud Community
jessieboy2
Contributor
Contributor
Jump to solution

VM size increased after copied

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

------------------------------------------------------- ...the depth of your PASSION is far more important than the height of your AMBITION..."
Reply
0 Kudos
1 Solution

Accepted Solutions
jimraina
Enthusiast
Enthusiast
Jump to solution

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 are stronger than you think"

View solution in original post

Reply
0 Kudos
6 Replies
nava_thulasi39
Jump to solution

Hi,

How did you copied?

Have you used vmkfstools with Thin option?

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
jessieboy2
Contributor
Contributor
Jump to solution

Hi!

I just used a hotcopy, via ssh on a terminal. The usual copying.

------------------------------------------------------- ...the depth of your PASSION is far more important than the height of your AMBITION..."
Reply
0 Kudos
jimraina
Enthusiast
Enthusiast
Jump to solution

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 are stronger than you think"
Reply
0 Kudos
aravinds3107
Virtuoso
Virtuoso
Jump to solution

You can try using VMKFSTOOLS as suggested here

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
Reply
0 Kudos
jessieboy2
Contributor
Contributor
Jump to solution

Thanks a lot for the reply. Will try and test the above items mentioned. Will update you after

Jessie

------------------------------------------------------- ...the depth of your PASSION is far more important than the height of your AMBITION..."
Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

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.