Steps to identify the creation date of Virtual Machines in the vCenter server using vSphere API
search cancel

Steps to identify the creation date of Virtual Machines in the vCenter server using vSphere API

book

Article ID: 375957

calendar_today

Updated On:

Products

VMware vCenter Server 7.0 VMware vCenter Server 8.0 VMware vCenter Server

Issue/Introduction

  • VM creation date is available using the vSphere API, it is currently not available in the vSphere Client.
  • The createDate property is located under VirtualMachine->Config and can be accessed using the supported vSphere Automation SDKs which includes PowerCLI 

Environment

vCenter server 6.7, 7.x, 8.x

Resolution

Refer the following steps to retrieve the creation date of Virtual Machines from the vCenter server.

  1. Connect to the vCenter server using PowerCLI
Connect-VIServer -Server "FQDN_of_vCenterServer"

   

     2. Get all VMs and their creation dates using the following command,

$vms = Get-VM | Select-Object Name, @{Name="CreationDate";Expression={$_.ExtensionData.Config.CreateDate}}

 

Additional Information

Download URL for VMware Power CLI

  • 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)