<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I determine the age of a virtual machine? in vSphere Management SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438673#M2154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, if a DB maintenance job runs it'll clean up old events from the database.&amp;nbsp; So it's not really a PyVmomi or SDK issue, but just the fact the actual event is cleaned from the DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The disk creation time stamp isn't a bad idea, that's creative.&amp;nbsp; I guess the negative there is you won't be able to get who created the VM, just the creation time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have control of your VM creation process, you can add some CustomValue tags in vSphere to the VM for the creation date.&amp;nbsp; I had a few customers who used a daily script or vCO workflow to get the VMCreated events, turn those into CustomValues (so they don't get pruned on a DB maintenance job) and that works well (since it's rare that you'll have VM events wiped in the 24 hr period of the script/workflow task).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 17:41:07 GMT</pubDate>
    <dc:creator>stumpr</dc:creator>
    <dc:date>2015-06-10T17:41:07Z</dc:date>
    <item>
      <title>How do I determine the age of a virtual machine?</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438672#M2153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've seen some Powershell&amp;nbsp;to go through all the events and find the creation event, but this method doesn't seem ideal, as I understand it can get confused by software version upgrades, and the events may not be retained depending on settings.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;I can get the creation time of the first root snapshot, e.g.&amp;nbsp;vm.snapshot.rootSnapshotList[0].createTime. &amp;nbsp; This is quite useful, and coincides with creation dates for many machines, however some VMs don't have a root snapshot.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Can I do better?&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;PS: &amp;nbsp;I am using pyVmomi, however I don't think this is the problem, and can switch to another language if necessary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 14:11:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438672#M2153</guid>
      <dc:creator>shaggeeey</dc:creator>
      <dc:date>2015-06-10T14:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I determine the age of a virtual machine?</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438673#M2154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, if a DB maintenance job runs it'll clean up old events from the database.&amp;nbsp; So it's not really a PyVmomi or SDK issue, but just the fact the actual event is cleaned from the DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The disk creation time stamp isn't a bad idea, that's creative.&amp;nbsp; I guess the negative there is you won't be able to get who created the VM, just the creation time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have control of your VM creation process, you can add some CustomValue tags in vSphere to the VM for the creation date.&amp;nbsp; I had a few customers who used a daily script or vCO workflow to get the VMCreated events, turn those into CustomValues (so they don't get pruned on a DB maintenance job) and that works well (since it's rare that you'll have VM events wiped in the 24 hr period of the script/workflow task).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 17:41:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438673#M2154</guid>
      <dc:creator>stumpr</dc:creator>
      <dc:date>2015-06-10T17:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I determine the age of a virtual machine?</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438674#M2155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about creativity, more of a brute-force approach:&amp;nbsp; I grepped the pyVmomi sources and docs for 'dateTime', and printed all of them to see if they made sense!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although it's not exactly an answer, I marked it as such, because it's a good strategy.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 08:47:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/How-do-I-determine-the-age-of-a-virtual-machine/m-p/438674#M2155</guid>
      <dc:creator>shaggeeey</dc:creator>
      <dc:date>2015-06-11T08:47:34Z</dc:date>
    </item>
  </channel>
</rss>

