Operating System - VMware
1748271 Members
4104 Online
108760 Solutions
New Discussion юеВ

Re: vmware cmd to list VM-NAME, VM-IP and VLANID

 
SOLVED
Go to solution
Basheer_2
Trusted Contributor

vmware cmd to list VM-NAME, VM-IP and VLANID

Hello,
esxcfg-nics -l -> list the Phy NICS
vmware-cmd -l -> lists the VMS

Is there way to find out (vmware commands)
VM-Name
IP assigned to that VM
VLANID assigned to that VM

Thanks
4 REPLIES 4
muruganantham raju
Valued Contributor

Re: vmware cmd to list VM-NAME, VM-IP and VLANID

Basheer,
Is Glance Plus or Performance Agent installed in your VMWare hosts? If yes, then use BYLS class of metrics to get all the data you are looking for.

Regards,
Muru
Markus M.
Trusted Contributor

Re: vmware cmd to list VM-NAME, VM-IP and VLANID

Hi,
try with the powershell and powercli the following, when connected to your vcenter server:

$vms=@(Get-VM)

foreach ($vm IN $vms) {echo $vm; get-vmguest -vm $vm}

kr
Markus
Uwe Zessin
Honored Contributor

Re: vmware cmd to list VM-NAME, VM-IP and VLANID

IP addresses are usually defined within the operating system. A single VM can have multiple virtual NICs with multiple IP addresses on each vNIC.


VLAN IDs are usually not assigned to an individual VM. You create a virtual switch and then a portgroup on that switch. It is the portgroup that gets assigned a VLAN ID.
Next you attach a VM's vNIC to that portgroup.
That is called VST - Virtual Switch Tagging.

Another way is to assign the VLAN ID 4095 to a port group. Then the NIC driver of the operating system must be VLAN-capable, but the control is through the guest's operating system, not via ESX.
That is called VGT - Virtual Guest Tagging.
.
Jags_21
HPE Pro
Solution

Re: vmware cmd to list VM-NAME, VM-IP and VLANID

Hi Basheer,

yes you get the details from the service console cli itself by running below commands

#vmware-vim-cmd vmsvc/getallvms
(the aboe commnd gives the information on all the vm's registered and running the first row displays the vmid make a note of it and run the next command)

#vmware-vim-cmd vmsvc/get.config vmid

this should answer your query

regards,
Jagadish
PS do not forget to assign points
Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise.
I work for HPE

Accept or Kudo