Vmware Powercli script that will tell me who deployed? from a template or cloning?

Need a script for VMware that will tell me, who deployed?  from a template or cloning?  

Please help.  I need something that will allow me to input the name of the VM and get this info.

Is there anything like this?
JB BlancoSr Systems EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
You've got to search the event and task list in vCenter to check this and the results may not be conclusive

Are you looking for a specific timeframe e.g last 7 days?
0
JB BlancoSr Systems EngineerAuthor Commented:
tasks and events only shows up to 2 months ago.  I know this vm was created a long time ago, perhaps almost 1 year ago.  I need to know when it was created, Who created it, and whether it was a clone or deployed from a template
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
All tasks and events are stored in the vCenter database
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

JB BlancoSr Systems EngineerAuthor Commented:
I know that, thats why i am asking for a script i can use to query the db and relay that information
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Have you tried any of the common powercli scripts around to search events in vCenter Server ?
0
JB BlancoSr Systems EngineerAuthor Commented:
I tried a couple of scripts, but nothing that will show whether its been cloned from another vm or deployed from a template.

I was able to run one called GetVMCreationDateListLast365Days.ps1 - that gives me the creation date at least
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If you have found a creation date, the event may still be present.

Looking at the Tasks and Events in vCenter Server, there is an EVENT, which is recorded when a Template is DEPLOYED or CLONE.

It states in the Description, and a EventID can be found for DEPLOYED or CLONED.

These PowerCLI one liners will search the Tasks and Events, for DEPLOYED and CLONED from Templates

DEPLOYED
Get-VIEvent | Where { $_.Gettype().Name -eq "VmBeingDeployedEvent"} | Select CreatedTime, UserName, FullFormattedMessage

Open in new window


CLONED
Get-VIEvent | Where { $_.Gettype().Name -eq "VmBeingClonedEvent"} | Select CreatedTime, UserName, FullFormattedMessage

Open in new window


VMware-PowerCLI-6.5-Release-1-build-.jpg
and output CreatedTime, Username, and Full formatted messages. The information you require is also in the full formatted messages as the source and destination VM names or templates are given. So you've got the created time, username, and what template was used, and which VM was created.

This works fine, but depending upon your summary database settings, the information may have already gone, it it's been over a year, because tasks and events have been scrubbed, so you may not have an audit trail.

But please try the one lines, I believe satisfies your Question:-

Need a script for VMware that will tell me, who deployed?  from a template or cloning?  

Please help.  I need something that will allow me to input the name of the VM and get this info.

Is there anything like this?

If you execute these one lines, you will see who deployed or clone what...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.