Setting up the VM agent

If you configure the high-availability function at VM-level or application-level, you must set up the VM monitor (VMM) and the application monitoring framework (AppMon) in each VM for which VM failure detection is required.

Notes:
  • You can install the VM agent to monitor the virtual machine and to monitor applications on the virtual machines that run only the following operating systems:
    • AIX® Version 6.1, or later
    • PowerLinux
      • Red Hat Enterprise Linux® (RHEL) (little endian) Version 7.4, or later
      • SUSE Linux Enterprise Server (SLES) (little endian) Version 12.3, or later
  • Currently, the high-availability feature at VM-level or application-level is not supported for IBM® i operating system or other Linux distributions. However, you can enable these virtual machines for host-level health management. In addition, you can perform manual restart and LPM operations on these VMs.
  • You can configure the VM agent by using the ksysvmmgr command only. You cannot configure the VM agent by using the VM Recovery Manager HA GUI.
  • Apart from any general application that you want the VM agent to monitor, the VM Recovery Manager HA solution supports the following type of applications that can be monitored by using the in-built scripts in the corresponding versions of operating systems:
    Table 1. Version support matrix for application types and operating systems
    Application type AIX operating system Linux operating system (RHEL and SLES)
    ORACLE Oracle Database 12.1, or later Not supported
    DB2® IBM DB2 11.3, or later IBM DB2 10.5, or later
    SAP_HANA Not supported SAP HANA 2.0, or later
    SAPNW_* 7.53 Not supported
    POSTGRES Postgres 9.2.23 or later Postgres 9.2.23 or later
After you install the VM agent filesets successfully, complete the following steps to set up the VM monitor in each guest virtual machine:
  1. Start the VM monitor daemon in each virtual machine to start monitoring the virtual machines and applications by running the following command:
    ksysvmmgr start [vmm] [<ATTR#1>=<VALUE#1>][,<ATTR#n>=<VALUE#n>]
    For example,
    ksysvmmgr start vmm log=2 
    To find more information about the attributes for the VM monitor daemon, see the ksysvmmgr command topic.
  2. Register applications in the VM monitor daemon that must be monitored for high availability by running the following command:
    ksysvmmgr [-s] add app name <ATTR#1>=<VALUE#1>[,<ATTR#n>=<VALUE#n>]
    For example,
    ksysvmmgr -s add app app1 monitor_script=/tmp/monitor1.sh 
          start_script=/tmp/start1.sh stop_script=/tmp/stop1.sh
    ksysvmmgr -s add app oracleapp type=ORACLE instancename=orauser database=DBRESP
    ksysvmmgr -s add app sapapp type=SAPHANA instancename=S01 database=HDB01 configfile=/var/ksys/config/SAPHANAconfig.xml
    ksysvmmgr -s add app db2app type=DB2 instancename=db2inst1
    ksysvmmgr -s add app postgresapp type=POSTGRES instancename=postgres database=testdb configfile=/var/ksys/config/samples/POSTGRESconfig.xml
    After you add an application, if the application fails or stops working correctly, the VM agent attempts to restart the application in the same virtual machine for several times as specified in the max_restart attribute for the VM, which is set to 3 by default. If the application is still not working correctly, the KSYS subsystem notifies you about the issue. You can manually review the problem and restart the application.
  3. Mark important applications as critical by running the following command:
    ksysvmmgr -s modify app app2 critical=yes
    When you mark an application as critical, if the application fails or stops working correctly, the VM agent attempts to restart the application for several times as specified in the max_restart attribute for the VM. If the application is still not working correctly, the KSYS subsystem notifies you about the issue and attempts to restart the virtual machine on the same host. If the application is still not working correctly, that is if the application status is displayed as RED when you run the ksysmgr query app command, the KSYS restarts the VM on another host within the host group based on the specified policies.
  4. If some applications have dependencies, for example, if you need to specify a sequence of applications to start or stop, specify the dependencies by running the following command:
    ksysvmmgr [-s] add dependency <ATTR#1>=<VALUE#1>[,<ATTR#n>=<VALUE#n>]
    For example,
    ksysvmmgr -s add dependency dependency_list=app1,app2,app3 
              dependency_type=start_sequence
    
    ksysvmmgr -s add dependency dependency_list=app4,app5,app6 
              dependency_type=stop_sequence
    
    ksysvmmgr -s add dependency dependency_list=app1,app2 
             dependency_type=parent_child
    When you add a dependency, if the virtual machines are restarted on the same or another host, the applications in the virtual machine are started based on the specified dependency.
  5. If you need to modify any attributes for the VM monitor daemon, applications, or application dependency, enter one of the following commands:
    ksysvmmgr [-s] modify [vmm] <ATTR#1>=<VALUE#1>[,<ATTR#n>=<VALUE#n>]
    ksysvmmgr [-s] modify app <name> <ATTR#1>=<VALUE#1>[,<ATTR#n>=<VALUE#n>]
    ksysvmmgr [-s] modify dependency <DEPUUID> <ATTR#1>=<VALUE#1>[,<ATTR#n>=<VALUE#n>]
  6. Save a snapshot of the VM monitor configuration by running the following command:
    ksysvmmgr backup vmm filepath=full_file_prefix_path
    You can restore the saved snapshot by using the ksysvmmgr -s restore vmm filepath=filepath command.