Tag Archives: post

How to use Nutanix AHV VM Guest pre and post scripts with SnapShots and Veeam Backups (SAP HANA)

Lately we had some issues with setting up a lab environment for SAP SnapShot based processing with the usage of Nutanix AHV VM Guest pre and post scripting. Here is the complete guide to make them work:

  1. Build the VM with SCSI disks.
  2. Add an IP address and make sure AHV Virtual Cluster IP can communicate with the VM on TCP 2074
  3. Many Linux systems need additionally the dmidecode software package. You can install it for example with
    yum -y install dmidecode
  4. Install Nutanix NGT Tools
    Go to Prism and select the VM
    Klick on “Manage Guest Tools”, enable it and check “Mount Nutanix Guest Tools”

    Login to the VM and run:
    sudo mount /dev/sr0 /mnt
    sudo /mnt/installer/linux/install_ngt.py
  5.  Create the pre_freeze and post_thaw script/usr/local/sbin/pre_freeze
    /usr/local/sbin/post_thaw   (both need to exist)
    On older AHV versions it needs to be
    /sbin/pre_freeze
    /sbin/post_thaw (both need to exist)
    You can use any sh or python script.
    For example
    #!/bin/sh
    yourcommandTip: Don`t create the script with a Windows editor as the new line command is different.
  6. Create a Nutanix AHV Protection Domain and add a VM to it with enabled “Use application consistent snapshots”.
    It do not matter if you schedule the protection group or not.
  7. Make sure there is no CD/DVD mounted/inside the drive. You can check the configuration of the VM:

8. Manually create a snapshot for the protection domain with enabled “Create application consistent snapshot” , schedule the protection domain or use Veeam Availability for Nutanix to backup the above created protection domain.

9. If you search for SAP HANA pre freeze post thaw scripts to bring the Database in a consistent state for backup, please check:
https://github.com/VeeamHub/applications/tree/master/sap-hana