How to view ip address from command line ESXI


Find ID Virtual Machine:

~ # vim-cmd vmsvc/getallvms

Vmid      Name                         File                         Guest OS       Version                                                                                                        Annotation                 
10     Virtual_Lab   [storage216] Virtual_Lab/drv_va.vmx        otherLinuxGuest    vmx-04  

 
If virtual machine is power on:

~ # vim-cmd vmsvc/get.summary 10 | egrep ‘(power|ip)’
      powerState = “poweredOn”,
      ipAddress = “x.x.x.x”,

If virtual machine is power off:

~ # vim-cmd vmsvc/get.summary 10 | egrep ‘(power|ip)’
      powerState = “poweredOff”,
      ipAddress = ,
Power on the virtual machine:

~ # vim-cmd vmsvc/power.on 10

reuse the command :
 vim-cmd vmsvc/get.summary 10 | egrep ‘(power|ip)’


How to view ip address from command line ESXI