I recently began my foray into the world of Vsphere and ESXI 4 after purchasing a Dell Poweredge 2970 server. The installation was smooth and the environment ran flawlessly. There was only one problem.
BACKUPS?
Since I was using the free version of ESXI 4.0, there wasn't any method of backing up my virtual machines that I could find. VMware forced all of it's partners, including Veem and others to cease supporting the free version of ESXI. I had read a few things about something called "ghettovcb.sh" in the forums, but I hadn't pieced it all together.
ESXI 4 thankfully comes with a VCB license, so this is a viable option. What the shell script basically does, is takes a few user provided parameters and performs a rolling backup of your machines based on those inputs. Now the big downside to this is that you have to have some of the following in place:
- A SAN
- NFS Network Shares
- Separate Local Disks
The VCB backup system used by ghettovcb is unable to move the directories anywhere else. Of the above, the SAN was completely out, and I didn't feel like being restricted to a single disc for backup purposes. Because NFS is a fairly simple protocol to setup, I merely elected a 500 gig share on a Linux server (Since it's all I run) and mounted it to the ESXI server with it's built in tools.
Once mounted, we'll say it was to /vmfs/nfs you just tell the ghetto VCB script to backup it's files to /vmfs/nfs and it's pumping everything out over the network.
Awesome! Now you've got your backups running via ghettovcb! One more problem. Cron in the shell available to the ESXI environment isn't exactly perpetual. Granted, you can schedule your backup there, but once the machine is restarted, you lose all of your settings. Thus, the intelligent thing is to schedule the job somewhere else.
PLINK?
I had read in a lot of places that people used "plink" in windows to schedule stuff through the windows scheduler. What they were basically doing is using the putty tools application called plink to connect, perform actions, and then disconnect via the windows scheduler. This was a problem for me.
I started pulling completely out of the Microsoft game a while ago, and I don't want to be tied to a system just so I can perform backups, so I started investigating plink. Sure enough, Plink is available as a command line tool to ubuntu in the putty-tools package. Once downloaded and installed via apt, plink is ready to go in linux.
Here's my cron job:
plink root@ip.address.he.re -pw "password"
/vmfs/volumes/datastore1/ghettovcb.sh -f
/vmfs/volumes/datastore1/backuplist mailx -s "ESXI Backup Results" emailaddress@domain.com
The beauty of this is having it scheduled on one of your ESXI machines, in this case, my web server. It's always on when the ESXI server is, and it's configured to relay through my mail server. The very last part of this string is a mailx command that sends me the output of the script via email.