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-Host "Uploading backup file to appliance, this may take a few minutes..."
try
{
$rawUploadResponse = invoke-expression $curlUploadCommand
if ($rawUploadResponse -eq $null)
{
return
}
$uploadResponse = $rawUploadResponse | convertFrom-Json
if ($uploadResponse.status -eq "SUCCEEDED")
{
Write-Host "Upload complete."
return $uploadResponse
}
else
{
Write-Host $uploadResponse
return
}
}
catch [System.Management.Automation.CommandNotFoundException]
{
return uploadTo-appliance-without-curl $filepath $authinfo $hostname $backupFile
}
catch [System.Exception]
{
Write-Host "Not able to upload backup"
Write-Host $error[0].Exception
return
}
}
##### Upload the backup file to the appliance without using the curl command #####
function uploadTo-appliance-without-curl
([string]$filepath,[string]$authinfo,[string]$hostname,[string]$backupFile)
{
<#
.DESCRIPTION
Attempts to upload a backup to the appliance without using curl.
.PARAMETER filepath
The absolute filepath to the backup file.
.PARAMETER authinfo
The authorized session ID returned by the login request
.PARAMETER hostname
The appliance to connect to
.PARAMETER backupFile
The name of the file to upload. Only used to tell the server what file is contained
in the post request.
.INPUTS
None, does not accept piping
.OUTPUTS
The response body to the upload post request.
.EXAMPLE
$uploadResponse = uploadTo-appliance $filePath $sessionID $hostname $fileName
#>
$uploadUri = "/rest/backups/archive"
$fullUploadUri = $hostname + $uploadUri
$uploadTimeout = 43200000 # 12 hours
$bufferSize = 65536 # bytes
try
{
[net.httpsWebRequest]$uploadRequest = [net.webRequest]::create($fullUploadUri)
$uploadRequest.method = "POST"
$uploadRequest.Timeout = $uploadTimeout
$uploadRequest.ReadWriteTimeout = $uploadTimeout
$uploadRequest.SendChunked = 1
$uploadRequest.AllowWriteStreamBuffering = 0
$uploadRequest.accept = "application/json"
$boundary = "----------------------------bac8d687982e"
$uploadRequest.ContentType = "multipart/form-data; boundary=----------------------------
bac8d687982e"