Hi all,
When backing up many virtual machines, you may try one of the big backup solutions, such as Symantec, Commvault, Veeam, and the like. Unfortunately in this case they all rely on one thing.
THE VMWARE API
There is a problem with the API. VMWare are aware there is a problem with it (calls were logged late last year about the problem) but so far there has been no response at all.
The problem is that when a backup of a VM happens, it takes a snapshot of the machine.
The machines base disk and other chuff is backed up, then the snapshot is released. What is happening (to many people) is that the snapshot is removed from the snapshot manager, but the snapshot file is not deleted, and the deltas are still written to the snapshot.
Luckily(!) for me, my luns filled up and bombed out after 2 snapshots. There are reports out there that if you have 25 of these "ghost snapshots" then you start running into problems. For example redo log errors. The fix is easy enough, although a pain in the arse. Basically just run the convertor against it, and itll roll all the snaps together. Don't faff with the command line unless you really have to.
Anyhew, there is one option. In version 4.1 VCB still works. So you can use that. I have written a script you can use, usual terms apply. By usual terms I mean, if this fucks your environment its not my fault. Lose data, it's not my fault.
Here is the code:
Dim fso, ts, weight
weight=0
Const ForWriting = 2
set ofso2 = createobject("scripting.filesystemobject")
set ofiletemp = ofso2.opentextfile ("servers.txt", 1)
set cline = createobject("wscript.shell")
'----------------------------------------------------------------------
do while not ofiletemp.atendofstream
weight = weight + 1
servername = ofiletemp.readline
if weight < 6 then
'msgbox servername
fullpath = "vcbmounter -h [yourVCname] -u username -p Password -a name:" & servername & " -r e:\vmbackups\" & servername & " -t fullvm -m nbd"
cline.run fullpath, 1, False 'lets another copy open "NBD!!"
else
fullpath = "vcbmounter -h [yourVCname] -u username -p Password -a name:" & servername & " -r e:\vmbackups\" & servername & " -t fullvm -m nbd"
cline.run fullpath, 1, True 'waits for this one to finish before carrying on
weight = 0 'resets weight to 0
end if
loop
What you need to do is put this file in the VCB directory in c:\program files\vmware\vmware consolidated backup/
Create a servers.txt file that has a list of your servers in, one per line.
If you look in the code there is a file path to e:. That is the destination directory. Change it to a destination you like.
Once this script has finished, you will have a directory in your detination dir, for every machine, filled with the files that make up that machine. Back these machines up however you want, or just have them as a handy copy.
When you are finished, run this script:
Dim fso, ts, weight
weight=1
Const ForWriting = 2
set ofso2 = createobject("scripting.filesystemobject")
set ofiletemp = ofso2.opentextfile ("servers.txt", 1)
set cline = createobject("wscript.shell")
'----------------------------------------------------------------------
do while not ofiletemp.atendofstream
servername = ofiletemp.readline
'msgbox servername
fullpath = "vcbmounter -h [yourVCname] -u userid -p password -U e:\vmbackups\" & servername
'msgbox fullpath
cline.run fullpath, 1
loop
This will remove all those machine directories. Again, don't forget to change the file path beginning "e:\" in the script. This also needs to live in the VCB directory mentioned above.
This works without creating ghost snapshots. It won't work at all against ESX5.0 as far as I know.
Thanks for reading,
Trev
No comments:
Post a Comment