EsxBack.net

 

A Windows tool to backup the disk files of a running VM from an ESXi server with a single click and zero downtime.
It’s compatible to ESXi v 4.0 and 4.1  (Maybe 3.5 & ESX too, but I’ve no chance to test it.)

 

Background:

From time to time I backup the VM’s on my ESXi server manually, just to have a copy in case of emergency or move it to another server for testing. My usual way of doing it would be using the ghettoVCB script or doing it completely manually. This is a very time consuming task that starts by creating a snapshot, clone the VM’s disk file, compress them and finally upload them to a server using ssh. Especially the upload process eats a lot of time. (Where I have to admit that it goes much faster on the 4.1 server.)
This is where EsxBack.net can spare you a lot of time. It is creating a snapshot, backups the disk(s) and download it’s to your local desktop (if you want) using a faster way instead of ssh with just one mouse click.
The drawback is that the download is not encrypted, but hey you should don’t use it over the internet, only in your lan. Since nearly all networks nowadays are switched, this is really no issue.


How does it look like ?

Beschreibung: C:\Users\fiege\Documents\Visual Studio 2010\Projects\EsxBack.net\Documents\Screenshots\Login.png
(Login screen)

 
Beschreibung: C:\Users\fiege\Documents\Visual Studio 2010\Projects\EsxBack.net\Documents\Screenshots\ReadyToBackup.png
(List of available VM’s)

 

Beschreibung: C:\Users\fiege\Documents\Visual Studio 2010\Projects\EsxBack.net\Documents\Screenshots\DonwloadingVM_2.png
(Copying selected VM)

Beschreibung: C:\Users\fiege\Documents\Visual Studio 2010\Projects\EsxBack.net\Documents\Screenshots\VM_Copied_2.png
(Copying completed)

What are my options in the GUI ?
In the top list you can select a VM and click “Start backup” to start the backup process.

If you tick the “Keep backup” checkbox, the backup will not be removed from the backup folder in ESXi’s datastore. If you keep it, you could also tick the checkbox that skips the loading process. (For scenarios where you just want to clone a running VM to import it in a new VM instance.)
You could also specify the remote and the local path’s to store the backups.
At the remote side you could use the #DATE# placeholder that well be replaced by the current date and time in this format: yyyyMMdd_hhmmss
The #NAME# placeholder will be renamed with the VM’s name.
The #DATE# placeholder is also available in the backup target path.

What do I need at the server side ?
Nothing, just enable ssh, that’s it. (On 4.0 this has to be done manually [there are tons of documents describing that task on google], on 4.1 you can do it using the servers new gui.)

How does it work from a technical point of view ?
EsxBack.net open’s an ssh tunnel to create the snapshots clones the VM, transmits it using netcat to the workstation, removes the cloned files and finally removes the snapshot.

netcat ? There is no netcat on the ESXi server!
Right, EsxBack.net copies a version that runs on ESXi to the server.
(Therefore you should use the root account for the backup task [or any user that has write access to /bin]).
If this is an issue to you, you’d better don’t use EsxBack.net !

Is there anything else I have to take care of ?
Yes: Apply all snapshots of the VM (or revert them, however) !
To create a backup of a running VM, we have to create a snapshot (this is the most common way to create backups of running VM’s on all major virtualization platforms I know!). If there are older snapshots, the backup would not contain all other snapshots what could cause a lot of confusion.
So I decided to go the way, that there are no snapshots allowed when doing backups.
EsxBack.net will check for snapshots before backing up and will complain about any!

So it’s just backing up the data disks, not the meta data like VM configuration and state ?
Yes, that’s right (maybe for now), this wasn’t one of my primary requirements since you can simply create a new VM using vSphere Client. (It’s just a few clicks…)
[The backup will include the *.vmdk and the *-flat.vmdk file for every active disk of a VM.]


What about data compression?
Currently the data will be piped from gzip to netcat, what brings a fair compression ratio and saves the time for a file compression.
This could be increased by using 7zip, but this needs further investigation about the compatibility to ESXi. I did some testing with the result, that every back upped disk will be about 30% smaller in size.

What if I found a bug ?
Please file any found bug on the source forge tracker

What are the system requirements at the client side ?
Any modern Windows (W32  >=XP) with an installed .NET Framework in version 4.0

So far so good, but I can’t schedule a task for it ?
No, currently not, but the code is prepared to have a command line version of it.
(It’s not done, but hey this is open source. Just grab the source, take Visual Studio 2010 Express and start programing!)

 

Know limitations :
There is currently some kind of glitch when using complex names for the backed up VM.
I know that, I will fix it, but for now I want to get the code spread. If you keep the original VM’s name and just use a prefix or postfix everything should work like a charm.

I re audited the code on 20110827 and did some testing. It turned out everything should work like expected, there was no glitch.

License
EsxBack.net is licensed under the GPL v3 or later.

Where can I download it ?
Downloads can be found here:
https://sourceforge.net/projects/esxbacknet/files/

 

Where is the sourceforge project page ?
Here: https://sourceforge.net/projects/esxbacknet/

Can you give me some pokes ?
Ahhhm no, sorry pokes are only available on C64.

But I can give you a hint: If you don’t want to enter the login data every time you start EsxBack.net, you can create a file called c:\tmp\EsxBack.net that contains this three lines:
Username
Password
ESXiHost’s IP-Address

EsxBack.net is trying this data as login credentials. (I used this while development and find it quite useful. O.K., a built in password manager with a save function would do better... Who knows maybe in the future… )

 


Take care

Fiege 

 

 

EsxBack.net depends on this third party librarys/tools
netcat (GNU netcat licensed under the GPL)
Project homepage (source can be found there): http://netcat.sourceforge.net/
Located as ELF binary in program folder, expanded from release RPM 0.7.1.

SharpSSH (c) by Tamir Gal
Project homepage http://sourceforge.net/projects/sharpssh/
Licensed under a BSD-style license, license is located in program folder

Mentalis Security dll & DiffieHellman.dll\n(c) 2002-2003, The Mentalis.org Team
Project homepage http://www.mentalis.org/
License is located in program folder

                                              

Version history

 

20110825-v 0.9 

Initial release

20110827-v 0.91

Wait phase function for snapshot creation enhanced
Documentation  update(this file)
Added transmission port (used for VM download to client) to the app.config file. This doesn’t follow the “least privilege” principle because it could need administrator rights if EsxBack.net is located in the programs folder, but it’s much better than a hard coded value.
(By adjusting it on runtime it is possible to backup several VM at the same time  from the same host. [Not that I would suggest it, but if your hardware has enough resources…])

 


Legal information:

Windows, Visual Studio, XP, C# & .NET are registered trademarks of Microsoft Corporation in the United States and other countries.  (http://www.microsoft.com)

VMware is a registered trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other jurisdictions. (I found no information about trademarks on ESX or ESXi on their web site 25.08.2011-21:48 , so if they are trademarked too, it is mentioned by this.)