VirtualBacon

Create a vCenter alert for renamed VMs

warningA problem I often see in vCenter, because I am not the only one in it (though I have done this a couple of times myself), is that it is too easy to accidentally rename a virtual machine in the left pane of the vSphere client. It's frustrating to log into the client in the morning and see VMs with names like "eem" or "oe". The problem is worse if you are not running VM tools in the guest as you don't see the DNS name listed in the General pane. So you open the MKV console, figure out the name, then go back and fix it.

After running into these situations over and over I decided to create an alarm to let me know when this happens. This way I can catch it soon after it happens and remind the culprit to pay a little more attention to what they are doing. Another benefit of the alert is that it will list the name of the virtual machine prior to the rename operation making it easier and quicker to fix it.

Now to configuring the alarm.

In the vSphere client:

Right-click in the tree at the level you which to create the alarm, and select Alarm -> Add Alarm. I usually pick the vCenter server level but you can pick another one.

New Alarm

Give your new alarm a name and pick the Alarm Type. In this case we will set the monitor type to Virtual Machines, and select the radio button labelled "Monitor for specific events occurring on this object, for example, VM powered On".

Select Alarm Type

Now select the Triggers tab, click the Add button to add a new trigger condition, and click the drop down menu in the Event column and select VM renamed. You can optionally configure advanced conditions for the rule such as specifying a specific VM name, but that will be for another post.

Alarm Trigger

Now we need to specify an action to take once the alarm has been triggered. Select the Actions tab, click the Add button, then select an action from the drop down menu. I will choose to Send a notification email, and enter an e-mail address to send the e-mail to.

Alarm Send e-mail

As you can see now an alarm is triggered when I rename a virtual machine.

VM renamed alarm

Hope this helps!

 

 

Tagged as: Comments Off
   
Website Security Test