VMware Shutdown Guest OS for Virtual Machine Action
You may have noticed that there are 2 similar power option to shut down a VMware VM, what’s the difference between VMware shutdown guest OS and VM power off? This article will cover their explanation and the operation to properly shutdown a VMware ESXi VM without data loss.
Case: Do I need to shut down before powering off a VM??
Case: Do I need to shut down before powering off a VM?
Sometimes I'm starting a VM to do a quick test. I start up the VM, do the test and then power off. However, doing this I get the warning.
Check that you have shut down your guest operating system before powering off.
Are you sure you want to power off the virtual machine?
I understand that there may be data/disk corruptions if the power off occurs during a write operation. Given the fact that I will always revert to a snapshot and not power on from the state I powered off, do I need to shut down guest OS and is there any risk in powering off a running VM?
- Question from superuser.com
VMware is a powerful leading company in the virtualization industry. When using virtual machine on VMware products, no matter it is a type-1 hypervisor or type-2, you will get in touch with many basic power options, such as VMware Shut Down guest OS, Power on, Power off, Suspend, and Restart the guest OS.
Understanding the meaning of these power options is a must do before you start performing complex development or testing on a virtual machine. And some of them may be confusing like in the above case. In this article, I will explain the meaning and the operation of VMware shutdown guest OS, and the difference between shutdown and power off.
What is VMware shutdown guest OS
VMware shutdown guest OS as its name implies, refers to following the normal process to shut down the virtual machine from the guest operation system, just like the "Start > Shut Down" operation on a physical machine. It is a VMware Tools option, therefore can only be done if the VM has VMware Tools installed and running. The power state will change to Partially Powered Off state. But if the guest operating system supports Advanced Power Management, it can also power off the virtual machine.
Shutting down a virtual machine in this way can effectively ensure a consistent file system and prevent data loss due to file system corruption. This distinguishes the VMware shutdown guest OS operation from another confusing power option, power off VM.
VMware shutdown guest OS vs power off
Just like Hyper-V turn off vs shut down, VMware shut down and power off are also two long confusing power options. They are both used to shut down a virtual machine, but they also have differences:
Shut Down Guest: gracefully initiates the shutdown procedure on the guest operating system, maintaining the file system consistency without causing data loss.
Power Off: abruptly powers off the virtual machine, by default you have completely stopped of the guest operating system. The effect is similar to press the Power button on a physical machine. Any programs running in the virtual machine may be adversely affected, and cause data loss.
How VMware ESXi shutdown guest OS
As you can see, powering off VM without following the normal shutdown process may cause file system inconsistency and even data loss. Therefore, if you haven’t keep a recent virtual machine backup, or haven’t take a snapshot to revert your VM to, you’d better follow the normal process to shutdown guest OS.
Backup your VM before forcibly power off it
To avoid the consequences of file inconsistencies and even data loss caused by forcibly powering off the VMware VM, you can back up VMware ESXi VM before you do it. You can try AOMEI Cyber Backup to hot backup VMs while they are running. More »
In the next part, I will show you 2 ways to properly shutdown guest OS on VMware ESXi.
VMware shutdown guest OS via GUI
1. Access VMware vSphere web client, and select the virtual machine you want to shutdown.
2. Right-click on the name of the VM, and select VMware shutdown Guest OS.
VMware shutdown guest OS via PowerCLI
Except for VMware client GUI, you can also run PowerCLI command to shutdown a VM from the guest OS. It is useful if you prefer to let the OS gracefully shut itself down during, for example, a downtime.
The command is like the following:
Shutdown-VMGuest -VM <VMname> -Confirm:$False
Note:
1. Replace the bold black text with the name of your target VM.
2. VM Tools is required for this command to work because the vCenter API has to communicate with the OS for the command to execute.
3. If your ESXi is in maintenance mode, and you need your VMware ESXi shutdown without maintenance mode, you can exit maintenance mode by running the following command:
# vim-cmd /hostsvc/maintenance_mode_exit
Summary
If you shutdown the VMware VMs improperly, for example, if you power off VM without backups or VMware snapshots, or VMware ESXi shutdown without maintenance mode, then it may lead to the file system inconsistencies or even data loss.
In this article, I explained what is VMware shutdown guest OS, how it differs from VM power off, and showed 2 ways to properly shutdown VMware ESXi VMs. If you still want to power off your VM, please remember to take a snapshot or backup to avoid file corruption or data loss.