Thick Disk to Thin Disk

I have came across many situations where people asked about thin provisioned disks for their VMs. Sometimes they already have their Thick Provisioned disks and want to convert all those disks to Thin Provisioned. So thought to create this post.

This is the setup I did exclusively for you now on my LAB and below is the output.

I have created a new Thick disk of 2GB using the command line and the output is as below:

[root@virtualbox prasenjit]# vmkfstools -c 2048m -d thick -a lsilogic test.vmdk

[root@virtualbox prasenjit]# ll
total 2097216
-rw——- 1 root root 2147483648 Nov 12 13:49 test-flat.vmdk
-rw——- 1 root root 369 Nov 12 13:49 test.vmdk

Now I did a cat to the vmdk descriptor file and there is no hint of whether it is Thick or Thin. It means that this is a Thick disk.

[root@virtualbox prasenjit]# cat test.vmdk
# Disk DescriptorFile
version=1
CID=1e16e9e2
parentCID=ffffffff
createType=”vmfs”

# Extent description
RW 4194304 VMFS “test-flat.vmdk”

# The Disk Data Base
#DDB

ddb.virtualHWVersion = “4”
ddb.uuid = “60 00 C2 99 ab 52 a3 f6-83 3e 7c 91 77 14 15 42”
ddb.geometry.cylinders = “261”
ddb.geometry.heads = “255”
ddb.geometry.sectors = “63”
ddb.adapterType = “lsilogic”

Now we have to do a clone of this disk in order to change the disk type and without losing any data on the disk.

[root@virtualbox prasenjit]# vmkfstools -i test.vmdk newfile.vmdk -d thin
Destination disk format: VMFS thin-provisioned
Cloning disk ‘test.vmdk’…
Clone: 100% done.

[root@virtualbox prasenjit]# ll
total 4124800
-rw——- 1 root root 2147483648 Nov 12 14:00 newfile-flat.vmdk
-rw——- 1 root root 398 Nov 12 14:00 newfile.vmdk
-rw——- 1 root root 2147483648 Nov 12 13:49 test-flat.vmdk
-rw——- 1 root root 369 Nov 12 13:49 test.vmdk

Now if you can check the descriptor file for the new disk then it will say you that this is a Thin disk.

[root@virtualbox prasenjit]# cat newfile.vmdk
# Disk DescriptorFile
version=1
CID=1e16e9e2
parentCID=ffffffff
createType=”vmfs”

# Extent description
RW 4194304 VMFS “newfile-flat.vmdk”

# The Disk Data Base
#DDB

ddb.virtualHWVersion = “4”
ddb.uuid = “60 00 C2 97 84 b4 66 af-ef 29 f9 a9 2c 58 6f cc”
ddb.geometry.cylinders = “261”
ddb.geometry.heads = “255”
ddb.geometry.sectors = “63”
ddb.adapterType = “lsilogic”
ddb.thinProvisioned = “1”

About Prasenjit Sarkar

Prasenjit Sarkar is a Product Manager at Oracle for their Public Cloud with primary focus on Cloud Strategy, Oracle Openstack, PaaS, Cloud Native Applications and API Platform. His primary focus is driving Oracle’s Cloud Computing business with commercial and public sector customers; helping to shape and deliver on a strategy to build broad use of Oracle’s Infrastructure as a Service (IaaS) and Platform as a Service (PaaS) offerings such as Compute, Storage, Java as a Service, and Database as a Service. He is also responsible for developing public/private cloud integration strategies, customer’s Cloud Computing architecture vision, future state architectures, and implementable architecture roadmaps in the context of the public, private, and hybrid cloud computing solutions Oracle can offer.