How can I list all virtual appliances in my environment (if i can)?
Open powercli (recommend 5.5 with powershell 3 )
Connect to your VI Servers
Connect VI-Server -Server "your VC name " -User "your useraname" -AllLinked
Get-VApp | select Name, Status, Parent | Export-csv C:\vapplist.cvs
OK but that doesn't give me virtual appliances such as vcenter orchestrator which are deployed as an appliance but don't have a vapp container. It does give me vapps but I need to see all the vms that are deployed as appliances such as orchestrator. Is that possible?
It looks like the get-vapp cmdlet only gets virtual appliances that have a vapp container. If you have an individual VM that is deployed as a virtual appliance such as the orchestrator appliance, it won't get returned using the get-vapp cmdlet. Is there any other way to get all the virtual appliances in the environment?
Thanks!
I don't think it really answers your question, but you can add custom attributes to the VMs. So ,you could manually go through and for each appliance, add a custom attribute and value. Then, as you add appliances, make sure that field is updated. Then you can run reports with Get-CustomAttribute in PowerCLI.
Thanks for the input. That's a good idea in the long run. In the current scenario it wouldn't help me because I don't have the labeled yet and I don't know where they are. Anyone else with suggestions?
anyone with an idea on how to do this? Is there some way to identify an operating system which is installed as a virtual appliance, packaged with the virtual hardware, as opposed to one which is installed on virtual hardware, so that only appliances like orchestrator are returned in the results of a "get-vm" ? get-vapp does not return orchestrator instances, even though they are appliances, because they not packged in a vapp container
I checked and found this is the only difference between deployed appliance VM and manually installed/created VM, Generally whenever you deploy appliance you will find under vm settings, vApp options is enabled and some appliance related information are there (Some appliances are exceptional you might find them vapps option disabled, also the possibility that you might have enabled on normal VMs)
This below command will fetch where vApps options is enabled. (If anyone knows any other difference between deployed appliance and general VM, please let us know)
Get-View -viewtype virtualmachine -Filter @{'config.VAppConfig'='VMware.Vim.VmConfigInfo'} | select name
I'm afraid that is the same as the Get-vApp cmdlet, it works, but not if the appliance was not in a vApp container.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm noticing a similarity between the virtual appliances deployed in a vapp container and vco which is not deployed in a vapp container. All of these have three fields in the summary tab of the VM, which don't appear on any other VMs.
They are:
Product:
Version:
Vendor:
How can I run a "get-vm" that looks for vms which contain "product, version and vendor" fields in the summary tab or is that possible? And does that actually distinctly select virtual appliance vms whether in a vapp or out?
This information is only available when vApps option is enabled in the VM settings and product information exists.
Get-View -viewtype virtualmachine -Filter @{'config.VAppConfig'='VMware.Vim.VmConfigInfo'} | select Name, @{N="Appliance Name"; E={$_.config.VAppConfig.product.name}}, @{N="Vendor"; E={$_.config.VAppConfig.product.Vendor}}, @{N="Version"; E={$_.config.VAppConfig.product.Version}}
This is definitely getting warmer. It does seem to be giving me a list of all my appliances, even those that are not part of a vapp container. However, it is also listing 5 or so Windows VMs, and I didn't think Windows VMs could be virtual appliances?
As i said earlier,
(Some appliances are exceptional you might find them vApps option disabled, also the possibility that you might have enabled on normal VMs)
Try disabling vapp option on the windows server and then check.
ok thanks. What is the impact on a running virtual machine, if any, of disabling the vapps option? Is there any legitimate reason for it to be enabled on a Windows VM? Do I know for sure this won't impact the running VM? Do I need to or should I power off the affected vms before doing this?
I have checked this and didn't find any issue.