VMware Cloud Community
benhcen
Enthusiast
Enthusiast

convert thick to thin disk

Dear All,

I am using free exsi 5.5, i  try to convert the thick disk to thin disk  by console  ( seems free version, only  console)

after convert to thin, i do the copy on that thin copy,  it become thick again .

would you advise how to solve it

thanks

Ben

0 Kudos
16 Replies
a_p_
Leadership
Leadership

How do you copy the virtual disk, and what's the destination? Thin provisioning is a file system feature, and with copying the files using tools which are not aware of this, the files will inflate again. If you are copying virtual disks from VMFS datastores to other VMFS datastores use the vmkfstools command line utility.

André

0 Kudos
benhcen
Enthusiast
Enthusiast

hi, i am using the vsphere to do the copy and past on other folder ,it is in same data-store

phere client 0804022608.png

0 Kudos
a_p_
Leadership
Leadership

That should work, and I just tested it in my lab and the result was still thin provisioned. I copied a thin virtual disk to another folder on the same datastore as well as to a folder on another datstore.

How did you convert the virtual disk (using vmkfstools)? Does the virtual disk show up as "Thin" in the VM's HDD settings?

André

0 Kudos
vNEX
Expert
Expert

Hi,

use this command:

vmkfstools -i "/vmfs/volumes/<source datastore>/<vm-folder>/Unbutu-8.04.4.vmdk" "/vmfs/volumes/<destination datastore>/<dest-folder>/Unbutu-8.04.4.vmdk" -d thin -a lsilogic


_________________________________________________________________________________________

If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons)

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
benhcen
Enthusiast
Enthusiast

hi, it work but i do copy again to a new create folder , it same, it become thick again

~ # vmkfstools -i "/vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D07/Ubuntu-8.04.4.vmdk" "/vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D07/Ubuntu-84.vmdk" -d thin -a lsilogic

Destination disk format: VMFS thin-provisioned

Cloning disk '/vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D07/Ubuntu-8.04.4.vmdk'...

Clone: 100% done.

/vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D07 # du -h *

6.9G    Ubuntu-8.04.4-flat.vmdk

1.0M    Ubuntu-8.04.4.nvram

0 Kudos
a_p_
Leadership
Leadership

Why do you think the virtual disk is thick provisioned? According to the screenshot in your initial post, the provisioned virtual disk size is 50GB, and the current usage is only 6.9GB.

André

0 Kudos
vNEX
Expert
Expert

I do agree with

post the output or (screen from datastore browser)

What edition of Unbutu is installed? e.g. Unbutu Desktop requires 5GB disk space ....

_________________________________________________________________________________________

If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons)

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
benhcen
Enthusiast
Enthusiast

hi,  after convert to thin, it show it is thin, it is thin but on this copy, i clone again,  the new copy will become thick again

0 Kudos
benhcen
Enthusiast
Enthusiast

hi, this is after convert to thin version

0804022608.png

when i do the copy, it become thick again

2.png

0 Kudos
vNEX
Expert
Expert

strange ... only if you will copy thin disks between datastores with different block size your disk will become thick....(from the screens this is not your case)

please post output from commands below if your copy disk between two datastores:

# vmkfstools --queryfs -h /vmfs/volumes/<source volume>

# vmkfstools --queryfs -h /vmfs/volumes/<destination volume>

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
benhcen
Enthusiast
Enthusiast

~ # vmkfstools --queryfs -h /vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D12/copy/

VMFS-5.60 file system spanning 1 partitions.

File system label (if any): t078

Mode: public

Capacity 1.8 TB, 1.1 TB available, file block size 1 MB, max file size 62.9 TB

UUID: 53595af9-c4626004-0e87-002590f2cada

Partitions spanned (on "lvm"):

        mpx.vmhba2:C0:T0:L0:3

Is Native Snapshot Capable: YES

~ # vmkfstools --queryfs -h /vmfs/volumes/53595af9-c4626004-0e87-002590f2cada/D12

VMFS-5.60 file system spanning 1 partitions.

File system label (if any): t078

Mode: public

Capacity 1.8 TB, 1.1 TB available, file block size 1 MB, max file size 62.9 TB

UUID: 53595af9-c4626004-0e87-002590f2cada

Partitions spanned (on "lvm"):

        mpx.vmhba2:C0:T0:L0:3

Is Native Snapshot Capable: YES

0 Kudos
benhcen
Enthusiast
Enthusiast

hi, here is what i did

5.png

0 Kudos
a_p_
Leadership
Leadership

That explains it. You moved/remanmed only the flat file, but didn't edit the desctiptor file to define that it's now a thin provisioned virtual disk. Anyway, rather than using native Linux commands, simply use vmkfstools to rename the vitual disks (including descriptor and data files).

Example: vmkfstools -E OldName.vmdk NewName.vmdk

André

0 Kudos
benhcen
Enthusiast
Enthusiast

hi, after convert to Ubuntu84-flat.vmdk ,  ,   i remove  Ubuntu-8.04.4-flat.vmdk  , for vmkfstools -E,  which one i should change

-rw-------    1 root     root       50.0G Aug  3 15:09 Ubuntu-8.04.4-flat.vmdk

-rw-------    1 root     root         524 Jun 29 16:44 Ubuntu-8.04.4.vmdk

-rw-------    1 root     root           0 Apr 26 16:48 Ubuntu-8.04.4.vmsd

-rw-------    1 root     root        3.0K Aug  3 15:09 Ubuntu-8.04.4.vmx

-rw-------    1 root     root         268 Apr 26 16:48 Ubuntu-8.04.4.vmxf

-rw-------    1 root     root       50.0G Aug  4 16:49 Ubuntu84-flat.vmdk

-rw-------    1 root     root         545 Aug  4 16:52 Ubuntu84.vmdk

0 Kudos
vNEX
Expert
Expert

Unbutu84.vmdk because this is disk descriptor file which contains disk information and layout, its a pointer to RAW data (flat.vmdk).

So you have to always point to descriptor with command line tools such is vmkfstools.

Unbutu84-flat.vmdk its just file with RAW data...VM content.

Regards,

P.

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
0 Kudos
a_p_
Leadership
Leadership

From what you wrote, "Ubuntu-8.04.4.vmdk" is the original thick disk, which you converted to the thin disk "Ubuntu-84.vmdk". What I would do now, is to rename the original thick disk to a temporary name

vmkfstools -E Ubuntu-8.04.4.vmdk Ubuntu-8.04.4-original.vmdk

and then rename the converted thin disk back to the original name

vmkfstools -E Ubuntu-84.vmdk Ubuntu-8.04.4.vmdk

If everything works as expected you can delete the temporary (old) disk "Ubuntu-8.04.4-original.vmdk".

André

0 Kudos