VMware vSphere

 View Only
  • 1.  Custom alarms

    Posted Mar 12, 2020 10:28 AM

    Hi,

    I want to configure some alarms which will send notifications on email but I can't figure it out what type of conditions should I use.

    The scenario includes 2 VMs that I want to keep on different hosts from the cluster.

    I tried was the following rule:

    Targets: All virtual machines in vCenter server servername

    Alarm Rules: IF VM connected

    Argument vm.name starts with vmname-

    Argument host.name equal to first-cluster-name (where both vm runs)

    THEN trigger the alarm as  warning and send emails

    OR IF VM connected

    Argument vm.name starts with mobileweb-

    Argument host.name not equal to second-cluster-host

    THEN trigger the alarm as  normal and send emails

    But I'm almost sure that this is wrong, at least the host argument.

    I can't figure it out how to configure the rules in order to get notified when both VMs are running on the same host.

    Any help will be appreciated.

    Best regards.



  • 2.  RE: Custom alarms

    Broadcom Employee
    Posted Mar 12, 2020 11:19 AM

    A cluster enabled for DRS?

    If so, leave your cluster fully automated and create a VM-VM Affinity Rule: Create a VM-VM Affinity Rule

    You should not then need your alarm.



  • 3.  RE: Custom alarms

    Posted Mar 12, 2020 11:32 AM

    Sorry but I forgot to mention that used license is a standard one so DRS is not supported.



  • 4.  RE: Custom alarms

    Posted Mar 12, 2020 11:41 AM

    So out of curiosity, what will you/someone do if you get such an email alert?



  • 5.  RE: Custom alarms

    Posted Mar 12, 2020 11:44 AM

    Get informed that both VMs are running on the same host.

    Since is not critical, can be ignored or can manually migrate the VM.

    I intend to create e powercli script, but the first step is this notification.



  • 6.  RE: Custom alarms

    Posted Mar 12, 2020 11:48 AM

    That's what I was driving at. Since you can't afford a license for DRS, which would be the "correct" way to go about this, I'd rather invest in building the automation to ensure that this is remediated *without* having to notify a person. Doing this in PowerCLI would not be complex. You could then schedule the script to run on a regular basis. Since you have vCenter Server, you also have a license to vRO and could do it there as well. And all of this without having to notify you.



  • 7.  RE: Custom alarms

    Posted Mar 12, 2020 03:53 PM

    I agree about the DRS but since I'm not the one who can decide this, I have to work with what is available.

    I want this alarm because the script can be executed when the condition is met and a notification is send, so I know that something might be wrong.

    Also, the script will contain no condition, just move vm to other node.