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
}
return
}
return $filePath
}
function setup-request ([string]$uri,[string]$method,[string]$accept,[string]$contentType =
"",[string]$authValue = "",[object]$body = $null,[int]$isSilent=0)
{
try
{
[net.httpsWebRequest]$request = [net.webRequest]::create($uri)
$request.method = $method
$request.accept = $accept
$request.Headers.Add("Accept-Language: en-US")
if ($contentType -ne "")
{
$request.ContentType = $contentType
}
if ($authValue -ne "")
{
$request.Headers.Item("auth") = $authValue
}
$request.Headers.Item("X-API-Version") = 1
if ($body -ne $null)
{
$requestBodyStream = New-Object IO.StreamWriter $request.getRequestStream()
$requestBodyStream.WriteLine($body)
$requestBodyStream.flush()
$requestBodyStream.close()
}
# attempt to connect to the Appliance and get a response
[net.httpsWebResponse]$response = $request.getResponse()
# response stored in a stream
$responseStream = $response.getResponseStream()
$sr = New-Object IO.StreamReader ($responseStream)
#the stream, which contains a json object, is read into the storage variable
$rawResponseContent = $sr.readtoend()
$response.close()
return $rawResponseContent
}
catch [Net.WebException]
{
$errorMessage = $error[0].Exception.message
#Try to get more information about the error
try {
$errorResponse = $error[0].Exception.InnerException.Response.getResponseStream()
$sr = New-Object IO.StreamReader ($errorResponse)
$rawErrorStream = $sr.readtoend()
$error[0].Exception.InnerException.Response.close()
$errorObject = $rawErrorStream | convertFrom-Json
if (($errorObject.message.length -gt 0) -and
($errorObject.recommendedActions.length -gt 0))
{
$errorMessage = $errorObject.message + " " + $errorObject.recommendedActions
}
}
catch [System.Exception]
{
#Use exception message
}
if ($isSilent -eq 1) {
throw $errorMessage
}
elseif ($global:interactiveMode -eq 1)
{
Write-Host $errorMessage
}
else
{
46