<?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>article Retrieve and relate VM information from vCD and multiple vCenters in VMware PowerCLI Documents</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Retrieve-and-relate-VM-information-from-vCD-and-multiple/ta-p/2786565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In &lt;A href="http://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-1-overview.html"&gt;this article&lt;/A&gt;, we can see an overview of how to uniquely identify a virtual machine in both a vSphere vCenter (VC) and vCloud Director (vCD) environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script will help relate the virtual machine information between vCD and VC environments.&amp;nbsp; For this to work correctly you will need to connect to the vCD server and then each VC listed in the resources section as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG height="360px;" id="internal-source-marker_0.8339177562849595" src="https://lh6.googleusercontent.com/xNX6SJcgtYnZY-4GCb-k_Ax3__xRkXnuWfm7o2tiC3DSE-yvHIXg-jHuOg-3vc_QrPK9JAH9fASO7GK_AQkHywK0zApIdMy0YdflQBXdKgDeGyO9S-k" width="415px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Connect-VIServer -Server ("eastcoast-vcenter", "westcoast-vcenter") -User Administrator -Password "Pa$$w0rd"&lt;BR /&gt;Connect-CIServer -Server MyvCDInstance -User Administrator -Password "Pa$$w0rd"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($VM in Get-CIVM) { &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $VM | Select Name,`&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VM MoRef";E={$VM.ExtensionData.VCloudExtension[0].Any[0].VmVimObjectRef.MoRef}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VM InstanceUUID";E={((Get-View "VirtualMachine-$($VM.ExtensionData.VCloudExtension[0].Any[0].VmVimObjectRef.MoRef)") | Where {$_.Name -match (($VM.Id).trim("urn:vcloud:vm:")) }).Config.InstanceUuid}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="vCenter Name";E={$VM.Extensiondata.vCloudExtension[0].Any[0].VmVimObjectRef.VimServerRef.name}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="vCenter InstanceUUID";E={((Get-CIView -Id $VM.Extensiondata.vCloudExtension[0].Any[0].VmVimObjectRef.VimServerRef.href).Uuid)}}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output will be similar to the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MyVM1&lt;BR /&gt;VM MoRef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : vm-14&lt;BR /&gt;VM InstanceUUID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 501b8bde-95da-472a-4d2d-9d97ea394bbc&lt;BR /&gt;vCenter Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : westcoast-vcenter&lt;BR /&gt;vCenter InstanceUUID : 9B6C7A60-C60F-4C1D-A607-0A0CFA2C2D5A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MyVM2&lt;BR /&gt;VM MoRef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : vm-14&lt;BR /&gt;VM InstanceUUID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 502fb1ca-e9b8-82ae-3f9f-4a3ba85f081d&lt;BR /&gt;vCenter Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : eastcoast-vcenter&lt;BR /&gt;vCenter InstanceUUID : 63D30391-44E2-447E-A709-9DD1241C3DCC&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Feb 2012 10:43:02 GMT</pubDate>
    <dc:creator>alanrenouf</dc:creator>
    <dc:date>2012-02-22T10:43:02Z</dc:date>
    <item>
      <title>Retrieve and relate VM information from vCD and multiple vCenters</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Retrieve-and-relate-VM-information-from-vCD-and-multiple/ta-p/2786565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In &lt;A href="http://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-1-overview.html"&gt;this article&lt;/A&gt;, we can see an overview of how to uniquely identify a virtual machine in both a vSphere vCenter (VC) and vCloud Director (vCD) environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script will help relate the virtual machine information between vCD and VC environments.&amp;nbsp; For this to work correctly you will need to connect to the vCD server and then each VC listed in the resources section as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG height="360px;" id="internal-source-marker_0.8339177562849595" src="https://lh6.googleusercontent.com/xNX6SJcgtYnZY-4GCb-k_Ax3__xRkXnuWfm7o2tiC3DSE-yvHIXg-jHuOg-3vc_QrPK9JAH9fASO7GK_AQkHywK0zApIdMy0YdflQBXdKgDeGyO9S-k" width="415px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Connect-VIServer -Server ("eastcoast-vcenter", "westcoast-vcenter") -User Administrator -Password "Pa$$w0rd"&lt;BR /&gt;Connect-CIServer -Server MyvCDInstance -User Administrator -Password "Pa$$w0rd"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Foreach ($VM in Get-CIVM) { &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $VM | Select Name,`&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VM MoRef";E={$VM.ExtensionData.VCloudExtension[0].Any[0].VmVimObjectRef.MoRef}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="VM InstanceUUID";E={((Get-View "VirtualMachine-$($VM.ExtensionData.VCloudExtension[0].Any[0].VmVimObjectRef.MoRef)") | Where {$_.Name -match (($VM.Id).trim("urn:vcloud:vm:")) }).Config.InstanceUuid}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="vCenter Name";E={$VM.Extensiondata.vCloudExtension[0].Any[0].VmVimObjectRef.VimServerRef.name}}, `&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @{N="vCenter InstanceUUID";E={((Get-CIView -Id $VM.Extensiondata.vCloudExtension[0].Any[0].VmVimObjectRef.VimServerRef.href).Uuid)}}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output will be similar to the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MyVM1&lt;BR /&gt;VM MoRef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : vm-14&lt;BR /&gt;VM InstanceUUID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 501b8bde-95da-472a-4d2d-9d97ea394bbc&lt;BR /&gt;vCenter Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : westcoast-vcenter&lt;BR /&gt;vCenter InstanceUUID : 9B6C7A60-C60F-4C1D-A607-0A0CFA2C2D5A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MyVM2&lt;BR /&gt;VM MoRef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : vm-14&lt;BR /&gt;VM InstanceUUID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 502fb1ca-e9b8-82ae-3f9f-4a3ba85f081d&lt;BR /&gt;vCenter Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : eastcoast-vcenter&lt;BR /&gt;vCenter InstanceUUID : 63D30391-44E2-447E-A709-9DD1241C3DCC&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 10:43:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Retrieve-and-relate-VM-information-from-vCD-and-multiple/ta-p/2786565</guid>
      <dc:creator>alanrenouf</dc:creator>
      <dc:date>2012-02-22T10:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve and relate VM information from vCD and multiple vCenters</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Retrieve-and-relate-VM-information-from-vCD-and-multiple/tac-p/2786566#M185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a tad confused with the "vCenter InstanceUUID" output, Is this suppose to be the "vCenterId" vCloud (5.1) uses to identify the correct vCenter??&amp;nbsp; If yes then then i'm getting the incorrect UUID from this script. vCloud reports that the vCenterId is the "href" id not the UUID used in this script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using powerGUI I see the VimServerRef.href = &lt;A href="https://xxx.xxx.xxx.xx/api/admin/extension/vimServer/54f51ab8-a60d-4fe8-98b0-40325a925684"&gt;https://xxx.xxx.xxx.xx/api/admin/extension/vimServer/54f51ab8-a60d-4fe8-98b0-40325a925684&lt;/A&gt;, this script produces "vCenter InstanceUUID : F7CABC8B-F1EF-424C-B022-72D66D612636" as the vCenter ID. in the vCloud logs vCloud identifies the vCenter ID as "54F51AB8A60D4FE898B040325A925684" which is "href".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to verify this because we are getting errors from vCloud when we deploy VM's or Vapps saying that it can't find a VM moref with vCenterID that = "54f51ab8-a60d-4fe8-98b0-40325a925684". Yet we do find the correct MOREF on that vCenter. Note we only connect to the one vCenter server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jan 2014 23:12:51 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Retrieve-and-relate-VM-information-from-vCD-and-multiple/tac-p/2786566#M185</guid>
      <dc:creator>rgoodworth</dc:creator>
      <dc:date>2014-01-05T23:12:51Z</dc:date>
    </item>
  </channel>
</rss>

