VMware Cloud Community
ChrisInTexas
Contributor
Contributor

Free ESXi Backup Solution for Windows

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.

by Jason Mattox from Vizioncore (direct copy of his work, I just added more information to make it work in Windows XP)

(NFS Server port information)

by robink (The backup script)

(ssh on ESXi)

Tags (3)
0 Kudos
522 Replies
IT_Architect
Enthusiast
Enthusiast

False

Good to hear. I will be using a Windows 2008 Web Edition server to schedule the backups using your script as per the instructions. With no compelling reason to change, I'll be sticking with U3 for awhile, not only for feature reasons, but also because it has a good record built up for performance and reliability.

Thanks!

0 Kudos
holgate
Contributor
Contributor

Hi lawm: thanks for the script(s)! A quick question: I'm getting the following error on ESXi 3.5U4 (logged in as root):

./ghettoVCB.sh vmbackups

Failed to login: vim.fault.NoPermission

Error: failed to extract VM_ID for datastore1/foobar

The problem is apparently with the initial "vim-cmd /vmsvc/getallvms", which produces the same error when run separately -- any suggestions? (I'd reply on the dedicated thread, but that doesn't appear to be working now.)

0 Kudos
lamw
Community Manager
Community Manager

Interesting ...

Can you run the following manually without any errors:

vim-cmd vmsvc/getallvms

I don't have an ESXi 3.5u4 system to test with, so I'll have to rely on some steps to see what might be the issue. I'm hoping this has nothing to do with the ESXi 3.5u4 lockdown, it should only affect remote API calls to the host.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
holgate
Contributor
Contributor

Thanks for such a quick response:

*vim-cmd vmsvc/getallvms*

from the command line produces the same error: "Failed to login: vim.fault.NoPermission."

0 Kudos
lamw
Community Manager
Community Manager

hmmm, if you're logged in as root, you should have full permissions. I'm wondering if the fix also somehow disabled vimsh wrapper from executing any local commands? It's odd because you're already logged in as root. Without a system of my own, I can't really do further debugs, I was not aware of any changes to the unsupported console that would prevent you from executing the vim-cmd as you would on classic ESX Service Console with vmware-vim-cmd

I'll need to ask around to see if theres something more to this.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
DSTAVERT
Immortal
Immortal

lamw

I have had it running on U4, I also have no problem with the command line either.

-- David -- VMware Communities Moderator
0 Kudos
holgate
Contributor
Contributor

Hm. Looks as if the problem isn't with the script, but with some element of the ESXi internals: The logs are showing this:

[2009-04-24 02:10:35.736 'ha-eventmgr' 81926 info] Event 20879 : Failed to login user root@127.0.0.1: No permission
[2009-04-24 02:10:35.736 'Vmomi' 81926 info] Activation [N5Vmomi10ActivationE:0xac72610] : Invoke done [login] on [vim.SessionManager:ha-sessionmgr]
[2009-04-24 02:10:35.736 'Vmomi' 81926 info] Throw vim.fault.NoPermission
[2009-04-24 02:10:35.737 'Vmomi' 81926 info] Result:
(vim.fault.NoPermission) {
   dynamicType = <unset>, 
   object = 'vim.Folder:ha-folder-root', 
   privilegeId = "System.View", 
   msg = ""
}

But the only reference to that particular error is in relation to VMWare Server 2. I'll do some more digging.

0 Kudos
lamw
Community Manager
Community Manager

Thanks for the confirmation.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
lamw
Community Manager
Community Manager

Yea it looks like the system is having issue with it makes a call internally and it's failing. Have you made any changes to the system lately or do anything on the unsupported console. I would recommend rebooting the host if you can to see if the issue goes away.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
DSTAVERT
Immortal
Immortal

Spelling in backup file or backup destination in script.

-- David -- VMware Communities Moderator
0 Kudos
krrunal
Contributor
Contributor

Gooday Sanbe,

I just came around thisuseful thread of backingup VMs using VMware Remote CLI used along with the perl. The start of the question is i install the Remote CLI from vmware and when i run the attached.pl script in windows from cmd prompt it brings the error saying that

"Can't open perl script "C:/Progra1/VMware/VMware1/Perl/apps/vm/snapshotmanager.pl: No Such file or directory. Do i have to change anything in variable path my $RCLIPath = "C:/Progra1/VMware/VMware1". I tried to change the path to but then it doesnt recognise at all. Help please as i am not with scrpting at all.

0 Kudos
KBuchanan
Enthusiast
Enthusiast

Did you install the RCLI software?

Kevin

0 Kudos
N20Steve
Contributor
Contributor

Hello,

New to VMWare, and I'd like to say thanks to everybody who has contributed to this thread - Incredibly useful.

I've got the script running, and it seems to be exactly what I need. However, I have a question that will confirm my 'newbie' status with virtualisation:

Is it the case that this script can be used to back up a running server, with no need for any server downtime?

Thanks a lot for reading.

Steve.

0 Kudos
KBuchanan
Enthusiast
Enthusiast

Yes...but if you restore, it will be as though the server was "unplugged"...ie, a hard shutdown.

That may not be good for some databases or other open files. There isn't a quiesce for the data.

Kevin Buchanan

Chief Information Officer

Lexington Memorial Hospital

336-238-4286

kbuchanan@lexmem.org

0 Kudos
N20Steve
Contributor
Contributor

Many thanks for such a fast reply. Much appreciated.

And for my next question...

What is the best method to backup a server without taking it down? The solution doesn't need to be free!

Thanks again.

Regards.

Steve.

0 Kudos
KBuchanan
Enthusiast
Enthusiast

Good advice. Test backup and restore NOW. And have a written recovery plan. You don't want to have to fly by the seat of your pants if you have an unplanned downtime. I've scripted all of our backup and recoveries.

Kevin Buchanan

Chief Information Officer

Lexington Memorial Hospital

336-238-4286

kbuchanan@lexmem.org

0 Kudos
N20Steve
Contributor
Contributor

Hi,

That's exactly why I'm undertaking this exercise. It's for a new office installation - Brand new Proliant server, RAID5, with a 'hot spare' drive. I want to implement a system that will give the fastest possible recovery time in the event of a problem. The server will be virtualised purely to ease the backup and recovery burden.

At the moment I'm experimenting with options as I want it to be as bomb-proof as possible. If there's a neat and safe way to take a regular backup of the running server then that would be great. The data will (regardless of this issue at hand) be backed up daily to two remote (another building, but on the same LAN) NAS devices, and weekly to tape. I just want to have a 'belt and braces' arrangement with a complete backup of the server that could be restored in a (virtual!) blink of an eye.

The NAS boxes already exist, and there isn't budget/scope for multiple replicated servers, so this would be a reasonable halfway house.

Cheers.

Steve.

0 Kudos
KBuchanan
Enthusiast
Enthusiast

Gothca. If you're running the VIMs locally, then, I suggest to load ESXi on 1 partition, so that you can separate the Host and guest o different partitions. If you have to reload ESXi, then it will not mess with the VMs.

Also, get a written documentation of the network config.

Good luck!!

Kevin Buchanan

Chief Information Officer

Lexington Memorial Hospital

336-238-4286

kbuchanan@lexmem.org

0 Kudos
krrunal
Contributor
Contributor

i found the issue as the it was the short windows path name in declaring the variable. It took me 2 day to just find that. It should suppose to "C:\prog\VMWare\VMWare~4" instead of 1 at the end..Thanks to my manager Dennis Williams for finding that out for me.

0 Kudos
AlbertWT
Virtuoso
Virtuoso

Hi All,

Does this Method still working fine in ESXi 4 ?

Because at the moment I'm looking for a fast and free way to backup my 2x ESXi 4 servers into he SAN.

Kind Regards,

AWT

/* Please feel free to provide any comments or input you may have. */
0 Kudos