Tuesday, March 14, 2017

command line interface - Can you list virtual hardware of a guest via the CLI in ESXi 5.0?




Can any one tell me of an ESXi line command that can be used to list the different virtual hardware components assigned to VMWare guests running on ESXi, with vcenter?



E.g. I want to find out how many of our guests are running with the e1000 network adaptor or how many have 2 sockets and 2 cores.



I'd like to do this in ESXi/vSphere not in the guest OS.


Answer



In PowerCLI, the number of CPUs is accessible directly as a property of the VirtualMachine object returned by Get-VM, but in v5.0, the other virtual hardware objects have their own cmdlets, e.g. Get-HardDisk, Get-NetworkAdapter. So you'd have to do something like:



    Get-VM | ForEach-Object {$nic = Get-NetworkAdapter -VM $_; Write-Host "$_.Name $nic.Type"}


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...