VMware Cloud Community
msea
Contributor
Contributor
Jump to solution

Powercli Script to Track VM Changes

We're still running esx 4.0.0 - we're upgrading to v5 next year.  I need a way to track changes to VM's, ie. new vm's created/cloned or a VM is modified to have more memory, cpu, disk etc.

I found some scripts but they don't seem to work with our version.  I setup an alarm to alert when a new vm is created but that's not enough information.

Any help you can offer would be greatly appreciated.  We're fully licensed with enterprise plus and have vcenter 4.0.0.

Thank you,

Matt

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

It should, the type of event used in the script was already there in vSphere 4.0.

What kind of errors are you getting ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
9 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

thread moved to VMware vSphere™ PowerCLI Community.

Reply
0 Kudos
CRad14
Hot Shot
Hot Shot
Jump to solution

I am not sure what exactly you are trying to do. It is my understanding that it would be incredibly difficult to go back through the events and grab all the information for a VM, partially because not every change triggers an event, and some that do, don't give the kind of info you might want.

A potential way to do it, would be to decide on all the data you want to track, and just write a script to grab that data on a weekly basis. This way if there are questions you can go back through and see when a particular vm Changed.

Instead of writing a script you could also just do a regular export of RVTools

http://www.robware.net/

Hope this helps...

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Your question looks somewhat similar to this thread Get the original hardware configuration of Virtual Machine

Did you check that thread ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
msea
Contributor
Contributor
Jump to solution

We have a number of administrators and 6 vsphere hosts, we're running out of memory and fast.  People are making changes without approval, often times forgetting to report the changes they're making.  I cannot remove their access.  I need a way to audit who is modifying the VM config's, especially memory.

Thanks,

Matt

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Then the script in Events – Part 3 : Auditing VM device changes will probably produce what you need.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
msea
Contributor
Contributor
Jump to solution

I saw that and it looked very good but when I run it I get all kinds of errors under 4.0.0 - I wasn't sure if it was written for a newer vsphere version.  Should it work under Ver 4.0?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

It should, the type of event used in the script was already there in vSphere 4.0.

What kind of errors are you getting ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
msea
Contributor
Contributor
Jump to solution

It did work, I made the mistake of running it against a host and not vcenter, than I had a few things to workout on my side and away I went.  Thank you for the help!  It doesn't seem to make too much overhead on the vcenter server although it does take a while to run, I imagine it just takes time to get through all the logs.

Thanks again,

Matt

Reply
0 Kudos
sushil46in
Contributor
Contributor
Jump to solution

Track VM Changes | IS Solutions

Follow this to help you keep track of VM changes.

Reply
0 Kudos