Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231085

Re: get-view -- how do I retrieve whether a VM is part of a vApp and if so what is it name and how to I retrieve the name of the ESXi host it is on?

$
0
0

When trying to find VMs created by vCloud Director, and the vApps that contain those VMs, it won't be quite as straight forward.

 

For example, you could do this:

 

get-vm | foreach-object {

    if ($_.Folder -ne $null) {

        Write-Host $_.Name $_.Folder $_.VMHost

    }

}

 

As the vCloud vApps are basically folders if you look at vCenter from the vSphere client.  This is kind of an ugly answer though, as this will return VMs outside of vCloud Director vApps (aka, "Discovered virtual machine" VMs will be displayed there too.)

 

Alternatively, you could do this (after you connect to your vCloud Director with the connect-ciserver cmdlet):

 

get-civapp | get-civm


However, I don't see an easy way to get the host those VMs reside on.

 

So you may be able to do some work on gathering the list of VMs using the Get-VM command, strip out the UUID (the part inside the brackets after the VM name), then use that in the "Get-CIVapp | Get-CIVM" command to get the proper vCloud vApp.  I am sure there is probably an easier way though, I just don't readily see it.


Viewing all articles
Browse latest Browse all 231085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>