Find and Start/Stop VM on ESXI

How to find and Start/Stop VM on ESXI.
SSH to the ESXI server.

# esxcli vm process list
# esxcli vm process list
WebHost
   World ID: 35689
   Process ID: 0
   VMX Cartel ID: 35686
   UUID: 56 4d 72 7c da 4c 82 f1-9f 10 9c e3 d6 7d a4 9d
   Display Name: WebHost
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/WebHost/WebHost.vmx

Windows
   World ID: 4150543
   Process ID: 0
   VMX Cartel ID: 4150542
   UUID: 56 4d 49 5f 12 7e 26 96-d8 31 37 05 21 64 5d 46
   Display Name: Windows
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/Windows/Windows.vmx

Monitor
   World ID: 2487010
   Process ID: 0
   VMX Cartel ID: 2487009
   UUID: 56 4d 99 de b0 13 a1 76-bd 2d 95 8a be 25 35 39
   Display Name: Monitor
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/Monitor/Monitor.vmx

Mail
   World ID: 2487029
   Process ID: 0
   VMX Cartel ID: 2487028
   UUID: 56 4d 4f 88 c8 bf a6 37-b5 5b 96 6f b4 23 c5 fb
   Display Name: Mail
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/Mail/Mail.vmx

Stop a VM:

# esxcli vm process kill -t soft --world-id 4150543

Review to verify the VM is off:

 # esxcli vm process list
WebHost
   World ID: 35689
   Process ID: 0
   VMX Cartel ID: 35686
   UUID: 56 4d 72 7c da 4c 82 f1-9f 10 9c e3 d6 7d a4 9d
   Display Name: WebHost
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/WebHost/WebHost.vmx

Monitor
   World ID: 2487010
   Process ID: 0
   VMX Cartel ID: 2487009
   UUID: 56 4d 99 de b0 13 a1 76-bd 2d 95 8a be 25 35 39
   Display Name: Monitor
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/Monitor/Monitor.vmx

Mail
   World ID: 2487029
   Process ID: 0
   VMX Cartel ID: 2487028
   UUID: 56 4d 4f 88 c8 bf a6 37-b5 5b 96 6f b4 23 c5 fb
   Display Name: Mail
   Config File: /vmfs/volumes/54c1dfef-00e03f4b-784e-6805ca0a3085/Mail/Mail.vmx

How to start a Guest VM from Command line:

Get a list of VMs on a host using the command:


# vim-cmd vmsvc/getallvms 
Vmid    Name                   File                       Guest OS          Version   Annotation
32     Monitor   [datastore1] Monitor/Monitor.vmx   centos64Guest           vmx-08
44     Mail      [datastore1] Mail/Mail.vmx         ubuntu64Guest           vmx-08
58     WebHost   [datastore1] WebHost/WebHost.vmx   centos64Guest           vmx-08
61     Plesk     [datastore1] Plesk/Plesk.vmx       centos64Guest           vmx-08
62     Windows   [datastore1] Windows/Windows.vmx   windows8Server64Guest   vmx-08

NOTE: The important fields will be the the VMID of your desired VM

Double check the power state of the VM:


vim-cmd vmsvc/power.getstate <vmid>

# vim-cmd vmsvc/power.getstate 62
Retrieved runtime info
Powered off

Start


vim-cmd vmsvc/power.on <vmid>
# vim-cmd vmsvc/power.on 62
Powering on VM:

Windows 2012 virtual machines using E1000/E1000e driver experience loss of network connectivity

Source: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2109922

Virtual machine loses network connectivity intermittently
In the Windows Event Viewer (Expand Windows Logs and select System), you see entries similar to:

Intel(R) 82574L Gigabit Network Connection Network link is disconnected

or

Intel(R) 82574L Gigabit Network Connection Network link has been established at 1Gbps full duplex
This issue would occur in these environments:
The virtual machine is Windows2012 or Windows 2012 R2
The virtual machine is using E1000 or E1000E driver

Cause

This issue occurs due to the driver bundled with Microsoft Windows 2012.
Resolution
VMware is investigating this issue with the partners.

Currently, there is no resolution

To work around this issue, use VMXNET3 instead of E1000 or E1000e driver.

CentOS Linux install kernel headers to build vmware and vmon error

You don’t have development package for building kernel modules to match the kernel. It is required to build 3rd party modules such as vmware or graphics card drivers.

There is a package called kernel-devel. This package provides kernel headers and makefiles sufficient to build modules against the kernel package.

Login as the root, and use yum command to install the same:


# yum install kernel-devel

So I rebuilt the modules with these commands

vmware-modconfig –console –build-mod vmmon

vmware-modconfig –console –build-mod vmnet

vmware-modconfig –console –build-mod vmci

Then reloaded the modules


# modprobe vmmon

# modprobe vmnet

# modprobe vmci

Now I get;


[root@gemini ~]# service vmware restart

Stopping VMware services:

   VMware Authentication Daemon                            [  OK  ]

   VM communication interface socket family                [  OK  ]

   Virtual machine communication interface                 [  OK  ]

   Virtual machine monitor                                 [  OK  ]

   Blocking file system                                    [  OK  ]

Starting VMware services:

   Virtual machine monitor                                 [  OK  ]

   Virtual machine communication interface                 [  OK  ]

   VM communication interface socket family                [  OK  ]

   Blocking file system                                    [  OK  ]

   Virtual ethernet                                        [  OK  ]

   VMware Authentication Daemon                            [  OK  ]

   Shared Memory Available                                 [  OK  ]