2 Replies Latest reply on Mar 14, 2019 10:54 AM by rlustila1

    VRO extract host value from VC:HostSystem

    rlustila1 Lurker

      Hi All,


      I am working on setting up a self-healing datacenter workflow.  When an alert is triggered VROPS is kicking off an action using the vro management pack for vrops.


      The issue I am running into is the VC:HostSystem output that vrops kicks out does not contain the host name specifically.  It looks like I have to parse threw VC:HostSystem to get the value = host-103 out of it that I need to run in a powershell script to get the real name which isnt a big deal.  So that being said, I am having a difficult time getting to the value = host-103 out of VC:HostSystem. 


      Here is what VROPS sends me as VC:HostSystem:

      DynamicWrapper (Instance) : [VcHostSystem]-[class com.vmware.o11n.plugin.vsphere_gen.HostSystem_Wrapper] -- VALUE : Stub: moRef = (ManagedObjectReference: type = HostSystem, value = host-103, serverGuid = null), binding = https://vcenter-test1.testingstuff.net:443/sdk


      I have tried using regex, I have tried converting it over to a string because i thought maybe it wasnt able to work because VC:HostSystem is an Object.  I am a novice at javascript and still learning, does anyone have any examples of doing this properly?