ghettoVCB VIB & offline bundle for ESXi

It is still amazing to see that the number of contributions and suggestions from the community continues to grow for my free and simple VM backup solution called ghettoVCB. I created ghettoVCB almost 8 years ago which now has over 1.2 million views, pretty insane if you ask me! Although I am quite busy these days which includes a new born, I still try to find time to update the script as time permits. A couple of weeks back I received an email from one of my readers who came across ghettoVCB and was quite happy with the free solution. He also had some feedback asking why I did not provide an installable VIB for ghettoVCB?

A totally valid question and the answer was quite simple. When I had first created ghettoVCB back in the classic ESX 3.x days, the concept of a VIB had not existed yet. With the release of ESXi 5.0, the idea of the VIB was introduced but it was only recently in 2012 did VMware publish a method for customers to create custom VIBs for ESXi using the VIB Author Fling. I do have to admit at one point I did think about providing a VIB for ghettoVCB, but I guess I never went through with it for whatever reason. Looking back now, this was a no-brainer to provide a simplified user experience and not to mention the benefit of having ghettoVCB installed as a VIB is that it will automatically persist on ESXi after reboots which was a challenge for new users to ESXI.

So without further ado, here is ghettoVCB provided in either a VIB or offline bundle form:

One additional thing I would like to point out is that you can also quickly tell which version of ghettoVCB is running by inspecting the installed VIB by using the following ESXCLI command:

esxcli software vib list -n ghettoVCB

If you look at the screenshot above, I have highlighted two important pieces of information in green. The first is the "Description" property which includes the Github commit hash of the particular revision of ghettoVCB and the "Creation Date" property which contains the date of that commit. This can be handy if you want to compare it to the latest ghettoVCB repository found on Github here. Thanks again Markus for the suggestion!

For those of you who are interested in the details for creating your own ghettoVCB VIB, the next section is specifically for you. Earlier this week I blogged about a Docker Container that I have created to help build custom ESXi VIBs and as you can see now, that was the basis for us to be able to quickly create ghettoVCB VIB based on the latest revision of the script.

Step 1 - Create a new Docker Machine following the steps outlined here.

Step 2 - Login to the Docker Machine and create a new Dockerfile which contains the following:

Step 3 - Next we need to build our new Docker Container which will use the VIB Author Container by running the following command:

docker build -t lamw/ghettovcb .

The output will be quite verbose, but what you will be looking for is text highlighted in green as shown in the screenshot above. You should see the successful build of both the VIB and offline bundle as well as Docker Container showing a successful build.

Step 4 - After a successful build of our Docker Container, we can now launch the container by running the following command:

docker run --rm -it lamw/ghettovcb

Once logged into the Docker Container, you will see the generated VIB and the offline bundle for ghettoVCB as shown in the screenshot above.

If you wish to copy the VIB and offline bundle out of the Docker Container into the Docker Host, you can use Docker Volumes. I found this useful thread over on Stack overflow which I have modified to include the copying of the ghettoVCB VIB and offline bundle out to Docker Host by running the following command:

Finally, to copy the ghettoVCB VIB from the Docker Host to your desktop, we first need to identify the IP Address given to our Docker Machine by running the following command:

docker-machine ip osxdock

Currently, Docker Machine does not include a simple "scp" command so we will need to use regular scp command and specify the private SSH keys which you can find by running "docker-machine inspect [NAME-OF-DOCKER-HOST]" and connecting to our Docker Host to copy the ghettoVCB VIB by running the following command:

No, ghettoVCB only supports full backups as it clones the source VM. For more advanced/efficient backup mechanism you’ll need to look at commercial products like vSphere Data Protection as an example which is included in all paid versions of vSphere

In the blog post you say there is a config file at /etc/ghetto/ghettoVCB.conf which is not the case. It’s under /etc/ghettovcb/ghettoVCB.conf
But the bigger issue is that I can’t edit and of the files in that folder. If I try to use vi to edit any of the files under /etc/ghettovcb I get a message saying “Operation not permitted”

But I was able to copy ghettoVCB.conf to myconfig.conf and then edit that. Which is likely what you intended in the first place, but it’s not clear at first.

2) Could you add the outgoing port 25 firewall rule to your VIB as well? Currently I have my own VIB that I use for that, but it would be really nice if both ghettoVCB and the port 25 firewall rule could just be a single VIB.

Many thanks for VIB/bundle of this great tool! Just one question, how is it now with config-file? I think /etc is non-persistent, so any change I do to /etc/ghettovcb/ghettoVCB.conf will be lost after reboot. Or am I wrong?

No,if you want to backup your configs, you can use the auto-backup.sh before rebooting. Thats backup your configs, but not all. Shell commands can be restore the configs by commands in /etc/rc.local.d/local.sh. Put in this your routines to restore the config in /etc’s. I have in datastore a folder with scripts and configs. You can’t edit the etc-files directly, edit this from datastore with copy promt to send etc-folders.

This has been a great solution for our remote offices. Thanks for all that you have done.
I ran into an issue today testing upgrading hosts to ESXI 6 via the vSphere Update Manager. During the upgrade process, it errors out with the following error. Is there a way around this without uninstalling ghettoVCB?

In Esxi 6 free, I start my script with crontab. My script savevm.sh calls ghettovcb.sh but it doesn’t wait the end of this. How I can call ghettovcb.sh and wait the results BEFORE continuing with the other lines of my script ? Thanks you for your answer and for your blog (and for ghetto, sure !)

For anyone interested, I created a Dockerfile that build the vib and offline bundle upon running (instead of building) the container. It also puts the vib/zip in /output which means you can run like ‘docker run –rm -v /tmp:/output ‘ and then find the biv/bundle in /tmp on your docker host. Repo is at https://github.com/tssgery/ghetto-container

This has been a great solution for our remote offices. Thanks for all that you have done.
I ran into an issue today testing upgrading hosts to ESXI 6 via the vSphere Update Manager. During the upgrade process, it errors out with the following error. Is there a way around this without uninstalling ghettoVCB?

The errors you getting are due to ESXi now using python 3.x instead of 2.7

If you are looking to keep using ghettoUI, I have made some crude changes and put the results at https://github.com/tssgery/ghettoVCB/blob/master/ghettoUI. It seems to run fine on ESXi 6.5. You will need to make sure that that your ghettoVCB.sh works on ESXi 6.x as well. I’d suggest you use the version in the base project repo but the version in mine should work as well.

If you are looking for steps to get the scripts working well, the instructions at https://communities.vmware.com/docs/DOC-8760 are pretty good. I followed them to get started and have since come up with my own process that make it really easy to change the configuration.

Hello Friends,
We have been running ghettovcb in user interactive mode(ghettoUI) so far successfully till vsphere version 6.0. However, after upgrading our hosts to vsphere 6.5 , the ghettoUI script stopped working giving errors “invalid syntax” . Its probably not going to work it that way anymore. However, can someone provide me with some steps about how to run ghettovcb script for taking backup of VMs on vsphere 6.5?? I would highly appreciate as I am not good with scripts myself.
A simplified step by step procedure if provided will surely help.
Best Regards

The errors you getting are due to ESXi now using python 3.x instead of 2.7

If you are looking to keep using ghettoUI, I have made some crude changes and put the results at https://github.com/tssgery/ghettoVCB/blob/master/ghettoUI. It seems to run fine on ESXi 6.5. You will need to make sure that that your ghettoVCB.sh works on ESXi 6.x as well. I’d suggest you use the version in the base project repo but the version in mine should work as well.

If you are looking for steps to get the scripts working well, the instructions at https://communities.vmware.com/docs/DOC-8760 are pretty good. I followed them to get started and have since come up with my own process that make it really easy to change the configuration.

Hello William,
Thank you very much for a great simple ESXi backup program.

I did find a flaw in the ghettoVCB-restore.sh script. On line 170 in the current git version, the line reads:
VM_ORIG_VMX=$(ls “${VM_TO_RESTORE}” | grep “.vmx”)

If there is a .vmxf file in the folder, subsequent usage of the VM_ORIG_VMX variable fails because it contains “.vmxLF.vmxf”. I fixed this by adding a $ in your statement as follows:
VM_ORIG_VMX=$(ls “${VM_TO_RESTORE}” | grep “.vmx$”)

I’m surprised nobody else came across this. Is there something unique as to why I have .vmxf files?

There’s a problem with snapshots on ESXi 6.5 and 6.7 VMs, the script doesn’t see that the VM has a Snapshot on it.
So ghettoVCB takes a Backup of the VM with the snapshot, but we won’t backup a VM with a snapshot.
We figured out to change delta/.vmdk to sesparse/.vmdk in 3 lines of the ghettoVCB.sh, the script see the snapshot and don’t take a backup.
But at the end of the log, it tells us everthing is fine.

Primary Sidebar

Search this website

Author

William Lam is a Staff Solutions Architect working in the VMware Cloud on AWS team within the Cloud Platform Business Unit (CPBU) at VMware. He focuses on Automation, Integration and Operation of the VMware Software Defined Datacenter (SDDC).