Backup of passive node with script
Hi,
I was hoping that someone could help me with task at hand.
We have 2 custom applications VMs that are in the cluster. We used to backup both of them using VMware backup policy, but during a backup of active node we have the issue that VM freezes while snapshot is taken. We know the that this happens because VM is being quiesced for the snapshot, but we cannot change this, as disk are in particular setup and it is production environment.
So we decided to only do the backup of the passive node with VMware backup policies. We have two VMware policies each with only one vm client (one of those 2 vm nodes of the cluster). Each have a following schedules.
Daily INCR schedule
Weekly FULL schedule
Team in charge of the application will create script on their side that will automatically add file on the node that is passive in /etc/passive.txt. (this file will at the same time be missing on the active node)
How can I add the script in NetBackup so when the policy runs during it's automatic schedule, it checks if the client in the policy contains file /etc/passive.txt, and if it does runs backup normally, if not, than doesn't do anything. In this way one of those two policies will always do the backups and other check and skip.
I have placed 2 copies of bpstart_notify to /usr/openv/netbackup/bin on the client and renamed them
bpstart_notify.POLICY_NAME.SCHEDULE_NAME (for INRC and FULL schedules)
Simple if condition script in the file looks like this:
#!/bin/bash
FILE=/etc/passive.txt
if [ -f "$FILE" ]; then
exit 0
else
exit 1
fi
However backup always runs, whether the file is there or not.
Hope this makes sense.
Please help if you can.
Hello.
first of all, as I remember you can not create a VM snapshot if you share disks. What type of cluster you have?
I think that you have three (actually two) solutions to implement vm backup of the passive node. These are my thoughts. There are not full solution and you have to check them and find how to implement one of them.- use VMware rest api to put a tag to the inactive node and create a VIP policy with filter to backup the VM with the right tag.
you can create a script on the client to change the tag every time the cluster service change node. I think that this is the most robust solution - you can create a standard policy without backup window at the schedules and add manually the two VMs, and create a script on both nodes that will run with crontab.
The script will check if this is the inactive node and will run a manual backup of the correct VM.
You can start the manual backup using netbackup rest api or by running the following command on the client (you have to add the client to the servers list of the master server)
bpbackup -i -p <policy> -s <schedule> -h <client_name> - if the clients and the master server are linux systems you can trust each other and create the txt to the master server. Then you can have a script on the master server to start your backup. This is not the way I like as if someone penetrate to one of the systems will have access to the others.
- use VMware rest api to put a tag to the inactive node and create a VIP policy with filter to backup the VM with the right tag.