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
 

 .INPUTS 
 None, this function does not take inputs. 
 .OUTPUTS 
 Returns an object that contains the login name, password, and host name to connect 
to. 
 .EXAMPLE 
 $variable = queryfor-credentials #runs function, saves json object to variable. 
 #> 
 if ($args[0] -eq $null) 
 { 
 Write-Host "Enter Appliance name (https://ipaddress)" 
 $appliance = Read-Host 
 # Correct some common errors 
 $appliance = $appliance.Trim().ToLower() 
 if (!$appliance.StartsWith("https://")) 
 { 
 if ($appliance.StartsWith("http://")) 
 { 
 $appliance = $appliance.Replace("http","https") 
 } else { 
 $appliance = "https://" + $appliance 
 } 
 } 
 Write-Host "Enter Username" 
 $username = Read-Host -AsSecureString | ConvertFrom-SecureString 
 Write-Host "Enter password" 
 $SecurePassword = Read-Host -AsSecureString | ConvertFrom-SecureString 
 Write-Host "Would you like to save these credentials to a file? (username and password 
encrypted)" 
 $saveQuery = Read-Host 
 $loginVals = [pscustomobject]@{ userName = $username; password = $SecurePassword; hostname 
= $appliance } 
 $loginJson = $loginVals | convertTo-json 
 $global:interactiveMode = 1 
 if ($saveQuery[0] -eq "y") #enters into the mode to save the credentials 
 { 
 Write-Host "Enter file path and file name to save credentials (example: 
C:\users\bob\machine1.txt)" 
 $storagepath = Read-Host 
 try 
 { 
 $loginJson | Out-File $storagepath -NoClobber -ErrorAction stop 
 } 
 catch [System.Exception] 
 { 
 Write-Host $_.Exception.message 
 if ($_.Exception.getType() -eq [System.IO.IOException]) # file already exists throws an 
IO exception 
 { 
 do 
 { 
 Write-Host "Overwrite existing credentials for this machine?" 
 [string]$overwriteQuery = Read-Host 
 if ($overwriteQuery[0] -eq 'y') 
 { 
 $loginJson | Out-File $storagepath -ErrorAction stop 
 $exitquery = 1 
 } 
 elseif ($overwriteQuery[0] -eq 'n') 
 { 
 $exitquery = 1 
 } 
 else 
 { 
 Write-Host "please respond with a y or n" 
38 










