VMware
1 2 3 ... 31 Previous Next 453 Replies Last post: Sep 30, 2009 8:55 AM by cincinnerdi   Branched to a new thread.

Free ESXi Backup Solution for Windows posted: Aug 20, 2008 8:09 AM

Click to view ChrisInTexas's profile Lurker 4 posts since
Aug 20, 2008

I have spent the last few days trying to find a free backup solution to the newly free ESXi for windows only enviroments (in particular Windows XP). The solution for me was the following:

1. Installing Windows Services for UNIX (WSFU)
2. Copying the ESXi Server password and group files to Windows
3. Configuring WSFU for accepting ESX Server connections
4. Sharing the Windows folder for NFS compatibility
5. Configuring the ESXi Server to mount the Window NFS Share as Datastore.
6. Setup Backup Script

Attached is the complete steps.

I take NO credit for any of this. This is just a complation of others work formated to suit my needs and felt others could benift from it as I have.

http://vmblog.com/archive/2007/01/23/using-windows-based-nfs-in-vi3.aspx by Jason Mattox from Vizioncore (direct copy of his work, I just added more information to make it work in Windows XP)
http://support.microsoft.com/kb/891760 (NFS Server port information)
http://communities.vmware.com/thread/162418?tstart=0 by robink (The backup script)
http://www.yellow-bricks.com/2008/08/10/howto-esxi-and-ssh/ (ssh on ESXi)

Re: Free ESXi Backup Solution for Windows

1. Aug 22, 2008 3:45 AM in response to: ChrisInTexas
Click to view sanbe's profile Novice 5 posts since
Jan 11, 2008
I've another way to backup my VM's on the Free ESXi.

1. Installing VMware Remote CLI

2. Edit all variables to your environment in the attached ESXi-Backup.pl

3. If needed set that script on shedule


Hope this would help some ppl.
Regards


Attachment was edited by: sanbe

Attachments:

Re: Free ESXi Backup Solution for Windows

2. Aug 22, 2008 5:16 AM in response to: ChrisInTexas
Click to view nick.couchman's profile Champion 4,969 posts since
Jan 13, 2006
Haven't tried it, yet, but for those UNIX gurus out there, you can probably enable SSH and then use rsync to copy the files over SSH to a backup location. The downside, of course, is that you'll incur some high CPU overhead for the encryption (and compression, if you use that, too) of SSH.

Re: Free ESXi Backup Solution for Windows

3. Aug 22, 2008 6:40 AM in response to: nick.couchman
Click to view sanbe's profile Novice 5 posts since
Jan 11, 2008
-

Message was edited by: sanbe

Re: Free ESXi Backup Solution for Windows

4. Aug 22, 2008 5:52 AM in response to: nick.couchman
Click to view Peter_vm's profile Guru 9,058 posts since
Feb 1, 2006
nick.couchman wrote:
Haven't tried it, yet, but for those UNIX gurus out there, you can probably enable SSH and then use rsync to copy the files over SSH to a backup location. The downside, of course, is that you'll incur some high CPU overhead for the encryption (and compression, if you use that, too) of SSH.
rsync ? Probably not. It is not a part of ESXi.
But you can do it with scp (lots of clients available).

Re: Free ESXi Backup Solution for Windows

5. Aug 22, 2008 6:05 AM in response to: Peter_vm
Click to view nick.couchman's profile Champion 4,969 posts since
Jan 13, 2006
Nevermind...forgot rsync has to be present on the remote host, as well. Doh!

Re: Free ESXi Backup Solution for Windows

6. Aug 22, 2008 6:57 AM in response to: nick.couchman
Click to view Peter_vm's profile Guru 9,058 posts since
Feb 1, 2006
I have also observed that NFS copy seems to run much faster (25MB/s vs. 4MB/s) compared with SCP copy and take less CPU resource (30% vs. 35%) on ESXi host (single cpu P4 3.0GHz though).

Re: Free ESXi Backup Solution for Windows

8. Aug 22, 2008 7:09 AM in response to: Peter_vm
Click to view nick.couchman's profile Champion 4,969 posts since
Jan 13, 2006
The encryption/compression overhead I mentioned :-)...

Re: Free ESXi Backup Solution for Windows

9. Oct 1, 2008 5:30 AM in response to: sanbe
Click to view kchawk's profile Enthusiast 44 posts since
Mar 19, 2007
sanbe, script works great. I have added to it to allow the tar gzip from gnuwin for compression. Do with it what you will.

Working on the restore script now.

I wrote a php script using the rcli on linux. It gets the list of vms and files, creates snap if needed and backups the files, then

removes snaps.

I have tested on three esxi servers that have anywhere from two vm to three.

Message was edited by: kchawk

Attachments:

Re: Free ESXi Backup Solution for Windows

10. Oct 1, 2008 7:02 AM in response to: kchawk
Click to view kpc's profile Enthusiast 98 posts since
Jul 12, 2006

nice work kchawk and sanbe - I'm going to try it out this week but using just linux and maybe incorporating it all into one perl script.
Cheers

Re: Free ESXi Backup Solution for Windows

11. Oct 3, 2008 2:06 PM in response to: kpc
Click to view Nathan Pease's profile Novice 14 posts since
Apr 5, 2008

I am trying to do something similar, but in Linux. What files need to be copied to backup a running VM? I have tried copying the following files:

NS3-flat.vmdk
NS3.nvram
NS3.vmdk
NS3.vmsd
NS3.vmx
NS3.vmxf

If I copy them while the VM is powered down, I can restart the copied machine in a diffrent location with no problem. If I take a snapshot and then copy the same files, while the machine is running on the snapshot, I can't turn on the copied machine. I get a file missing error. I was trying to read the pearl script, but I am very good with pearl. I see this line in the script, but I am not sure what it does.


#remove the "\n" at the end of $filename to prevent a error massage in log
chomp($filename)
&actualtime();
print "


Copy File: ";
print $filename;


Re: Free ESXi Backup Solution for Windows

12. Oct 3, 2008 2:29 PM in response to: Nathan Pease
Click to view Dave.Mishchenko's profile Guru 8,943 posts since
Nov 15, 2005
At a minimum you really just need the VMDK (and flat.vmdk) file. The VMX can be easily recreated.

When you create a snapshot on a VM, the VMX file is updated to point to the snapshot VMDK file (i.e. <vm-name>-000001.vmdk) instead of the main VMDK file. That's why you can't power it on once you've copied it. You could instead do this

1) Copy the VMX file
2) Take a snapshot
3) copy the VMDK
4) Remove the snapshot.

You would then be able to start that copy on another host.

Re: Free ESXi Backup Solution for Windows

13. Oct 3, 2008 4:56 PM in response to: Dave.Mishchen…
Click to view Nathan Pease's profile Novice 14 posts since
Apr 5, 2008
That works, thanks!

Re: Free ESXi Backup Solution for Windows

14. Oct 6, 2008 9:58 AM in response to: Nathan Pease
Click to view Nathan Pease's profile Novice 14 posts since
Apr 5, 2008

I now can backup my VM's manually and am witting a bash script to do it automatically. I have the remote cli tools installed on a remote Ubuntu server. I am trying to remotely take a snapshot of my VM's during the backup script, but the snapshotmanager.pl gives me an error. Here is the command I am running to my ESXi servers and the error I get. This should be the last piece to make my script work. Any ideas?


root@backup:/backup/# perl /usr/lib/vmware-viperl/apps/vm/snapshotmanager.pl --url https://xxx.xxx.128.21:443/sdk/vimService --username xxxx --password xxxx --operation create --powerstatus poweredOn --snapshotname backup
Error: Server version unavailable at 'https:/xxx.xxx.128.21:443/sdk/vimService.wsdl' :1: parser error : Start tag expected, '<' not found
LWP will support https URLs if the Crypt::SSLeay module is installed.
^ at /usr/local/share/perl/5.8.8/VMware/VICommon.pm line 323


1 2 3 ... 31 Previous Next Go to original post

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities