VMware Aria Automation Orchestrator

 View Only
Expand all | Collapse all

"reset to green" to specific Cluster on my VC

  • 1.  "reset to green" to specific Cluster on my VC

    Posted Dec 19, 2024 09:32 AM
    need help how to do "reset to green" to specific Cluster on my VC
    on my "VMware Aria Automation Orchestrator API Explorer" I see the the object "VcAlarmTriggeringAction"
     
    reset to green in Javascript from VRO 
     
    for example  my cluster is "myCluster01" and the issue is like "deleteThisAlarm"
    but I dont know how to start 
    thank you.


  • 2.  RE: "reset to green" to specific Cluster on my VC

    Posted Dec 19, 2024 03:17 PM

    Hi,

    I have a solution for you. Will send later today or tomorrow.



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://www.clouddepth.com
    ------------------------------



  • 3.  RE: "reset to green" to specific Cluster on my VC

    Broadcom Employee
    Posted Dec 20, 2024 10:06 AM

    You can generate the vRO code by going to the vCenter UI and entering the developer mode. From there you can perform a code capture. Start the capture, then perform the steps to set an alarm to green, then end the code capture. The vCenter UI will display the equivalent vRO code. Adjust to your liking.




  • 4.  RE: "reset to green" to specific Cluster on my VC

    Posted Dec 23, 2024 09:36 AM

    Hi, Brandon.

    unfortunately, this capturing doesn't work. Tested on different vCenter versions. I think it never worked. I an alarms context of course. 



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://www.clouddepth.com
    ------------------------------



  • 5.  RE: "reset to green" to specific Cluster on my VC

    Posted Dec 23, 2024 09:36 AM

    Hi,

    please find an example of the code, which will clear the alarms on a cluster level for an alarm, which is defined on a cluster level. You can play with the code, extend and adopt it to any alarm you want.

    Please define `sdk` as a `VC:SdkConnection` and `host` as a `VC:Hostsystem` inputs or variables to your scriptable task or action element. 

    Please note: this is a simple working example. It's should/can be improved based on your needs and use case.

    var alarmManager = sdk.alarmManager;
    var parentEntity = host.parent;
    var alarms = alarmManager.getAlarm(parentEntity);
    if (Array.isArray(alarms) && alarms.length > 0) {
        for (var i = 0; i < alarms.length; i++) {
            var alarm = alarms[i];
            var vcAlarmFilterSpec = new VcAlarmFilterSpec();
            parentEntity.sdkConnection.alarmManager.clearTriggeredAlarms(vcAlarmFilterSpec);
        }
    } else {
        System.log("No alarms found for the host.");
    }


    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://www.clouddepth.com
    ------------------------------



  • 6.  RE: "reset to green" to specific Cluster on my VC

    Posted Dec 24, 2024 10:37 AM

    Hi WhiteForEver 
    First of all, thank you very much
    I am try to understandthe script

    I try this  
    but I
    know that I missing something

    add sdk and esx host




  • 7.  RE: "reset to green" to specific Cluster on my VC

    Posted Dec 24, 2024 10:37 AM

    hi 

    thank you for your reply
    I see your script 
    but it does not work for me, and I am sure that I was wrong  
    I add input 

    (sdkinfo.VC:SdkConnection) , and (esxhost01.VC:HostSystem)

    var alarmManager = sdkinfo.alarmManager;
    System.log(alarmManager)
    var parentEntity = esxhost01.name;

    And continue your code




  • 8.  RE: "reset to green" to specific Cluster on my VC

    Posted Mar 13, 2025 12:31 PM

    Hi,

    `parentEntity` cannot be string. Your `esxhost01.name` returns a string. But it has to be an object. Please, try to use the code I did provide without any modifications. It should work.



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://clouddepth.com
    ------------------------------



  • 9.  RE: "reset to green" to specific Cluster on my VC

    Posted Jun 03, 2025 09:23 AM

    HI

    Unfortunately it doesn't work
    I took some screenshots
    Maybe you can see my mistake




    thanks 




  • 10.  RE: "reset to green" to specific Cluster on my VC

    Posted Jun 03, 2025 10:46 AM

    Hi,

    can you please show/confirm the alarm is set on a cluster level?



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://clouddepth.com
    ------------------------------



  • 11.  RE: "reset to green" to specific Cluster on my VC

    Posted Jun 04, 2025 03:26 AM

    Sorry, can you give me a picture of what you meant
    or give me direction ?