1 Reply Latest reply on Aug 9, 2017 1:06 PM by Andrew Waters

    vSphereFindObjects - Not find object

    David Rough



      I am having trouble retrieving a vCenter setting using the discovery.vSphereFindObjects function.


      When checking the MOB the setting is shown as being here:




      Managed Object Type: ManagedObjectReference:OptionManager


      The property Path is:


      Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]


      And my pattern body is:


          on host := Host created, confirmed where os_type = 'VMware vCenter Appliance';

      end triggers;



          vc_passExp := discovery.vSphereFindObjects(host, "OptionManager", ["VirtualCenter.VimPasswordExpirationInDays.value"]);

              if vc_passExp then

                  for h in vc_passExp do

                      passExp := h.virtualCenter_VimPasswordExpirationInDays_value;


                  end for;

              end if;

      end body;


      From testing though it would appear that discovery.vSphereFindObjects command is wrong since null is returned for vc_passExp .


      I have tested the same approach successfully using the command used in the TKU:


      discovery.vSphereFindObjects(host, "HostSystem", ["hardware.systemInfo.uuid"]);


      however the PropertyPath for this value is Property Path: hardware.systemInfo doesn't have the "setting" prefix as it does for Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]


      How can I discovery the value in Property Path: setting["VirtualCenter.VimPasswordExpirationInDays"]  ??