VMware HA script in Zimbra Collaboration

VMware HA script in Zimbra Collaboration

   KB 22381        Last updated on 2018-01-10  




0.00
(0 votes)

Purpose

Technical explanation of the VMware HA, Network Edition Feature of Zimbra Collaboration.

Resolution

Zimbra introduce VMware HA scripts in Zimbra 8. This feature is only available in Network Edition, so Open Source users can't use it. This vmware-ha service works combine with VMware vSphere HA VM Monitoring and offer us the possibility to restart our Zimbra VM when any Zimbra service was down during the heartbeat defined time. The zmhactl script starts /opt/zimbra/libexec/vmware-heartbeat, which runs as a service (continuously), and interacts with VMware HA by running /opt/zimbra/libexec/vmware-appmonitor with different arguments (so zmhactl -> vmware-heartbeat -> vmware-appmonitor -> VMware HA).

  • A. When the vmware-heartbeat script starts, it sends a vmware-appmonitor "enable" signal
  • B. While running it does the following on a set schedule (every 15 seconds). This is supposedly configurable with localconfig vmware_heartbeat_interval, but it doesn't look like zmhactl actually uses that.
    • i. runs vmware-appmonitor "isEnabled" to verify that application monitoring is enabled
    • ii. runs "zmcontrol status" and checks the return code
    • iii. if the status is OK then it sends vmware-appmonitor "markActive"
  • C. When vmware-heartbeat is stopped, it sends a vmware-appmonitor "disable" signal

VMware vSphere HA VM Monitoring

Let's go to some basic information about VMware vSphere HA VM Monitoring, based in the official information. What is vSphere HA VM monitoring? HA VM monitoring will restart a VM if:

  • That VMs VMware Tools heartbeats are not received in a set period of time (see below for details) and
  • The VM isn't generating any storage or network IO (for 120 seconds by default, though this can be changed using the following advanced cluster level setting: das.iostatsInterval)

When exactly will the VM be reset? There are 3 built in presets (Low, Medium & High) and the option to select custom settings for any of these options.

Failure Interval Minimum uptime Maximum per-VM resets Maximum resets time window
Low 120 secs 480 secs 3 7 days
Medium 60 secs 240 secs 3 24 hours
High 30 secs 120 secs 3 1 hour

What do the different options mean?

  • Failure interval: HA will restart the VM if the VM heartbeat has not been received in this interval
  • Minimum uptime: HA will wait this long after a VM is started to begin monitoring for VM tools heartbeats, storage and network IO
  • Maximum per-VM resets: HA will restart the VM a maximum of this many times within the “Maximum resets time window”
  • Maximum resets time window: (see “Maximum per-VM resets” above)

How to activate it in Zimbra Collaboration

The first step after the theory is activate it in our Zimbra different VM, we can check first if it's activated

   [zimbra@archiving ~]$ zmprov gs `zmhostname` zimbraServiceInstalled | grep vmware-ha

If not we can enable it with trough CLI

   [zimbra@mail ~]$ zmprov ms `zmhostname` +zimbraServiceEnabled vmware-ha
   [zimbra@mail ~]$ zmhactl start

Also we can enable it trough Admin Console Home>Configure>Servers (select the server that we want to activate the vmware-ha) and then click in Services>VMware HA Heartbeat

Zimbra-vmware-ha-001.PNG

How to activate vSphere HA VM Monitoring

We can follow two ways to activate it in VMware vSphere; vSphere Client or vSphere web Client.

vSphere Client

In our VMware vSphere Cluster and right-click>Edit Settings:

Zimbra-vmware-ha-002.png

We need to have activated VMware vSphere HA functionality, and go to VM Monitoring, mark the option VM and Application Monitoring for be able to activate the Application Monitoring. In this moment, select the best Monitoring sensitivity for your environment is out of the Scope of the Zimbra Wiki and you need to have deep understand in VMware for select the best option for your Infrastructure. We are selecting the Low Monitoring sensitivity, but in the VM, or VMs that we want to activate the Zimbra vmware-ha, will select VM Monitoring High, with Application Monitoring also activated.

Zimbra-vmware-ha-003.png

Also we can personalize and configure the best time for our Zimbra VM, if we select Custom VM Monitoring Settings.

Zimbra-vmware-ha-004.png

vSphere web Client

We can follow the same steps but in the new vSphere Web client, following these steps.

Testing the Zimbra vmware-ha script

We've selected High option, is time to test it in our Zimbra VM, we will stop one Zimbra service intentionally, for test it.

   [zimbra@mail~]$ zmmailboxdctl stop

And when the time conditions happen, vSphere HA will restart the VM and we will have a Log action into our vSphere Server

Zimbra-vmware-ha-005.png

Log File

The Zimbra vmware-ha script log everything in the next log

   root@mail:/home/oper# tail -f /opt/zimbra/log/vmware-heartbeat.log

And the result of the Log File will be like this:

   Fri Oct 24 17:59:49 2014: Checking ZCS status
   Fri Oct 24 17:59:51 2014: Sending heartbeat to VM

Additional Content

  • No related content
Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 10/02/2015
Article ID: https://wiki.zimbra.com/index.php?title=VMware_HA_script_in_Zimbra_Collaboration Date Modified: 2018-01-10



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by Jorge SME2 Copyeditor Last edit by Jorge de la Cruz
Jump to: navigation, search