<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Find vCenter VM by instanceUUID in VMware Aria Automation Tools Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/Find-vCenter-VM-by-instanceUUID/m-p/2908940#M24314</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;A vRA VM is linked with a vCenter VM by the "instanceUUID". For Example if you like to change something on the VM in the "Compute post provision" State you can extract the UUID from:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;inputProperties.customProperties.instanceUUID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and use this Code to get vCenter VM:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Input:&amp;nbsp;InstanceUuid&lt;/DIV&gt;&lt;DIV&gt;Input Type: String&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Return Type:&amp;nbsp;VC:VirtualMachine&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var vc_uuid = InstanceUuid

var vm2return = null
var arr_results = []

for each (vcenter in VcPlugin.allSdkConnections) {

	var results = vcenter.searchIndex.findAllByUuid(null,vc_uuid,true,true)

    for each (item in results) {

        arr_results.push(item)

    }
	
}

if (arr_results.length = 1) {
    
    vm2return = arr_results[0]

} else if (arr_results.length &amp;gt; 1) {

    System.log("Duplicated Instance UUID found!")

} else {

    System.log("Nothing found...")

}

return vm2return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2022 13:57:43 GMT</pubDate>
    <dc:creator>rwk1982</dc:creator>
    <dc:date>2022-05-13T13:57:43Z</dc:date>
    <item>
      <title>Find vCenter VM by instanceUUID</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/Find-vCenter-VM-by-instanceUUID/m-p/2908940#M24314</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;A vRA VM is linked with a vCenter VM by the "instanceUUID". For Example if you like to change something on the VM in the "Compute post provision" State you can extract the UUID from:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;inputProperties.customProperties.instanceUUID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and use this Code to get vCenter VM:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Input:&amp;nbsp;InstanceUuid&lt;/DIV&gt;&lt;DIV&gt;Input Type: String&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Return Type:&amp;nbsp;VC:VirtualMachine&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var vc_uuid = InstanceUuid

var vm2return = null
var arr_results = []

for each (vcenter in VcPlugin.allSdkConnections) {

	var results = vcenter.searchIndex.findAllByUuid(null,vc_uuid,true,true)

    for each (item in results) {

        arr_results.push(item)

    }
	
}

if (arr_results.length = 1) {
    
    vm2return = arr_results[0]

} else if (arr_results.length &amp;gt; 1) {

    System.log("Duplicated Instance UUID found!")

} else {

    System.log("Nothing found...")

}

return vm2return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 13:57:43 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/Find-vCenter-VM-by-instanceUUID/m-p/2908940#M24314</guid>
      <dc:creator>rwk1982</dc:creator>
      <dc:date>2022-05-13T13:57:43Z</dc:date>
    </item>
  </channel>
</rss>

