System Administrators using the complete vSphere solution use VMware HA to ensure the continuous running of virtual machines. However, if you are using the free version of ESXi, you will not be able to use the VMware HA feature. There are other options to protect your virtual machines by achieving high availability and ensure they are running properly. Before considering other options, let's look at what VMware HA actually means. After the vSphere platform discovers that the virtual machine is unavailable, VMware HA restarts the Virtual Machine on another host. Although VMware HA can monitor the availability of virtual machines, it cannot check the availability of internal services of virtual machines. In some environments, you may need to ensure the availability of internal services of virtual machines.High Availability in the operating systemSome environments that require high availability do not necessarily require the availability of virtual machines, but ensure that resources in the virtual machines can run continuously. Each operating system running a virtual machine provides high availability. The high availability of the operating system monitors key resources. Even if the Virtual Machine carrying the resource is still running, the high availability function in the operating system can restart faulty resources. The system administrator can use the scripts in the virtual machine to monitor the running status of resources and services in the virtual machine. For example, if you want the Web server to run continuously, you can use the following shell script to test whether the Web server is running:
while ps aux | grep httpddosleep 5done service httpd restart
The preceding script checks the httpd process every five seconds. If the httpd process is unavailable, the iteration ends and the httpd service restarts automatically. This is an easy way to ensure that Web server services can be restarted. For example, you can adjust the script to monitor the availability of services running on a remote server.
Manual HAYou can use the manual HA mode when you do not need to use the VM auto-restart function provided by VMware HA. Manual HA is based on the availability of virtual machine image files on shared storage devices (such as NAS or SAN. As long as virtual machine files can be easily accessed by all ESXi hosts, when the host running the virtual machine goes down, you can import these virtual machines from another storage device. The disadvantage of this method is that manual intervention is required, but the Administrator has full control, which may be suitable for a specific environment. You do not need HA to find that the host, virtual machine, or core resources have disappeared. You can also use monitoring software such as Nagios or Zabbix to trigger alarms for key events that occur on the network.