Question: There is Virtual Machine which is not pingable/rdp and in vCenter console it was hung. All options are grayed out at VM options. How to recover this Virtual machine?
Hint: Interviewer wants to know your ESXi command line skills to troubleshoot the scenario
Answer: From the symptoms it is clear that there is no option available from vCenter server except you can see Events & Tasks to understand if any action performed before it went to hung state.
For eg: Backup jobs taking snapshot, L1/L2 Admin tried to hit multiple tasks to Shutdown/Restart/Power-off VM
With all these symptoms let us identify the ESXi host on which VM is running and get the root password either from your Team Lead or Tool where you can get the shared ID password.
Step 1: Determining the virtual machine’s location
Determine the host on which the virtual machine is running. This information is available in the virtual machine’s Summary tab in VI Client. Subsequent commands will be performed on, or remotely reference, the ESXi host where the virtual machine is running.
Step 2: Open a console session either in the ESXi Shell or Putty session to ESXi host via Name/IP
Step 3: Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file
esxcli vm process list
Step 4: Power off one of the virtual machines from the list using this command:
esxcli vm process kill –type=[soft,hard,force] –world-id=WorldNumber
Three power-off methods are available – Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
Step 5: Check the Virtual Machine process again to make sure it is no more exist
esxcli vm process list
Hope this helps and Happy Learning …..