In this short tutorial i will show you how to backup guests by ghettoVCB on VMWare ESXI to OMV over SSHFS
Setup basic way ghettoVCB on VMWare ESXI
Enable SSH on your VMWare ESXI and login to it ( e.g. by Putty )
Change directory to /vmfs/volumes and list datastores
cd /vmfs/volumes/ls
Now you will see list of datastores. There should be at least one datastore ( eg. datastore1 )
Perfect situation is when you have two datastores, one for production and one for backup.
But if not and you have enough space on one – this is ok too
I will show two datastores version but if you got one, just create Backups folder and ghettoVCB folder on this one datastore.
cd datastore2mkdir Backups ghettoVCBwget –no-check-certificate https://github.com/lamw/ghettoVCB/archive/refs/heads/master.zipunzip master.zip -d ghettoVCB/
Your /vmfs/volumes/datastore2/ghettoVCB/ghettoVCB.conf should look like this
VM_BACKUP_VOLUME=/vmfs/volumes/datastore2/Backups/DISK_BACKUP_FORMAT=thinVM_BACKUP_ROTATION_COUNT=1POWER_VM_DOWN_BEFORE_BACKUP=0ENABLE_HARD_POWER_OFF=0ITER_TO_WAIT_SHUTDOWN=3POWER_DOWN_TIMEOUT=5ENABLE_COMPRESSION=0VM_SNAPSHOT_MEMORY=0VM_SNAPSHOT_QUIESCE=0ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0ENABLE_NON_PERSISTENT_NFS=0UNMOUNT_NFS=0NFS_SERVER=172.30.0.195NFS_VERSION=nfsNFS_MOUNT=/nfsshareNFS_LOCAL_NAME=nfs_storage_backupNFS_VM_BACKUP_DIR=mybackupsSNAPSHOT_TIMEOUT=15EMAIL_ALERT=0EMAIL_LOG=0EMAIL_SERVER=auroa.primp-industries.comEMAIL_SERVER_PORT=25EMAIL_DELAY_INTERVAL=1EMAIL_USER_NAME=EMAIL_USER_PASSWORD=EMAIL_TO=auroa@primp-industries.comEMAIL_ERRORS_TO=EMAIL_FROM=root@ghettoVCBWORKDIR_DEBUG=0VM_SHUTDOWN_ORDER=VM_STARTUP_ORDER=
Your /vmfs/volumes/datastore2/ghettoVCB/vm_list is a file with vm name list ( one per line ), names like in ESXI admin backend.
Files above can be created by vi editor or remotely by for eg. WinSCP + Notepad++.
Install SSHFS on OMV and mount VMWare ESXI datastore to OMV by sshfs
Login to your OMV by ssh and install or update sshfs, make mountpoint for ESXI datastore,
paste ESXI ssh root public key and logout.
apt install sshfsmkdir /mnt/your_esxi_hostnamemkdir /root/ssh_mount/.ssh/nano /root/ssh_mount/.ssh/id_rsa
Paste public VMWare ESXI key, ctrl+x next yes, [Enter]
logout
Go to OMV backend [System -> Scheduled Tasks] and create new task.
[Enabled] Check checkmark,
[Time Of execution] select [At reboot]
change ESXI_FQDN to your domain or ip address,
[Command] sshfs -o auto_cache,cache=yes,kernel_cache,compression=no,allow_other,default_permissions,reconnect,identityfile=/root/ssh_mount/.ssh/id_rsa root@ESXI_FQDN:/vmfs/volumes/datastore2/Backups/ /mnt/your_esxi_hostname/
[Tags] Type SSH ESXI Mount
[Save]
Next run newly created task, and check if there are no errors in console.
Remotly run ghettoVCB on VMWare ESXI at 23:00 everyday.
Go to OMV backend [System -> Scheduled Tasks] and create new task.
[Enabled] Check checkmark,
[Time Of execution] select [Certain date]
[Minute] [0]
[Hour] [23]
change ESXI_FQDN to your domain or ip address,
[Command] ssh root@ESXI_FQDN -i /root/ssh_mount/.ssh/id_rsa /vmfs/volumes/datastore2/ghettoVCB/ghettoVCB.sh -g /vmfs/volumes/datastore2/ghettoVCB/ghettoVCB.conf -f /vmfs/volumes/datastore2/ghettoVCB/vm_list
[Tags] Run ghettoVCB backup on ESXI
[Save]
Next run newly created task, and check if there are no errors in ghettoVCB console output.
Setup Rsync task on OMV to copy backuped guests at 23:30 everyday.
Go to OMV backend [Services -> Rsync -> Tasks] and create new task.
[Enabled] Check checkmark,
[Type] select [Local]
[Source shared folder] select one that contains /mnt/your_esxi_hostname
[Destination shared folder] select destination backup folder on OMV
[Minute] [30]
[Hour] [23]
[Send command output via email] Check checkmark,
[Extra options] -v -h -S
[Tags] Copy Backup ESXI -> OMV
]Save]
Next run newly created task, and check if there are no errors in Rsync console output.
You may reboot your OMV to bee sure that mount at boot goes correctly.
After this setup yours OMV nas will be doing procedure:
1. Every boot OMV will mount ESXI by sshfs to mountpoint /mnt/your_esxi_hostname
2. Everyday at 23:00 OMV will connect to ESXI and run ghettoVCB
3. After 30 minutes at 23:30 OMV will copy ESXI backup folder to OMV destination folder