Mark III Systems Blog

VM Alarm Script

The python script here does the stuff below.

Although I built this to write the attributes you could easily stub in a CMDB or something and it would happen every time on create.

Could be too far out there, but some cool stuff anyway.

You could also make those attributes whatever you wanted. I just used vm.owner as it was there when I was coding. It could be vm.creator or something. This, also, now has full access to the VM data so you could put whatever you wanted wherever.

And you get this. You can change the attribute names to fit your needs and add more if you like.

You could also easily use this for a power off action to track when and who powered off the machine. This could support a decom process.

Here is the code: https://gist.github.com/mccbryan3/c628930075407f2467eba88326001871

Change the variables in the code to an account allowed to write attributes.