ESX/vim-cmd

From Omnia
< ESX
Revision as of 15:54, 26 September 2014 by Kenneth (talk | contribs) (→‎General Interesting Points)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

vim-cmd

ESXi SSH Command Line

ESXi 4 Console - Secret Commands for Emergency Maintenance

The command 'vim-cmd' has several extensions:

vim-cmd help

Get VIM by Name

VMID=`vim-cmd vmsvc/getallvms | grep "[NAME]" | awk '{print $1'}`
VMID=`vim-cmd vmsvc/getallvms | grep "[0-9]*[ ]*MY_VM_NAME" | awk '{print $1'}`  # more exact

Revert a set of VMs

if true ; then
  VMLIST="vum51a vum-esxi51 vum-esxi50 vum-esxi41 vum-esx41"
  for VM in $VMLIST ; do
    VMID=`vim-cmd vmsvc/getallvms | grep "[0-9]*[ ]*${VM}" | awk '{print $1'}`
    echo "Powering off $VM..."
    vim-cmd vmsvc/power.off $VMID
    SNAPID=`vim-cmd vmsvc/snapshot.get $VMID | grep "Snapshot Id" | tail -n 1 | awk '{print $4}`
    echo "Reverting $VM snapshot $SNAPID..."
    vim-cmd vmsvc/snapshot.revert $VMID $SNAPID false
  done
  for VM in $VMLIST ; do
    VMID=`vim-cmd vmsvc/getallvms | grep "[0-9]*[ ]*${VM}" | awk '{print $1'}`
    echo "Powering on $VM..."
    vim-cmd vmsvc/power.on $VMID
  done
fi

VM Power management

To see a full list of all the commands available just type vim-cmd vmsvc without any extension

vim-cmd vmsvc

To show VM power state: (Get Vmid from getallvms)

vim-cmd vmsvc/power.getstate [vmid]
  Retrieved runtime info
  Powered off
  Powered on
  Suspended

Save VMIDs to file:

vim-cmd vmsvc/getallvms > vmid.txt

Show running state of all VMs: (very slow)

for i in $( vim-cmd vmsvc/getallvms | grep -v "^Vmid" | awk '{print $1}' ) ; do echo -en "\n$i: " ; vim-cmd vmsvc/power.getstate $i ; done
# better output
vim-cmd vmsvc/getallvms > vmid.txt
for i in $( cat vmid.txt | grep -v "^Vmid" | awk '{print $1 "-" $2}' ) ; do
  vmid=$(echo $i | cut -f 1 -d '-') ; vmname=$(echo $i | cut -f 2- -d '-') ; echo -en "\n$vmid ($vmname): " ;
  vim-cmd vmsvc/power.getstate $vmid | grep -v "Retrieved" ; done

Power on / off all VMs:

for i in $( vim-cmd vmsvc/getallvms | grep -v "^Vmid" | awk '{print $1}' ) ; do echo -en "\n$i: " ; vim-cmd vmsvc/power.on $i ; done
for i in $( vim-cmd vmsvc/getallvms | grep -v "^Vmid" | awk '{print $1}' ) ; do echo -en "\n$i: " ; vim-cmd vmsvc/power.off $i ; done

Power Manage VM Level: (forced)

vim-cmd vmsvc/power.on [vmid]
vim-cmd vmsvc/power.off [vmid]
vim-cmd vmsvc/power.reset [vmid]
vim-cmd vmsvc/power.suspend [vmid]

Power Manage Guest OS Level:

vim-cmd vmsvc/power.shutdown [vmid]
vim-cmd vmsvc/power.reboot [vmid]
vim-cmd vmsvc/power.hibernate [vmid]

Output:

power.on:
  Powering on VM:
power.off:
  Powering off VM:
power.reset:
 Reset VM:
power.suspend:
 Suspending VM:
power.shutdown, power.reboot, power.hibernate: do not output any response

Commands:

  • vmsvc/power.getstate - Retrieves the power state of the specified virtual machine.
  • vmsvc/power.hibernate - Cause guest to go into standby/hibernate and suspend.
  • vmsvc/power.off - Power off the specified virtual machine.
  • vmsvc/power.on - Power on the specified virtual machine.
  • vmsvc/power.reboot - Reboot the guest OS if tools is running.
  • vmsvc/power.reset - Reset the specified virtual machine.
  • vmsvc/power.shutdown - Shutdown the guest OS
  • vmsvc/power.suspend - Suspend the specified virtual machine.

Guest State

Show running VMs with Guest Tools state and count

vim-cmd vmsvc/getallvms > vmid.txt ; \
COUNT=0 ; \
FAILCOUNT=0 ; \
echo ; \
for i in $( cat vmid.txt | grep -v "^Vmid" | awk '{print $1 "-" $2}' ) ; do
  vmid=$(echo $i | cut -f 1 -d '-') ; vmname=$(echo $i | cut -f 2- -d '-') ; echo -n "$vmid ($vmname): " ;
  COUNT=$(( $COUNT + 1))
  vim-cmd vmsvc/get.summary $vmid | grep "toolsOk" > /dev/null
  if [ $? -eq 0 ] ; then echo "OK" ; else echo "FAIL" ; FAILCOUNT=$(( $FAILCOUNT + 1 )) ; fi
done ; OKCOUNT=$(( $COUNT - $FAILCOUNT )) ; echo ; echo "$COUNT VM: $OKCOUNT ok, $FAILCOUNT failed"

Show running VMs with Guest Tools state and count (ignore powered off VMs)

vim-cmd vmsvc/getallvms > vmid.txt ; \
COUNT=0 ; \
FAILCOUNT=0 ; \
echo ; \
for i in $( cat vmid.txt | grep -v "^Vmid" | awk '{print $1 "-" $2}' ) ; do
  vmid=$(echo $i | cut -f 1 -d '-') ; vmname=$(echo $i | cut -f 2- -d '-') ; echo -n "$vmid ($vmname): " ;
  vim-cmd vmsvc/get.summary $vmid | grep 'powerState = "poweredOn"' > /dev/null
  if [ $? -eq 0 ] ; then
    COUNT=$(( $COUNT + 1))
    vim-cmd vmsvc/get.summary $vmid | grep "guestToolsRunning" > /dev/null
    if [ $? -eq 0 ] ; then echo "OK" ; else echo "FAIL" ; FAILCOUNT=$(( $FAILCOUNT + 1 )) ; fi
  else
    echo "OFF"
  fi
done ; OKCOUNT=$(( $COUNT - $FAILCOUNT )) ; echo ; echo "$COUNT VM: $OKCOUNT ok, $FAILCOUNT failed"

Get vmid's:

vim-cmd vmsvc/getallvms

Get VM summary:

vim-cmd vmsvc/get.summary [VMID]

Power states:

      powerState = "poweredOn",
      powerState = "poweredOff",
      powerState = "suspended",

Question states:

      question = (vim.vm.QuestionInfo) null,
?

Guest IP Address

NOTE: This only works if the Guest Tools are installed and running

vim-cmd vmsvc/get.summary [vmId] | grep ipAddress

Guest Tools Status

Guest Tools OK:

   guest = (vim.vm.Summary.GuestSummary) {
      dynamicType = <unset>,
      guestId = "windows7Guest",
      guestFullName = "Microsoft Windows 7 (32-bit)",
      toolsStatus = "toolsOk",
      toolsVersionStatus = "guestToolsCurrent",
      toolsVersionStatus2 = "guestToolsCurrent",
      toolsRunningStatus = "guestToolsRunning",
      hostName = "golden",
      ipAddress = "10.50.23.104",
   },

No Guest Tools:

   guest = (vim.vm.Summary.GuestSummary) {
      dynamicType = <unset>,
      guestId = <unset>,
      guestFullName = <unset>,
      toolsStatus = "toolsNotInstalled",
      toolsVersionStatus = "guestToolsNotInstalled",
      toolsRunningStatus = "guestToolsNotRunning",
      hostName = <unset>,
      ipAddress = <unset>,
   },

Guest Tools stopped:

   guest = (vim.vm.Summary.GuestSummary) {
      dynamicType = <unset>,
      guestId = <unset>,
      guestFullName = <unset>,
      toolsStatus = "toolsNotRunning",
      toolsVersionStatus = "guestToolsCurrent",
      toolsVersionStatus2 = "guestToolsCurrent",
      toolsRunningStatus = "guestToolsNotRunning",
      hostName = <unset>,
      ipAddress = <unset>,
   },

Outdated Guest Tools on running system:

   guest = (vim.vm.Summary.GuestSummary) {
      dynamicType = <unset>,
      guestId = "rhel6_64Guest",
      guestFullName = "Red Hat Enterprise Linux 6 (64-bit)",
      toolsStatus = "toolsOld",
      toolsVersionStatus = "guestToolsNeedUpgrade",
      toolsVersionStatus2 = "guestToolsSupportedOld",
      toolsRunningStatus = "guestToolsRunning",
      hostName = "golden",
      ipAddress = "10.10.10.10",
   },

Guest Tools outdated on powered off system:

   guest = (vim.vm.Summary.GuestSummary) {
      dynamicType = <unset>,
      guestId = <unset>,
      guestFullName = <unset>,
      toolsStatus = "toolsNotRunning",
      toolsVersionStatus = "guestToolsNeedUpgrade",
      toolsVersionStatus2 = "guestToolsSupportedOld",
      toolsRunningStatus = "guestToolsNotRunning",
      hostName = <unset>,
      ipAddress = <unset>,
   },

VM Answer

Power On will freeze if there is a question waiting for the user. In a separate thread run the following to answer:

Usage: message vmid [messageId] [messageChoice]
Replies to the current pending question on the vm.

To List questions waiting on user:

vim-cmd vmsvc/message [vmid]

To answer question: (0 being the top question)

Example: vim-cmd vmsvc/message [vmid] 0 1    # answer 'I moved it' to moving question top question
In order to configure certain management and networking features, VMware ESX needs to know if this virtual machine was moved or copied.

If you don't know, answer "I copied it".


   0. Cancel (Cancel)
   1. I moved it (I moved it)
   2. I copied it (I copied it) [default]

An alternative:

VM Registration

List all VMs:

vim-cmd vmsvc/getallvms

Unregister a VM:

vim-cmd vmsvc/unregister [VMID]

Unregister and remove VM files:

vim-cmd vmsvc/destroy [VMID]

Reload VM config from file:

vim-cmd vmsvc/reload [VMID]

Register a VM:

vim-cmd solo/registervm [VMX_PATH] [NAME(optional)]

Remove all VMs:

VM_LIST=$(vim-cmd vmsvc/getallvms 2>&1 | grep -v Vmid | awk '{print $1}' | grep -v '[a-xA-Z]')
for VM in $VM_LIST ; do echo "Removing: $VM" ; vim-cmd vmsvc/unregister $VM ; done

List and remove all invalid VMs: (aka corrupted broken skipped skipping illegal)

# Skipping invalid VM '928'
vim-cmd vmsvc/getallvms 2>&1 | grep -i Skipping

INVALID_LIST=$(vim-cmd vmsvc/getallvms 2>&1| grep -i Skipping | cut -f 2 -d "'")
for VM in $INVALID_LIST ; do echo "Removing: $VM" ; vim-cmd vmsvc/unregister $VM ; done

To rename a VM:

  1. Find VMID (vim-cmd vmsvc/getallvms)
  2. Unregister VM (vim-cmd vmsvc/unregister VMID)
  3. Modify VMX displayName
  4. Register modified (vim-cmd solo/registervm VMXPATH)

Alternate method to rename a VM:

  1. Find VMID (vim-cmd vmsvc/getallvms)
  2. Powerdown VM (vim-cmd vmsvc/power.off VMID)
  3. Modify VMX displayName
  4. Reload VM config (vim-cmd vmsvc/reload VMID)

Using vim-cmd to remove VMs from an ESXi host connected to a vCenter Server will result in orphaned VMs:

Maintenance Mode

Enter maintenance mode:

vim-cmd hostsvc/maintenance_mode_enter

Exit maintenance mode:

vim-cmd hostsvc/maintenance_mode_exit

Check status:

vim-cmd hostsvc/hostsummary | grep -i maintenancemode
  inMaintenanceMode = true,
  inMaintenanceMode = false,

Network

Network: (too much info)

vim-cmd hostsvc/net/config
vim-cmd hostsvc/net/route_info
vim-cmd hostsvc/net/vnic_info
vim-cmd hostsvc/net/vswitch_info

Storage

List HBAs:

vim-cmd hostsvc/summary/hba

List LUNs:

vim-cmd hostsvc/summary/scsilun

List file systems:

vim-cmd hostsvc/summary/fsvolume

List datastores:

vim-cmd hostsvc/datastore/listsummary

Remove datastore:

vim-cmd hostsvc/datastore/remove

List VMs on datastore:

vim-cmd hostsvc/datastore/listvm [datastore]


vim-cmd hostsvc/datastore/listvm [datastore]

Usage: listvm name
Retrieve the virtual machines stored on the datastore.

vim-cmd hostsvc/datastore/destroy [datastore]

Usage: destroy name
Destroy a datastore.

vim-cmd hostsvc/datastore/remove [datastore]

Usage: remove name
Remove a datastore.

vim-cmd hostsvc/datastore/rename

Usage: rename name newname
Rename a datastore.

vim-cmd hostsvc/datastore/localds_create

Usage: localds_create name localPath
Add a local datastore.

vim-cmd hostsvc/datastore/vmfs_create

Usage: vmfs_create [OPTIONS] name devId volumeName blockSizeMb majorVersion head
Add a VMFS datastore.
Example: (fdisk drive with vmfs type 'fb')
Exmaple: vim-cmd hostsvc/datastore/vmfs_create --typeid=vmfs fio0 /vmfs/devices/disks/mpx.vmhba1:C0:T0:L0:1 ffio0 4M 3 255
Example: haven't gotten this to work, use 'vmkfstools -C vmfs3 -b 4M [FILE] -G [LABEL]'

Snapshots

vim-cmd vmsvc/snapshot.create
  Usage: snapshot.create vmid [snapshotName] [snapshotDescription] [includeMemory] [quiesced]
  Creates a snapshot for the vm.
  Example: vim-cmd vmsvc/snapshot.create [vmid] mysnapshot mysnapshot true
vim-cmd vmsvc/snapshot.dumpoption
  Usage: snapshot.dumpoption showconfig
  Set the snapshot dump option.
vim-cmd vmsvc/snapshot.get
  Usage: snapshot.get vmid
  gets the snapshot info for the vm.
  Example: vim-cmd vmsvc/snapshot.get [vmid]
vim-cmd vmsvc/snapshot.remove
  Usage: snapshot.remove vmid [removeChildren] [snapshotLevel] [snapshotIndex]
  Remove a snapshot on the vm.
vim-cmd vmsvc/snapshot.removeall
  Usage: snapshot.removeall vmid
  Removes all the snapshots on the vm.
vim-cmd vmsvc/snapshot.revert
  Usage: snapshot.revert vmid suppressPowerOff [snapshotLevel] [snapshotIndex]
  Revert to a snapshot on the vm.
  Example: vim-cmd vmsvc/snapshot.revert [vmid] suppressPowerOff mysnapshot
  Example: vim-cmd vmsvc/snapshot.revert 144 0 0 
vim-cmd vmsvc/snapshot.setoption
  Usage: snapshot.setoption [OPTIONS] vmid
  Config snapshot behavior on the vm.
  Options:
     --locked=bool
         Whether to lock the snapshot
     --disabled=bool
         whether to disable snapshot
     --action=string
         The snapshot power-off behavior

ESX Host

System Make

System Make: (see also esxcfg-info)

vim-cmd hostsvc/hostsummary | grep -B 1 model
     vendor = "Dell Inc.",
     model = "PowerEdge R710",

System Memory

Memory capacity of server:

vim-cmd hostsvc/hostsummary | grep -i memorySize
  memorySize = 6431686656,
vim-cmd hostsvc/hosthardware | grep -i memorySize
  memorySize = 6431686656,
# in MB
echo $(( $(vim-cmd hostsvc/hostsummary | grep -i memorySize | awk '{print $3}' | cut -f 1 -d ,) / 1024 / 1024 ))


System CPU

vim-cmd hostsvc/hostsummary | grep -i cpu
      cpuModel = "Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz",
      cpuMhz = 2665,
      numCpuPkgs = 2,
      numCpuCores = 12,
      numCpuThreads = 24,
      ...

Note, this would equate to VI Client's equivalent:

  • Processor Sockets: 2 (numCpuPkgs)
  • Cores per Socket: 6 (numCpuCores / numCpuPkgs)
  • Logical Processors: 24 (numCpuThreads)
  • Hyperthreading: Active

General Interesting Points

Interesting points from hostsvc/hostsummary:

      vendor = "HP",
      model = "ProLiant DL380 G7",

      memorySize = 51525926912,

      cpuModel = "Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz",
      cpuMhz = 2260,
      numCpuPkgs = 2,
      numCpuCores = 12,
      numCpuThreads = 24,

      numNics = 4,

      name = "esxi41.oeey.com",

         fullName = "VMware ESXi 4.1.0 build-502767",

IP Address

IP Address: [1]

vim-cmd hostsvc/net/consolevnic_info | grep ipAddress  # ESX ONLY
    ipAddress = "10.50.3.183",
vim-cmd hostsvc/net/config | grep ipAddress
vim-cmd hostsvc/net/info | grep ipAddress
    ipAddress = "",
    ipAddress = "10.50.3.86",
    ipAddress = "10.50.3.183",
vim-cmd vmsvc/get.guest vmid |grep -m 1 "ipAddress = \""

Gateway:

vim-cmd hostsvc/net/route_info | grep defaultGateway | head -n 1
    defaultGateway = "10.50.3.1",

The best way is to: (ESX/ESXi)

esxcfg-vmknic -l | grep vmk0
  vmk0       VMkernel            IPv4      10.50.3.86
esxcfg-vmknic -l | grep vmk0 | cut -d '4' -f 2- | awk '{print $1}'
  10.50.3.86

BIOS

# vim-cmd hostsvc/hosthardware
   biosInfo = (vim.host.BIOSInfo) {
      dynamicType = <unset>,
      biosVersion = "-[G0E173VUS-1.73]-",
      releaseDate = "2012-01-20T00:00:00Z",
   },

License

Example of expired license

# vim-cmd vimsvc/license --show
[200] Sending request for installed licenses...[200] Complete, result is:
   serial: 00000-00000-00000-00000-00000
   vmodl key: eval
   name: Evaluation Mode
   total: 0
   used:  0
   unit: host
   Properties:
     [ProductName] = VMware ESX Server
     [ProductVersion] = 5.0
     [expirationHours] = 0
     [expirationMinutes] = 0
     [diagnostic] = Evaluation period has expired, please install license.
     [feature] = vsmp:32 ("Up to 32-way virtual SMP")
...
[200] End of report.

Example of "Free" non-automatable license:

FIXME

Check for license failure:

vim-cmd vimsvc/license --show | grep '\[diagnostic\]'

Assign license

# esx(i) 4.x
vim-cmd vimsvc/license --set "Q4426-2L3EK-J8A31-01124-99P31"
# esxi 5.x
vim-cmd vimsvc/license --set "0J43N-08250-H804T-0K0HM-093N1"

Uptime

vim-cmd hostsvc/hostsummary | grep bootTime

ESXi 4.x, 5.x:

      bootTime = "2012-09-28T17:41:13.254294Z",

ESX 4.x:

      bootTime = "2012-09-28T11:30:51.677015-06:00",

To convert to seconds epoch, you need to do a little massaging: (drop after ., change T to ' ')

# 2012-09-28 17:41:13
date -d "$date" +"%s"

VMDK

Add VMDK to VM:

vim-cmd vmsvc/device.diskaddexisting [VMID] /vmfs/volumes/benchmark/benchmark.vmdk 1 1

vim-cmd extensions

help - help hbrsvc/ - Replication Services - nothing of use hostsvc/ - Host Services internalsvc/ - Internal Services - nothing of use proxysvc/ - Proxy Services - nothing of use solo/ - Local ESX Services vimsvc/ - VI Services vmsvc/ - VM Services

help

Get help for a command:

vim-cmd help vimsvc/license

hbrsvc - Replication Services

WARNING: Nothing of use here!

Commands available under hbrsvc/:
vmreplica.abort                  vmreplica.pause
vmreplica.create                 vmreplica.queryReplicationState
vmreplica.disable                vmreplica.reconfig
vmreplica.diskDisable            vmreplica.resume
vmreplica.diskEnable             vmreplica.startOfflineInstance
vmreplica.enable                 vmreplica.stopOfflineInstance
vmreplica.getConfig              vmreplica.sync
vmreplica.getState

hostsvc - Host Services

Commands available under hostsvc/:
advopt/                   enable_ssh                refresh_services
autostartmanager/         firewall_disable_ruleset  reset_service
datastore/                firewall_enable_ruleset   runtimeinfo
datastorebrowser/         get_service_status        set_hostid
firmware/                 hostconfig                standby_mode_enter
net/                      hosthardware              standby_mode_exit
rsrc/                     hostsummary               start_esx_shell
storage/                  login                     start_service
summary/                  logout                    start_ssh
vmotion/                  maintenance_mode_enter    stop_esx_shell
connect                   maintenance_mode_exit     stop_service
cpuinfo                   pci_add                   stop_ssh
disable_esx_shell         pci_remove                task_list
disable_ssh               queryconnectioninfo       updateSSLThumbprintsInfo
disconnect                querydisabledmethods
enable_esx_shell          refresh_firewall

internalsvc - Internal Services

WARNING: Nothing of use here!

Commands available under internalsvc/:
perfcount/          host_mode_lock      refresh             set_log_level
vprobes/            login               refresh_consolenic  shutdown
access_address      loglist             refresh_datastores  throw_exception
cold_quit           logout              refresh_gateway     use_fds
connect             redirect_stderr     refresh_network
disconnect          redirect_stdout     refresh_pnic

=== proxysvc - Proxy Services ===

WARNING: Nothing of use here!

<pre>
Commands available under proxysvc/:
add_np_service   disconnect       port_info
add_tcp_service  login            remove_service
connect          logout           service_list

solo - Local Services

Commands available under solo/:
connect          environment      logout           querycfgoptdesc
disconnect       login            querycfgopt      registervm

Register a VM:

# vim-cmd solo/registervm [cfg path] [name(optional)] [resourcepool(optional)]

vimsvc - VI Services

Commands available under vimsvc/:
auth/             license           property_dump     task_info
connect           login             task_cancel       task_list
disconnect        logout            task_description
Commands available under vimsvc/auth/:
entity_permission_add     lockdown_mode_enter       role_permissions
entity_permission_remove  lockdown_mode_exit        role_remove
entity_permissions        permissions               roles
lockdown_is_enabled       privileges
lockdown_is_possible      role_add

Show license Info:

vim-cmd vimsvc/license --show

Show license key:

vim-cmd vimsvc/license --show | grep serial:
# example: serial: 0J43N-08250-H804T-0K0HM-093N1

Show if connected to vCenter Server: (not reliable, as a system removed from VC will still show this)

vim-cmd vimsvc/license --show | grep "\[sourceId\]"
# example: [sourceId] = vc

Show if connected to vCenter Server: (more reliable, but only works on ESXi 4.x and ESXi 5.x)

# lockdown mode is only available if connected to a vcenter server
vim-cmd vimsvc/auth/lockdown_is_possible
# example: "true" or "false"

To check if Lockdown mode is enabled: [2]

vim-cmd -U dcui vimsvc/auth/lockdown_is_enabled
# example: false

To disable Lockdown mode:

vim-cmd -U dcui vimsvc/auth/lockdown_mode_exit

To enable Lockdown mode:

vim-cmd -U dcui vimsvc/auth/lockdown_mode_enter

vmsvc - VM Services

Commands available under vmsvc/:
acquiremksticket                 get.snapshotinfo
acquireticket                    get.spaceNeededForConsolidation
connect                          get.summary
convert.toTemplate               get.tasklist
convert.toVm                     getallvms
createdummyvm                    gethostconstraints
destroy                          login
device.connection                logout
device.connusbdev                message
device.disconnusbdev             power.getstate
device.diskadd                   power.hibernate
device.diskaddexisting           power.off
device.diskremove                power.on
device.getdevices                power.reboot
device.toolsSyncSet              power.reset
device.vmiadd                    power.shutdown
device.vmiremove                 power.suspend
devices.createnic                power.suspendResume
disconnect                       queryftcompat
get.capability                   reload
get.config                       setscreenres
get.config.cpuidmask             snapshot.create
get.configoption                 snapshot.dumpoption
get.datastores                   snapshot.get
get.disabledmethods              snapshot.remove
get.environment                  snapshot.removeall
get.filelayout                   snapshot.revert
get.filelayoutex                 snapshot.setoption
get.guest                        tools.cancelinstall
get.guestheartbeatStatus         tools.install
get.managedentitystatus          tools.upgrade
get.networks                     unregister
get.runtime                      upgrade

To show VMs:

vim-cmd vmsvc/getallvms
# 129    vum51    [ds-c210m2-01-fio1] vum51/vum51.vmx           winNetStandard64Guest   vmx-07

All Commands

root:

help
hostsvc/
internalsvc/
proxysvc/
solo/
vimsvc/
vmsvc/

hostsvc:

hostsvc/advopt/options
hostsvc/advopt/settings
hostsvc/advopt/update
hostsvc/advopt/view
hostsvc/autostartmanager/autostart
hostsvc/autostartmanager/autostop
hostsvc/autostartmanager/enable_autostart
hostsvc/autostartmanager/get_autostartseq
hostsvc/autostartmanager/get_defaults
hostsvc/autostartmanager/update_autostartentry
hostsvc/autostartmanager/update_defaults
hostsvc/datastore/capabilities
hostsvc/datastore/destroy
hostsvc/datastore/info
hostsvc/datastore/listsummary
hostsvc/datastore/listvm
hostsvc/datastore/localds_create
hostsvc/datastore/nas_create
hostsvc/datastore/refresh
hostsvc/datastore/remove
hostsvc/datastore/rename
hostsvc/datastore/summary
hostsvc/datastore/vmfs_create
hostsvc/datastore/vmfs_extend
hostsvc/datastore/vmfs_queryAvailableDisks
hostsvc/datastore/vmfs_query_create_options
hostsvc/datastore/vmfs_query_extend_options
hostsvc/datastorebrowser/deleteFile
hostsvc/datastorebrowser/disksearch
hostsvc/datastorebrowser/list
hostsvc/datastorebrowser/search
hostsvc/datastorebrowser/searchsubfolders
hostsvc/firmware/backup_config
hostsvc/firmware/reset_config
hostsvc/firmware/restore_config
hostsvc/firmware/sync_config
hostsvc/net/mockup/clear
hostsvc/net/mockup/pnic_add
hostsvc/net/mockup/pnic_remove
hostsvc/net/mockup/pnic_setactuallinkspeed
hostsvc/net/provider/test_abort
hostsvc/net/capabilities
hostsvc/net/config
hostsvc/net/config_append
hostsvc/net/config_incremental_update
hostsvc/net/config_load
hostsvc/net/config_save
hostsvc/net/console_route_set
hostsvc/net/consolevnic_add
hostsvc/net/consolevnic_info
hostsvc/net/consolevnic_remove
hostsvc/net/consolevnic_set
hostsvc/net/consolevnic_setv6
hostsvc/net/dns_info
hostsvc/net/dns_set
hostsvc/net/dns_unset
hostsvc/net/dvs_info
hostsvc/net/info
hostsvc/net/offload_capabilities
hostsvc/net/pnic_info
hostsvc/net/pnic_setip
hostsvc/net/pnic_setlinkspeed
hostsvc/net/portgroup_add
hostsvc/net/portgroup_remove
hostsvc/net/portgroup_set
hostsvc/net/portgroup_unsetpolicy
hostsvc/net/query_networkhint
hostsvc/net/refresh
hostsvc/net/route_info
hostsvc/net/route_set
hostsvc/net/set_v6stack
hostsvc/net/toggle_raw
hostsvc/net/vnic_add
hostsvc/net/vnic_info
hostsvc/net/vnic_remove
hostsvc/net/vnic_set
hostsvc/net/vnic_setv6
hostsvc/net/vswitch_add
hostsvc/net/vswitch_info
hostsvc/net/vswitch_pnicinfo
hostsvc/net/vswitch_remove
hostsvc/net/vswitch_setautobridge
hostsvc/net/vswitch_setbondbridge
hostsvc/net/vswitch_setnumports
hostsvc/net/vswitch_setpolicy
hostsvc/net/vswitch_setsimplebridge
hostsvc/net/vswitch_unsetbridge
hostsvc/rsrc/create
hostsvc/rsrc/destroy
hostsvc/rsrc/destroy_children
hostsvc/rsrc/pool_config_get
hostsvc/rsrc/pool_config_set
hostsvc/rsrc/pool_runtime_get
hostsvc/rsrc/pools_get
hostsvc/rsrc/rename
hostsvc/rsrc/vm_config_get
hostsvc/rsrc/vm_config_set
hostsvc/rsrc/vms_get
hostsvc/storage/diagnostic/activate
hostsvc/storage/diagnostic/create
hostsvc/storage/diagnostic/deactivate
hostsvc/storage/diagnostic/get_active
hostsvc/storage/diagnostic/query_available
hostsvc/storage/diagnostic/query_create_desc
hostsvc/storage/diagnostic/query_create_option
hostsvc/storage/mockup/clear
hostsvc/storage/mockup/hostbusadapter_add
hostsvc/storage/mockup/hostbusadapter_remove
hostsvc/storage/mockup/multipath_path_activate
hostsvc/storage/mockup/scsidisk_add
hostsvc/storage/mockup/scsidisk_remove
hostsvc/storage/mockup/scsilun_add
hostsvc/storage/mockup/scsilun_remove
hostsvc/storage/mockup/topology_add
hostsvc/storage/mockup/topology_remove
hostsvc/storage/provider/device_info
hostsvc/storage/provider/enable_stack_trace
hostsvc/storage/provider/fs_info
hostsvc/storage/datastore_browser_search
hostsvc/storage/fs_info
hostsvc/storage/hba_info
hostsvc/storage/hba_rescan
hostsvc/storage/info
hostsvc/storage/iscsi_add_send_target
hostsvc/storage/iscsi_add_static_target
hostsvc/storage/iscsi_disable_chap
hostsvc/storage/iscsi_discovery
hostsvc/storage/iscsi_enable_chap
hostsvc/storage/iscsi_ip_config
hostsvc/storage/iscsi_ip_use_dhcp
hostsvc/storage/iscsi_remove_send_target
hostsvc/storage/iscsi_remove_static_target
hostsvc/storage/iscsi_set_alias
hostsvc/storage/iscsi_set_name
hostsvc/storage/multipath_info
hostsvc/storage/multipath_lun_setpolicy
hostsvc/storage/multipath_path_disable
hostsvc/storage/multipath_path_enable
hostsvc/storage/partition_get
hostsvc/storage/partition_layout_add
hostsvc/storage/partition_layout_get
hostsvc/storage/partition_layout_set
hostsvc/storage/partition_remove
hostsvc/storage/partition_spec_add
hostsvc/storage/partition_spec_get
hostsvc/storage/refresh
hostsvc/storage/scsilun_info
hostsvc/storage/software_iscsi_enabled
hostsvc/storage/topology_info
hostsvc/storage/upgrade_vm_layout
hostsvc/storage/vmfs_attach_extent
hostsvc/storage/vmfs_format
hostsvc/storage/vmfs_rescan
hostsvc/storage/vmfs_upgrade
hostsvc/summary/fsvolume
hostsvc/summary/hba
hostsvc/summary/scsilun
hostsvc/vmotion/ipconfig_get
hostsvc/vmotion/ipconfig_set
hostsvc/vmotion/netconfig_get
hostsvc/vmotion/vnic_set
hostsvc/vmotion/vnic_unset
hostsvc/connect
hostsvc/cpuinfo
hostsvc/firewall_disable_ruleset
hostsvc/firewall_enable_ruleset
hostsvc/hostconfig
hostsvc/hosthardware
hostsvc/hostsummary
hostsvc/login
hostsvc/logout
hostsvc/maintenance_mode_enter
hostsvc/maintenance_mode_exit
hostsvc/memoryinfo
hostsvc/pci_add
hostsvc/pci_remove
hostsvc/queryconnectioninfo
hostsvc/querydisabledmethods
hostsvc/refresh_firewall
hostsvc/refresh_services
hostsvc/runtimeinfo
hostsvc/set_hostid
hostsvc/standby_mode_enter
hostsvc/standby_mode_exit
hostsvc/task_list


internalsvc:

internalsvc/perfcount/enumerate
internalsvc/perfcount/query_destroy
internalsvc/perfcount/query_execute
internalsvc/perfcount/query_info
internalsvc/perfcount/query_list
internalsvc/perfcount/query_names
internalsvc/perfcount/scoreboard
internalsvc/access_address
internalsvc/cold_quit
internalsvc/connect
internalsvc/host_mode_lock
internalsvc/login
internalsvc/loglist
internalsvc/logout
internalsvc/redirect_stderr
internalsvc/redirect_stdout
internalsvc/refresh
internalsvc/refresh_consolenic
internalsvc/refresh_datastores
internalsvc/refresh_gateway
internalsvc/refresh_network
internalsvc/refresh_pnic
internalsvc/set_exception_variable
internalsvc/set_log_level
internalsvc/shutdown
internalsvc/throw_exception
internalsvc/use_fds

proxysvc:

proxysvc/add_np_service
proxysvc/add_tcp_service
proxysvc/connect
proxysvc/login
proxysvc/logout
proxysvc/port_info
proxysvc/remove_service
proxysvc/service_list

solo:

solo/connect
solo/environment
solo/login
solo/logout
solo/querycfgopt
solo/querycfgoptdesc
solo/registervm

vmsvc:

vmsvc/acquiremksticket
vmsvc/connect
vmsvc/convert.toTemplate
vmsvc/convert.toVm
vmsvc/createdummyvm
vmsvc/destroy
vmsvc/device.connection
vmsvc/device.connusbdev
vmsvc/device.disconnusbdev
vmsvc/device.diskadd
vmsvc/device.diskaddexisting
vmsvc/device.diskremove
vmsvc/device.getdevices
vmsvc/device.toolsSyncSet
vmsvc/device.vmiadd
vmsvc/device.vmiremove
vmsvc/devices.createnic
vmsvc/get.capability
vmsvc/get.config
vmsvc/get.config.cpuidmask
vmsvc/get.configoption
vmsvc/get.datastores
vmsvc/get.disabledmethods
vmsvc/get.environment
vmsvc/get.filelayout
vmsvc/get.guest
vmsvc/get.guestheartbeatStatus
vmsvc/get.managedentitystatus
vmsvc/get.networks
vmsvc/get.runtime
vmsvc/get.snapshotinfo
vmsvc/get.summary
vmsvc/get.tasklist
vmsvc/getallvms
vmsvc/gethostconstraints
vmsvc/login
vmsvc/logout
vmsvc/message
vmsvc/power.getstate
vmsvc/power.hibernate
vmsvc/power.off
vmsvc/power.on
vmsvc/power.reboot
vmsvc/power.reset
vmsvc/power.shutdown
vmsvc/power.suspend
vmsvc/reload
vmsvc/setscreenres
vmsvc/snapshot.create
vmsvc/snapshot.dumpoption
vmsvc/snapshot.get
vmsvc/snapshot.remove
vmsvc/snapshot.removeall
vmsvc/snapshot.revert
vmsvc/snapshot.setoption
vmsvc/tools.cancelinstall
vmsvc/tools.install
vmsvc/tools.upgrade
vmsvc/unregister
vmsvc/upgrade

keywords