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.)