I recently created an NFS datastore on ESXi, linked to a Windows Services for Unix (WSFU) share on my backup, Windows XP machine. The purpose of the datastore was to store virtual machine backups. The next step in the process is to configure ghettoVCB to perform the VM backups.
In VSphere, browse datastore1. Upload the zip file to that datastore (through VSphere client), connect to the Tech Support mode via PuTTY, and extract the contents of the tarball. The process is as follows:
tar -zxvf ghettoVCB.tar.gz‘.
I created a list of virtual machines to backup. The list was just one VM to begin with, Ubuntu 10.04. I called the list ‘myvmdk.vmdk’.
chmod 777 ghettoVCB.sh‘ to set the permissions.
You’ll need to edit the ghettoVCB.sh file for your individual installation. Most of the lines you can leave the as-is but there are a few near the top that will need changed. They are fairly self-explanatory. You’ll be able to see my configuration settings in the screen shot in the next section.
Run the backup manually
I then tested my setup by typing ‘
./ghettoVCB.sh -f myvmdk.vmdk -d debug‘. Depending upon how large your virtual machine is, the job could take a little while to run. Fortunately the progress is shown at the bottom of the screen. Once the job has completed, it will look like the following screen shot.
Automating the backup job
You’ll need Plink.exe on the Windows machine. You can get it from here. I downloaded it, and moved it to C:\.
Now you can create a simple batch (.BAT) file with your backup command in it, that can be scheduled via the Windows scheduler. Open Notepad. Type ‘
C:\plink.exe root@<ip_address_of_ESXi_host> -pw <password> "/vmfs/volumes/datastore1/ghettoVCB/ghettoVCB.sh -f /vmfs/volumes/datastore1/ghettoVCB/myvmdk.vmdk -d debug“‘, replacing <…> with your information. Save the file on the Windows machine with a .BAT suffix.
Before you schedule the task, you’ll need to take care of a housekeeping issue. Highlight the command and paste it into a command window on the Windows box. You will likely receive a message the first time saying the server’s host key is not cached in the registry. Go ahead and answer ‘y’es to storing the key in the cache.
Now you can set the task to run as a scheduled task in Windows, just as you would any other task. I set mine to run once a week in the middle of the night.
I noticed that, despite me setting the parameter for the backup to be thin provisioned, the backups were still full-size. This will get researched in the near future but right now this serves my immediate need.