Virtual Machine Creation Date / PowerCLI
jibbajabba
Member Posts: 4,317 ■■■■■■■■□□
Anyone know a nice script how to find out when a machine was created (vSphere 4.x) ?
I have seen a few scripts ("who created the VM" etc.) but they are doing "too much"... for instance, I don't need the creation date and name in the notes field (in fact, must not) and I cannot give a time frame or the last x amount of days / VMs.
I'd need to be able to give a vcenter and guest name and it should return the creation date.
Anyone know if something like this is out there ?
I have seen a few scripts ("who created the VM" etc.) but they are doing "too much"... for instance, I don't need the creation date and name in the notes field (in fact, must not) and I cannot give a time frame or the last x amount of days / VMs.
I'd need to be able to give a vcenter and guest name and it should return the creation date.
Anyone know if something like this is out there ?
My own knowledge base made public: http://open902.com
Comments
-
QHalo Member Posts: 1,488I'll see what I can come up with when I get home tonight unless you figure it out before then. Don't have access to my lab from here. If it can't be done from PowerCLI, you should be able to get it from a SQL query of the vCenter DB.
Edit - did you try this stuff from Luc D and Alan Renouf?
http://communities.vmware.com/thread/148655 -
blargoe Member Posts: 4,174 ■■■■■■■■■□If it was recent enough it would be in the VCDB in the task history... 180 days is it? I did something similar to get snapshot creator user name. If I can find it I'll post the query.
Is creation date a VM property that can be exposed in powercli?IT guy since 12/00
Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
Working on: RHCE/Ansible
Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...