HP Matrix 7.2 KVM Private Cloud Backup and Restore
Table Of Contents
- Abstract
- Matrix Operating Environment with Matrix KVM Private Cloud Overview
- Backup and restore strategy for Matrix OE with Matrix KVM Private Cloud
- Matrix KVM Private Cloud backup and restore
- Matrix KVM Private Cloud Images repository backup and restore
- Matrix KVM Private Cloud High Availability (HA) cluster configuration backup and restore
- Appendix A: KVM Private Cloud restore resynchronization actions
- Appendix B: Images repository restore resynchronization actions
- Appendix C: Alerts and Audit messages
- Appendix D: HA Cluster details
- Appendix E: Backup and Restore REST API
- Appendix F: Sample Backup Script
- Appendix G: Sample Restore Script
- References
- For more information
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message
$errorMessage
}
#No need to rethrow since already recorded error
return
}
}
##### Start of function calls #####
#gets the credentials from user, either manual entry or from file
$savedLoginJson = queryfor-credentials $args[0]
if ($savedLoginJson -eq $null)
{
#if an error occurs, it has already been logged in the queryfor-credentials function
return
}
#extracts needed information from the credential json
try
{
$savedLoginJson = "[" + $savedLoginJson + "]"
$savedloginVals = $savedLoginJson | convertFrom-Json
$SecStrLoginname = $savedloginVals.userName | ConvertTo-SecureString -ErrorAction stop
$loginname =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStr
ingToBSTR($SecStrLoginName))
$hostname = $savedloginVals.hostname
$SecStrPassword = $savedloginVals.password | ConvertTo-SecureString -ErrorAction stop
$password =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStr
ingToBSTR($SecStrpassword))
}
catch [System.Exception]
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Failed to get credentials: " + $error[0].Exception.Message
}
else
{
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Failed to get
credentials: " + $error[0].Exception.Message
}
}
#sends the login request to the machine, gets an authorized session ID if successful
$authValue = login-appliance $loginname $password $hostname
if ($authValue -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Failed to receive login session ID."
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Failed to
receive login session ID."
return
}
#sends the request to start the backup process, returns the URI to access the task manager
$taskManager = backup-Appliance $authValue.sessionID $hostname
if ($taskManager -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Could not initialize backup"
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Could not
initialize backup"
return
}
47