VMware vSphere

 View Only
  • 1.  esxcli list all vms

    Posted Jan 23, 2020 05:07 AM

    Hello everyone!

    Is there a way to list all VMs (including powered off) directly from the host via ssh? Like "vim-cmd vmsvc/getallvms" or "esxcli vm process list" but for every vm on the host? I know about PowerCLI and its get-vm commandlet but It would be better for me to fetch vms right from the host. Thank you in advance!



  • 2.  RE: esxcli list all vms
    Best Answer

    Posted Jan 23, 2020 07:44 AM

    Hello,

    are you sure "vim-cmd vmsvc/getallvms" isn't what your looking for? On hosts with local storage it's my quick and dirty way to list all vms on the host (running & powered off). I never used it on cluster hosts with shared storage, but I tried it just a moment ago and it gave me all the vms registered on that host including the powered off ones.



  • 3.  RE: esxcli list all vms

    Posted Jan 23, 2020 08:19 AM

    The command "vim-cmd vmsvc/getallvms" is exactly what I need, just ran it on other host and it worked fine. Looks like some local issue with the host. Thank you!