titux
Goto Top

XenServer 6.2 - Kommerzielle Backup Software für die Sicherung der Gäste gesucht

Hi,

wir benutzen hier XenServer in der Version 6.2

Bis jetzt wurden die Gastsysteme (alles Windows Gäste) einfach über die Export Funktion vom XenCenter gesichert.
Nun sind wir auf der Suche nach einer komfortableren Lösung, die auch Hot Backups machen kann, also ein Backup des Gasts erstellen,
ohne diesen erst runterfahren zu müssen. Wir haben mehrere XenServer in Betrieb und dementsprechend auch viele VM Gäste zu sichern.

Wer hat hier Erfahrungen sammeln können und kann mir einen Tipp geben? Scriptlösungen suchen wir nicht, damit funktioniert es zwar
prinzipiell, aber bei Problemen soll jeder damit zurechtkommen und deshalb hätte man auch gerne kommerziellen Support hierfür.

Danke und Grüße

TiTux

Content-Key: 183311

Url: https://administrator.de/contentid/183311

Printed on: April 25, 2024 at 23:04 o'clock

Member: Dani
Dani Apr 10, 2012 at 17:06:10 (UTC)
Goto Top
Moin,
welchen Storagehersteller habt ihr im Background am Laufen?
Ansonsten schau mal hier.


Grüße,
Dani
Mitglied: 106150
106150 Apr 11, 2012 at 17:35:30 (UTC)
Goto Top
Gude,

wir machen das mit folgendem Script...
Ich muss dabei sagen das dieses Script nicht von uns ist und ich noch auf der Suche der Originalquelle bin da die entsprechende Person ein danke verdient hat.

Edit: Originalquelle: http://community.spiceworks.com/scripts/show/161-xenserver-live-backup

Das ganze wird in eine vbs gepackt, entsprechende Punkte sind natürlich zu bearbeiten

'User configurable variables  
'Server names must be seperated by a comma.  Names are case sensitive so you have to get the  
'name of your server PERFECT!  
strServers = "ServerName,ServerName2"  
strUser = "root"  
strpw = "mypassword"  
strXenServer = "XenServer IP Address or hostname"  
strBackupPath = "d:\xsbackups"  
'Make sure to use the short file name format  
strXenCenterPath = "C:\Progra~1\Citrix\XenCenter\"  
'Set to TRUE if you want to send a status email  
binSendEmail = TRUE
strSMTPFrom = "XSLiveBackup@mycompany.com"  
strSMTPTo = "spiceworkshelpdesk@mycompany.com"  
strSMTPRelay = "smtp relay IP address or host name"  
'Number of days to keep the logs and backup files  
numKeepLogs = 10
numKeepBackups = 5



'************************************************************************************************  
'Do not edit beyond this point  
'************************************************************************************************  
Dim errStatus, strLogName
Dim fs, logFile
If Right(strBackupPath, 1) = "\" Then  
	strBackupPath = Left(strBackupPath, Len(strBackupPath) - 1)
End If

If Right(strXenCenterPath, 1) <> "\" Then  
	strXenCenterPath = strXenCenterPath & "\"  
End If

strRunXE = strXenCenterPath & "xe.exe -s " & strXenServer & " -u " & strUser & " -pw " & strpw & " "  
arrBackups = Split(strServers, ",")  
const ForAppending = 8
errStatus = 0

'Set some global objects  
Set WshShell = CreateObject ("Wscript.shell")  

'Create the log file and introduction information into log file  
Call logSetup
'Check if XenCenter Path is correct  
If fs.FileExists(strXenCenterPath & "xe.exe") Then  
	'Loop through all selected servers and back them up  
	For iServers = 0 to UBound(arrBackups)
		Call backupVM(Trim(arrBackups(iServers)))
	Next
Else
	writeLog("XenCenter not found, aborting backup!")  
	errStatus = UBound(arrBackups) + 2
End If

'Finish up the log file  
Call logClose
'Send status message via email  
Call sendMsg

'Script completed -- REM line below out if you want to run this in a scheduled task  
wscript.echo "Done!"  



Sub backupVM(strServer)
	'First, check that the VM exists, and get UUID and name-label information.  It is possible to   
	'name a snapshot as a backup source, but this script does not allow it, so checking for that too  
	Set objExec = WSHshell.Exec(strRunXE & "vm-list params=uuid,name-label,is-a-snapshot name-label=" & strServer)  
	strStatus = "Not Found"  
	Do While Not objExec.StdOut.AtEndOfStream
		strStatus = "Found"  
		strUUID = stripValue(objExec.StdOut.ReadLine())
		strVM = stripValue(objExec.StdOut.ReadLine())
		strSnapShot = stripValue(objExec.StdOut.ReadLine())
		strTemp = objExec.StdOut.ReadLine()
		strTemp = objExec.StdOut.ReadLine()
	
		If strSnapShot = "false" and strVM <> "Control domain on host" Then  
			strStatus = "Good"  
		End If
	Loop
	
	If strStatus = "Not Found" Then  
		strResult = SetErrorStatus("Add")  
		writeLog("No VM by that name: " & strServer)  
		Exit Sub
	ElseIf strStatus = "Found" Then  
		strResult = SetErrorStatus("Add")  
		writeLog("VM is a Snapshot or Template, no backup performed: " & strServer)  
		Exit Sub
	Else
		writeLog("VM Found: " & strServer)  
	End If

	'Remove old backups  
	writeLog("Cleaning up old backup files")  
	Set oFolder = fs.GetFolder(strBackupPath)
	Set oAllFiles = oFolder.Files
	numDM = 0
	For Each oFile in oAllFiles
		If Left(oFile.Name, 7) = "Backup-" and DateDiff("d", NOW, oFile.DateLastModified) > numKeepBackups Then  
			numDM = numDM + 1
			ReDim Preserve arrFileName(numDM)
			arrFileName(numDM) = oFile.Name
			fs.DeleteFile oFile.Path
		End If
	Next
	writeLog(numDM & " files deleted")  
	For x = 1 to numDM
		writeLog("     " & arrFileName(x))  
	Next
	
	'Snapshot the VM  
	writeLog("Snapshoting server: " & strServer)  
	Set objExec = WSHshell.Exec(strRunXE & "vm-snapshot new-name-label=" & strServer & "-XenServer-Live-Backup uuid=" & strUUID)  
	strSSID = objExec.StdOut.ReadLine()
	strResult = strSSID
	Do While Not objExec.StdOut.AtEndOfStream
		strTemp = objExec.StdOut.ReadLine()
		writeLog(strTemp)
		strResult = strResult & ":" & strTemp  
	Loop
	If InStr(UCase(strResult), "ERROR") Then  
		writeLog("Error creating snapshot, see above")  
		Exit Sub
	End If
	
	'Set snapshot to NOT be a template  
	writeLog("Setting snapshot status...")  
	Set objExec = WSHshell.Exec(strRunXE & "template-param-set is-a-template=false uuid=" & strSSID)  
	Do While Not objExec.StdOut.AtEndOfStream
		writeLog(objExec.StdOut.ReadLine())
	Loop
		
	'Export to backup destination  
	strTime = Replace(Now(), "/", "-")  
	strTime = Replace(strTime, " ", "-")  
	strTime = Replace(strTime, ":", "-")  
	strName = "Backup-" & strServer & "-" & strTime & ".xva"  
	writeLog("Backup filename: " & strName)  
	Set objExec = WSHshell.Exec(strRunXE & "vm-export vm=" & strSSID & " filename=" & strBackupPath & "\" & strName)  
	strResult = ""  
	Do While Not objExec.StdOut.AtEndOfStream
		strTemp = objExec.StdOut.ReadLine()
		writeLog(strTemp)
		strResult = strResult & ":" & strTemp  
	Loop
	If InStr(UCase(strResult), "SUCCEEDED") = 0 Then  
		strResult = SetErrorStatus("Add")  
		writeLog("**************   Error during backup of " & strServer & " **************")  
	End If
	
	'Remove the snapshot  
	Set objExec = WSHshell.Exec(strRunXE & "vm-uninstall uuid=" & strSSID & " force=true")  
	strResult = ""  
	Do While Not objExec.StdOut.AtEndOfStream
		strTemp = objExec.StdOut.ReadLine()
		writeLog(strTemp)
		strResult = strResult & " " & strTemp  
	Loop
	If InStr(strResult, "All objects destroyed") = 0 Then  
		strResult = SetErrorStatus("Add")  
		writeLog("**************Error deleting snapshot for " & strServer & " **************")  
	End If
End Sub


Function stripValue(strValue)
	arrStrip = Split(strValue, ":")  
	stripValue = Trim(arrStrip(1))
End Function


Sub writeLog(strText)
	logFile.WriteLine Now() & ":  " & strText  
End Sub


Function SetErrorStatus(strTask)
	If strTask = "Add" Then  
		errStatus = errStatus + 1
		SetErrorStatus = errStatus
	Else
		numServers = UBound(arrBackups) + 1
		If errStatus = 0 Then
			SetErrorStatus = "Success"  
		ElseIf errStatus >= numServers Then
			SetErrorStatus = "Failed"  
		Else
			SetErrorStatus = "Partial Failure"  
		End If
	End If
End Function


Sub logSetup
	Set fs = CreateObject("Scripting.FileSystemObject")  

	If Not fs.FolderExists(strBackupPath) Then
		fs.CreateFolder(strBackupPath)
	End If
	
	Set oFolder = fs.GetFolder(strBackupPath)
	Set oAllFiles = oFolder.Files
	For Each oFile in oAllFiles
		If Left(oFile.Name, 16) = "XenServerBackups" and DateDiff("d", NOW, oFile.DateLastModified) > numKeepLogs Then  
			fs.DeleteFile oFile.Path
		End If
	Next

	strLogName = "XenServerBackups-" & Replace(Date, "/", "-") & ".log"  
	Set logFile = fs.OpenTextFile (strBackupPath & "\" & strLogName, ForAppending, True)	  
	
	logFile.WriteLine "=========================================================================================================="  
	logFile.WriteLine "Backup for:  " & Now()  
	logFile.WriteLine "=========================================================================================================="  
	For x = 0 to UBound(arrBackups)
		If x = 0 Then
			logFile.WriteLine "Servers targeted for backup: " & arrBackups(x)  
		Else
			logFile.WriteLine "                             " & arrBackups(x)  
		End If
	Next
	logFile.WriteLine "Backup User                : " & strUser   
	logFile.WriteLine "Password                   : *********"   
	logFile.WriteLine "Xen Server                 : " & strXenServer  
	logFile.WriteLine "Backup Destination         : " & strBackupPath  
	logFile.WriteLine
End Sub


Sub logClose
	'Finish up the log file  
	logFile.WriteLine
	strStatus = SetErrorStatus("Read")  
	logFile.WriteLine "Backup completed on " & Now()  
	logFile.WriteLine "Backup Status: " & strStatus  
	logFile.WriteLine
	logFile.WriteLine
	logFile.Close
End Sub


Sub sendMsg
	'Send status message via email  
	If binSendEmail = False Then
		Exit Sub
	End If
	
	Set oMessage = CreateObject("CDO.Message")  
	oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2   
	oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay  
	oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25   
	oMessage.Configuration.Fields.Update
	
	strStatus = SetErrorStatus("Read")  
	oMessage.Subject = "XenServer Backup Completed. Status: " & strStatus & ".  Date: " & Now()  
	oMessage.From = strSMTPFrom
	oMessage.To = strSMTPTo
	strText = vbCRLF & "XenServer Backup Completed. " & vbCRLF & vbCRLF  
	strText = strText & "Backup User                : " & strUser & vbCRLF  
	strText = strText & "Password                   : *********" & vbCRLF  
	strText = strText & "Xen Server                 : " & strXenServer & vbCRLF  
	strText = strText & "Backup Destination         : " & strBackupPath & vbCRLF  
	strText = strText & vbCRLF
		strText = strText & "Backup Status              : " & strStatus  
	oMessage.TextBody = strText
	oMessage.AddAttachment strBackupPath & "\" & strLogName  
	oMessage.Send
End Sub


Gruß
Member: TiTux
TiTux Apr 15, 2012 at 17:16:22 (UTC)
Goto Top
Hi,

als Backup werden derzeit MSAs von HP genutzt, bald auch SAN Maschinen von Synology.

Wir werden jetzt SEP mal testen, hier kann man sich auch eine 30 Tage Demo installieren, dann testen wir mal.

http://www.sep.de/de/produkte/virtual-machine-backup/citrix-xen/

Danke und Grüße

TiTux
Member: MMMNB82
MMMNB82 Apr 16, 2012 at 07:32:35 (UTC)
Goto Top
Hi,

schau dir mal ShadowProtect Virtual an -> www.storagecraft.de, du installierst einen Agenten in deinen Gästen und dann machst du im laufenden Betrieb dank VSS Unterstützung konsistente Backups alle 15 Minuten. Kannst dir ja mal eine 30 Tage Testversion besorgen und probieren, läuft sehr zuverlössig face-wink


Grüße
Member: TiTux
TiTux Apr 16, 2012 at 09:26:14 (UTC)
Goto Top
Hi,

der Vorteil von SEP ist halt, dass ich überhaupt keine Komponenten weder auf dem XenServer selber, noch auf den VMs installieren muss, finde ich schon ganz nett.
Member: ndakota
ndakota Oct 28, 2013, updated at Oct 29, 2014 at 11:56:31 (UTC)
Goto Top
Schau dir mal das Addware Xenbackup an....eventuell hilft dir das weiter. Sichert VMs von XenServern, Verschieben im laufenden Betrieb mgl....gibt es für einen XenServer auch als Freeware, für mehrere Server ist es dann kostenpflichtig. Nähere Infos dazu findest hier: http://www.addware.de/xenbackup.html
Member: Der-Phil
Der-Phil May 20, 2014 at 09:12:41 (UTC)
Goto Top
Hallo!

Der Artikel ist alt, aber vielleicht ists ja trotzdem interessant:

Ich nutze aktuell Xackup von "Fungusware": fungusware.com

Kann nicht super viel, aber ist preiswert und nicht übel - und agentfrei.

Phil