A quick blog to show the procedure to stop VM from esx shell.
Execute the below command to check what’s running on the ESXi hosts. All the Cluster VM’s will be running at this time.
Step 9 – Shut down all the VM’s..
1 2 3 |
<span class="line"><span style="color: #D8DEE9">sshpass</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">f</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">mypassword</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.79</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">list</span></span> <span class="line"><span style="color: #D8DEE9">sshpass</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">f</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">mypassword</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.79</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">list</span></span> <span class="line"><span style="color: #D8DEE9">sshpass</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">f</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">mypassword</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.79</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">list</span></span> |
Step 10 – Locate the World ID of all the VM’s that are running.
To shut down the guest operating system and then power off the virtual machine we will run the below commands.
1 2 3 4 |
<span class="line"><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.76</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kill</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">type</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">soft</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">world</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">id</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">1085343</span></span> <span class="line"><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.78</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kill</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">type</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">soft</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">world</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">id</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">1080496</span></span> <span class="line"><span style="color: #D8DEE9">ssh</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">root</span><span style="color: #D8DEE9FF">@</span><span style="color: #B48EAD">192.168</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">11.79</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">esxcli</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">vm</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">process</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kill</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">type</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">soft</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">world</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">id</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">1082673</span></span> <span class="line"></span> |
Validate again if there are any running VM’s on the ESXi hosts.
(Visited 2 times, 1 visits today)