De VMBK backup duurt helaas iets te lang om elke dag een een full backup te maken. Nu heb ik voor gekozen om twee backup scenario’s te gaan gebruiken.

  1. Daily: de VM’s waar de data veel veranderd. Bijvoorbeeld DC’s, fileserver en mailserver
  2. Full: Alle VM’s. Deze job draait in het weekend. Dit zijn VM’s die vrij statisch zijn.

Dit kun je als volgt configureren. Maak twee vmbk-config.conf files aan (vmbk-daily.conf en vmbk-full.conf). Maak vervolgens een lijst van VM’s die met de daily backup meegenomen moeten worden. Pas het VMX bestand aan van de VM’s door BACKUP.SESSION=daily toe te voegen. Als laatste stap maak je de cronjob aan.

Deel van de vmbk-daily.conf file. Het enige wat je veranderd is de BackupSession value, zodat alleen de VM’s met BACKUP.SESSION=daily in het vmx bestand, worden meegenomen in de backup.

Daily

Configfile VMBK:


#Version 1.01.2
#set timeout
#Timeout=60000
Timeout=180000
#minimum space required for add RedoLOG
minspaceforRedo=1024
# backup esx host configuration
backupESX=true
BackupSession=”daily”
#directory where file
destination=/mnt/esxbackup/

Deel van de vmbk-full.conf file. Dit bestand is default gebleven met betrekken tot de BackupSession value.

Full

Configfile VMBK:


#Version 1.01.2
#set timeout
#Timeout=60000
Timeout=180000
#minimum space required for add RedoLOG
minspaceforRedo=1024
# backup esx host configuration
backupESX=true
BackupSession=”default”
#directory where file
destination=/mnt/esxbackup/

VMX bestand

Voor de dagelijkse backup voeg je de onderstaande regel toe aan het VMX bestand:
BACKUP.SESSION=daily

Cronjob

De volgende stappen moeten worden gedaan om de cronjob aan te maken.

Open /etc/cron.d/vmbk-cron.sh en voeg de onderstaande regels toe of pas deze aan naar jouw situatie.



#!/bin/bash
#copy on directory /etc/crond and configure /usr/local/etc/vmbk-default.conf
30 23 * * 1 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-daily.conf > /dev/null 2>&1
30 23 * * 2 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-daily.conf > /dev/null 2>&1
30 23 * * 3 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-daily.conf > /dev/null 2>&1
30 23 * * 4 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-daily.conf > /dev/null 2>&1
30 23 * * 5 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-daily.conf > /dev/null 2>&1
30 5 * * 0 root /usr/local/bin/vmbk.pl -C /usr/local/bin/vmbk-full.conf > /dev/null 2>&1

30 23 * * 1 staat voor Maandag om 23:00 uur wordt de backup gestart.

Door de onderstaande commando’s uit te voeren wordt de cronjob geïnstalleerd:
cp /usr/local/bin/vmbk-cron.sh /etc/cron.d/vmbk-cron.sh

chmod 755 /etc/cron.d/vmbk-cron.sh
touch /etc/cron.d/vmbk-cron.sh

Met het volgende commando herstart je de cron service:
/sbin/service crond restart

Zie deze post over het aanpassen van vmx bestanden.

Advertisement

3 thoughts on “VMBK: Backup with different session names

  1. Beste, op zich een goede instelling.
    Ik zit allen met het volgende :
    zodra ik via de VI Client kijk in de
    properties van een VM verdwijnt de instelling
    weer uit het VMX bestand.
    Herken je dit probleem??

  2. Klopt het dat je gebruik maakt van VirtualCenter 2 voor het beheren van de VI3 omgeving?

    Zoja dan is de volgende post van Luca in het volgende topic http://www.vmware.com/community/thread.jspa?threadID=70253&start=40&tstart=0 de oplossing.

    I’ve noticed that if Virtual Center is managing my VM, I cannot edit manually the .vmx files on the host because Virtual Center is handling this file and will overwrite my modification.
    One solution is to add the parameter in the Advanced Configuration panel of the guest, but this is possibile only if the Guest is powered off.
    Another solution is to deregister the host from Virtual Center, modify all the .vmx on the host and then reregister it with Virtual Center but it is not very comfortable.

    Do you know if there are other solutions for safely adding this parameter to the .vmx without powering off the guest?

    In ESX 2.5 it was a lot easier 🙂

    TIA.
    Regards,
    Luca

    Succes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.