Last year, I wrote about a new Virtual Machine API property called createDate which provides customers a method of retrieving the original creation date and time of a VM. This vSphere API was first introduced in VMware Cloud on AWS and with the release of vSphere 6.7, it is also now available for on-premises customers to consume.
I know this is a feature that many customers have been asking for (including myself) and I am super happy to finally see this information automatically captured and persisted as part of the VM configuration. Customers no longer have to query the vCenter Server Events API to retrieve this information and store it externally, since it can be rotated out and basically lost due to your vCenter Server Events retention configuration. As of right now, the VM creation date is only available using the vSphere API, it is currently not available in the vSphere H5 Client and hopefully I will be able to convince PM to add this useful piece information into the UI as well!
The createDate property is located under VirtualMachine->Config and can be accessed using any one of the supported vSphere 6.7 Automation SDKs which also includes PowerCLI (you will need to install PowerCLI 10.1.0 which enables support for vSphere 6.7)
Here is an example of retrieving the createDate for a VM named esxi67-01:
(Get-VM -Name esxi67-01).ExtensionData.Config.createDate
Here are a few things to be aware of regarding the createDate behavior:
- BOTH vCenter Server and ESXi hosts must be upgraded to 6.7 to make use of the new API
- This API is available on both vCenter Server as well as ESXi hosts running 6.7
- Only new VMs that were created after upgrading to 6.7 will include this property with the creation date
- VMs that were created prior to upgrading 6.7 will not have their original creation date, but rather a default value of 1970-01-01T00:00:00Z. If ESXi hosts have not been upgraded but vCenter Server has, then the API property will be unset (null)
- You can programmatically check whether an ESXi host supports the new createDate property by querying its capabilities using the vSphere API. Here is a PowerCLI example:
(Get-VMHost -Name 192.168.30.10).ExtensionData.Capability.VmCreateDateSupported
- VMs created in a vSphere 6.7 environment can be Cross vCenter vMotion to other non-vSphere 6.7 environments and migrated back while retaining its original createDate value. This is done so by storing the value in the extraConfig property of a VM (this is best effort support and we recommend only migrating to vSphere 6.7 or newer environments)
rdronov says
This is awesome news William! Definitely one of those things we can benefit from.
Pierre says
it ismind boggling that we had to wait 15 years for such a basic yet important information to be available....
WaWa Choy says
We use an annotation which we populate when the VM is created. What i would like to know is if this property can be edited so i can drop the annotation and fully populate this field.
William Lam says
No, the value of this property is automatically generated by the platform and can not be modified.
Dag Kvello says
Now all we need is:
(Get-VM -Name vmname).ExtensionData.Config.createdBy
It would make life so much easier when creating personalized notofications on snaptshots etc.
Dave says
Came to ask, if a createdBy field was an option. Looks like I need to keep waiting.
Brett Monroe says
+1
Also would love a createdBy attribute for a snapshot object
Pedro ET Ferreira says
These are great news!! But I would also love to have a createdBy attribute!
Michael Gonzalez says
Thanks for that, just what I was looking for and works nicely!
Jason says
too bad it also takes into account the creation of snapshots. we use avamar image backups and so snapshots are taken every night making this unsable for me.
michael says
which module should we use to retrieve the create date information i googled through for python and i dont get any leads
désiré-lévi says
Is there a way to obtain this information using the Java vSphere Automation SDK ?
Bill Weng says
I am trying to extend our existing property_filter_spec in propertyCollector call to add config.createDate, in my perl sdk 7.0 application. My vCenter is on vSphere 7.0 and the VM was newly created. What could be the reason this data is not in the response but all other properties are? Appreciated if you can point me some directions on how to debug this issue. Thx.