I’ve set up an ESXi 6.0 system on a HP Workstation Z240 and its running perfectly fine.
As i’ve some important machines running on that system the backup of them is quiet important for me. After doing some Google research i’ve found the quiet good and user-friendly tool HP VM Explorer. The drawback from my point of view is that is quiet expensive and after some more research i’ve found a good alternative: the OpenSource tool „ghettoVCB“.
That tool is available for free and well documented on the VMWare help pages. It is written by some Technical Specialist that works for VMWare and is also blogging about his Job. I like the script as it covers also he backup & recovery modes, it handles the house-keeping and can shutdown and startup the machines.
So this blog post is not about how you can setup the ghettoVCB scripts because the linked instructions are quiet good and can be followed easily. Its about working around the limited access to the ESXi operating system.
My problem with the scripting was, that i was unable to get the cronjob running. All the files are write-protected and even after granting permission (chmod +x) or moving the files as described the changes where not persistent. So after a reboot all changes are gone and so the backup couldn’t work. I guess the root cause of my problem was, that the file „/etc/rc.local.d/local.sh“ was also write protected and this is different from the given instructions. All the tricks didn’t work so i was looking for a workaround.
This workaround makes an easy use of another Unix machine. It doesn’t matter if this unix machine is running on the same ESXi host or somewhere else. So if you dont have a unix box available it would also be an usable approach to setup a small unix VM on your ESXi box that can execute this cronjob.
I’ve setup a new cronjob on my unix box that is connecting to the ESXi box. The problem in here was, that i couldn’t setup the Private/Public Key login as also these changes did not survive a reboot of the ESXi server. So i was looking for a workaround and found that nice shell tool „sshpass“. It was easy to install it using your designated package manager like yum or apt-get
yum install sshpass
Afterwards i’ve written a small shell script to connect and execute the command
#!/bin/sh sshpass -p <Password> ssh root@<IP> /opt/ghettovcb/bin/ghettoVCB.sh -m srv07 -g /vmfs/volumes/SSD1/auto-backup/ghettoVCB-srv07.conf -d info
My crontab on my unix box now looks like
0 1 * * 1-5 /root/backup_srv06.sh >> /var/log/cron-backup_srv06.log
This setup is now working out for me and i would also be happy, if someone has a solution that works in the expected way.