It's possible to get the exact creation time of a VM?
I'm seeing here in the tasks and events but ain't found. Maybe some PowerCli cmdlet exclusive for reports?
That is a function, you have to call the function.
You could do, from the PowerCLI prompt
PS> . .\filename.ps1
PS> Get-VMCreationTimes
With the first command you dot-source the .ps1 file, as a result the function is now known in the PS engine. Note that there is a blank between the 2 dots.
The 2nd command calls the function and should produce some results
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc, thank you very much for your reply, it's working now! I am newbie on PS and dummy at the same time . Is there a way to pipe this into file like export-csv or > c:\vmcreationdate.txt?
Thank you again guys.
you can use the export-csv like this>
(your command) | export-csv c:\YourFile.csv
or
(your command) >>c:\YourFile.csv
it will work too in many cases.
Hi GuilhermeStela, it works!
This is what I did:
PS> . .\filename.ps1
PS> Get-VMCreationTimes >> c:\MyFile.csv
Thank you guys again! Take care!
Hi,
I am getting below error:
Could it be that Get-VM returns 0 or 1 VMs ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi folks,
the ps script works, but the is createdTime is wrong, the VM´s are only 1 or 2 months
old.
Has anybody a tip to solve this issue.
regards
Dominik
Which script are you using ? The one from May 15th 2012 ?
What kind of creation dates you get returned ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes i have use the scipt from the second site of this blog
this is my output from the text file
createdTime name IPAddress createdBy
14.06.2012 02:13:01 xxx {0.0.0.0, 192.168.10.68} xxxx/xxx
14.06.2012 02:36:40 xxxx {192.168.10.175} xxxx/xx
14.06.2012 03:00:53 xxx
the oldest entry is form the 06.14.2012
regards
dominik
And what should be creation dates according to you ?
Could it be that these VMs are perhaps re-created at some point with the same display name ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
the most of the vm´s are one or two years old
my retetion date form the vcenter is 180 days
The vm´s are not re-created
dominik
If most or all of your VMs run Windows then you'll possibly find that the OS install date corresponds fairly well with the VM creation date. I've got a Powershell/PowerCLI script that'll collect this info into a CSV file and allow you to fairly easily see how things have grown over time.
So it's not quite what you're after, but could be enough of an approximation to be useful.
See Get VMware VM creation date (kind of) on my blog.
it seems that the dates coorespond to a snapshot removal or something. It is showing we created 1000's of VM's in the past couple of months.. We've created a lot, but not quite that much.
My output is as follows for one VM:
11/28/2013 1:37:19 AM xlserver.domain.com
If I look in vCenter at the tasks for that server, I see the following at the same time:
Task: Remove snapshot
info
11/28/2013 1:37:19 AM
Remove snapshot
xlserver.domain.com
smvi
We are using NetApp's SMVI utility so I'm not sure if that is the issue. The user for the above entry was SMVI. I'm also seeing a lot of entries for VM's listing com.springsource.vfabric as the username...
Hello, can you help me, how execute script please. :smileygrin:
Thanks.