VMware Cloud Community
JudedeDude
Enthusiast
Enthusiast
Jump to solution

CTK.vmdk file

Does anyone know what a ctk.vmdk file is for that exists in a vm folder?

1 Solution

Accepted Solutions
Gostev
Enthusiast
Enthusiast
Jump to solution

Yes, CTK files are made automatically by VMware for all VMs with change tracking enabled. This is great technology that allows products supporting changed block tracking (like Veeam Backup and Replication 4.0) to do extremely fast incremental passes.

CTK file contains change tracking information of the corresponding VMDK file. The concept is pretty simple (this is my understanding): CTK file describes the state of each block for tracking purposes, and contain USN (sequence number) for each block in the corresponding VMDK. This way, any application can ask VMware API "tell me what block have changes since THIS moment", and the API will easily tell that by simply comparing the provided sequence number with the actual USN on each block. If provided USN is smaller than actual for particular block, the block was changed (and needs to be backed up, replicated or otherwise processed).

Basically there should be one CTK file per VMDK file, and CTK file cannot grow out of proportion with number of blocks in VMDK (as it stores only 1 record per VMDK block). CTK file is also thousands time smaller than actual VMDK, because it stores only a few bytes of information (USN) for each corresponding 256KB VMDK block (I am 90% sure it is 256KB, used to calculate once using CTK debug/stats data, just don't remember for sure).

These files are permanent, and should not be deleted after backup/replication.

Hope this helps!

Gostev @ VEEAM

View solution in original post

Reply
0 Kudos
9 Replies
lamw
Community Manager
Community Manager
Jump to solution

That is your descriptor file describing the VMDK characteristics/attributes, the actual 'data' should be stored in something that has the form of *-flat.vmdk. If you have multiple disks attached to a VM, then you'll have multiple descriptor files that pair up with their actual disks.

You can actually view the contents of the file since it's just text and here's an example of one:

-------------------------------------
# Disk DescriptorFile
version=1
CID=fb183c20
parentCID=ffffffff
createType="vmfs"

# Extent description
RW 8388608 VMFS "vmdisk0-flat.vmdk"

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "522"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
ddb.thinProvisioned = "1"
-------------------------------------

You'll get basic information such as chain IDs, the type of VMDK, it's data disk, hw version, etc.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

JudedeDude
Enthusiast
Enthusiast
Jump to solution

Thanks Lamw,

Would you say this is the file that has the block level tracking which makes backup quicker when using API products such as Veeam?

Reply
0 Kudos
Gostev
Enthusiast
Enthusiast
Jump to solution

Yes, CTK files are made automatically by VMware for all VMs with change tracking enabled. This is great technology that allows products supporting changed block tracking (like Veeam Backup and Replication 4.0) to do extremely fast incremental passes.

CTK file contains change tracking information of the corresponding VMDK file. The concept is pretty simple (this is my understanding): CTK file describes the state of each block for tracking purposes, and contain USN (sequence number) for each block in the corresponding VMDK. This way, any application can ask VMware API "tell me what block have changes since THIS moment", and the API will easily tell that by simply comparing the provided sequence number with the actual USN on each block. If provided USN is smaller than actual for particular block, the block was changed (and needs to be backed up, replicated or otherwise processed).

Basically there should be one CTK file per VMDK file, and CTK file cannot grow out of proportion with number of blocks in VMDK (as it stores only 1 record per VMDK block). CTK file is also thousands time smaller than actual VMDK, because it stores only a few bytes of information (USN) for each corresponding 256KB VMDK block (I am 90% sure it is 256KB, used to calculate once using CTK debug/stats data, just don't remember for sure).

These files are permanent, and should not be deleted after backup/replication.

Hope this helps!

Gostev @ VEEAM

Reply
0 Kudos
CMCC
Enthusiast
Enthusiast
Jump to solution

I guess is already late because this post is from 2 years ago hehe but still I make my question:

Why the ctk.vmdk is created in a different datastore and not the same of the VM? I noticed it!

Regards

Celia.-
Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

AFAIK ctk.vmdks are stored in the same directory as the vmdk they belong to


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
charliehawkins
Contributor
Contributor
Jump to solution

These files are annoying me.

I'm come across an issue with my CommVault system not being able to backup files that are smaller than 1GB properly.  It causes CommVault to spit out errors.  Smiley Sad

Reply
0 Kudos
willstej83
Enthusiast
Enthusiast
Jump to solution

I am currently having this issue with Simpana 9 and vSphere 5.1

it seems to be doing it to one of machines a day where I cant run the consolidate snapshot option because it tells me files are locked.

Anyone every have this issue?

Reply
0 Kudos
Sadyc
Contributor
Contributor
Jump to solution

Good day

I hope I can work from the last few days I have had the issue when a VM snapshot from Netbackup, check via ssh that does not have
clear snapshot and delete them had many and when you checkout the VM folder I realized I had about 240 files
as these MICROSOFT_COMPARTIDO_4_1-000001.vmdk and 243 MICROSOFT _COMPARTIDO_4-ctk.vmdk,

according to some forums must perform a configuration and delete files containing ctk, my question is whether it is right to also
I can delete the vmdk


____http://whileuno.com/?p=637


clarified that this VM is productive and which I want to apply processes do not affect the VM


Sady

Reply
0 Kudos
Rajesh_1988
Contributor
Contributor
Jump to solution

Hi ,

In my infra there is lot of CTK files , what will happen if i delete .

i got the details when searching for orphaned vmdk files .

Reply
0 Kudos