ESXI FREE 6.5.0 backup using ghettoVCB sh https://youtu.be/92Q42tfNHuc
ESXI FREE 6.5.0 backup using ghettoVCB sh Update 1 https://youtu.be/yqB6awYInFw
As of 02-03-2018
<color #ed1c24>NOTICE:</color> VMFS6 (Virtual Machine Version 11) or newer will not delete prior snapshots. This will cause an issue when restoring vms later. I have a fix below for this. _
<color #ed1c24>NOTICE:</color> Though I provide this version of the script you have the choice to update to the latest version Here. Also note that I don't own this file simply posting the version that was available at the time of creating the youtube videos above.
All credits go to the original creator: Here is his GitHub Page.
Install Debian 9 or later.
Setup Debian with no standard user just a root account will do!
mkdir /home/script/ mkdir /home/script/MOVE-TO-ESXI
Download each file needed for Debian below.
cd /home/script/
wget https://sesipod.info/DATA_FILES/ESXI/ghettoVCB/backup.txt wget https://sesipod.info/DATA_FILES/ESXI/ghettoVCB/runme.sh
Download each file needed for ESXI below.
cd /home/script/MOVE-TO-ESXI
wget https://sesipod.info/DATA_FILES/ESXI/ghettoVCB/ghettoVCB.sh wget https://sesipod.info/DATA_FILES/ESXI/ghettoVCB/vms_to_backup
nano /home/script/backup.txt
Change the following lines:
nano /home/script/runme.sh
Change the following lines:
nano /home/script/MOVE-TO-ESXI/ghettoVCB.sh
Change the following lines:
Add a VM name per line and then save / close the file.
nano /home/script/MOVE-TO-ESXI/vms_to_backup
Make the folders needed by the script. Open the datastore that you decided to use above for backups.
Make a folder called BACKUP-SCRIPT Make a folder called BACKUP-VMS
scp /home/script/MOVE-TO-ESXI/* root@esxiIPaddress:/vmfs/volumes/DRIVEtoUSE/BACKUP-SCRIPT/
ssh into ESXI and set ghettoVCB.sh as exactable.
ssh root@esxiIPaddress cd /vmfs/volumes/DRIVEtoUSE/BACKUP-SCRIPT/ chmod +x ghettoVCB.sh
cd /home/script/
./runme.sh
To check if worked check your Datastore and folder name for each vm you should see STATUS.ok
<color #ed1c24>NOTICE:</color>
If you don't see Remove snapshot like below then you will need to do the below Fix.
crontab -e
0 0 * * * /home/script/runme.sh
<color #ed1c24>Fixes:</color>
On the Debian server make a rmsnapshot.txt that holds the VM ids for VMs you want to backup.
Run the following command and copy the id # for each vm that you want to backup - matching the vms_to_backup file.
vim-cmd vmsvc/getallvms | sed -e '1d' -e 's/ \[.*$//' | awk '$1 ~ /^[0-9]+$/ {print $1":"substr($0,8,80)}'
cd /home/script/
nano rmsnapshot.txt
add a line per each vm add the id at the end.
vim-cmd vmsvc/snapshot.removeall 1 vim-cmd vmsvc/snapshot.removeall 2 vim-cmd vmsvc/snapshot.removeall 42
Add the following line to runme.sh
nano /home/script/runme.sh
sshpass -p 'esxiPW' ssh -o StrictHostKeyChecking=no root@esxiIPaddress < /home/script/rmsnapshot.txt
runme.sh should look like this once done.
sshpass -p 'esxiPW' ssh -o StrictHostKeyChecking=no root@esxiIPaddress < /home/script/rmsnapshot.txt sshpass -p 'esxiPW' ssh -o StrictHostKeyChecking=no root@esxiIPaddress < /home/script/backup.txt