Showing posts with label Putty. Show all posts

Restart Management Agents on ESXi Hosts


In this post, I am providing steps in brief to restart the Management Agents on ESXi Hosts using 2 methods : Either by connecting to the Host via a Secure SSH Putty Session OR by taking a remote session of the ESXi Host.

Please note that by restarting the Management Agents, there is no impact to running VMs on this Host, It restart the Management Services which help in communicating with VCenter this Host is connected to.

A) By SSH Putty Session
Run the following commands to restart the Management Agents
/etc/init.d/hostd restart
/etc/init.d/vpxa restart

To check the status of these agents, run the following commands
/etc/init.d/hostd status
/etc/init.d/vpxa status

B)  From Remote Console

  1. Connect to the console and Press F2 to Login
  2. Enter Root Username and Password
  3. Navigate to Troubleshooting Mode Options -> Restart Management Agent and Press Enter
  4. Press F11 to confirm the Management Agent Status



Kill VM Stuck Due To Running Tasks


Virtual Machines are sometimes hung due to active actions like Snapshot Collection, Removal, Disk Consolidation or other tasks. In these cases we usually wait until the tasks are completed on its own. However in some cases we do not see the progress in the Task.

In order to kill the ongoing task, we need to kill the VM process. Please note that this process also powers off the Virtual Machine and is not always recommended as it abruptly terminates the IOPS but if there are no other options and if we cannot wait any longer, we can use the following steps to kill the VM

1. Check the ESXi host on which this VM is hosted
2. Enable SSH on the host from Security Profiles
3. Connect to ESXi Host via SSH [You can use Putty to connect] using root credentials
4. Run the below command to list the running Virtual Machines and their World IDs

          esxcli vm process list

5. Locate the VM that you need to kill and note down the World ID
6. Kill the VM and its tasks by running the following command

          esxcli vm process kill --type=[soft, hard, force] --world-id=[world-id]

where type would be either soft, hard or force kill
& world-id is World ID of the VM that we noted down in Step#4