HP Insight Control Server Provisioning 7.3 Update 1 Administrator Guide

Example output
Example output from running the script to upload and restore a backup:
PS C:\Users\Joe> C:\Users\Joe\Documents\restore.ps1
Restoring from backup is a destructive process, continue anyway?
y
Enter directory backup is located in (ie: C:\users\joe\)
C:\users\Joe\Documents
Enter name of backup (ie: appliance_vm1_backup_2012-07-07_555555.bkp
joe_vm_backup_2012-07-07_777777.bkp
Enter appliance IP address (ie: https://10.10.10.10)
https://10.10.10.1
Enter username
*************
Enter password
********
Login completed successfully
Uploading backup file to appliance, this may take a few minutes...
Upload complete.
Restore progress: [====================] 100 %
Restore complete!
Example output from running the script to get restore progress information:
C:\users\Joe\Documents\restore.ps1 -status https://10.10.10.1
Restore progress: [====================] 100 %
Restore complete!
Sample restore script’s main processes and functions
The sample script can be used to either start a restore or get progress information about an ongoing
restore.
If no parameters are passed to the script, it uploads and restores a backup by performing the
following:
1. Calls query-user() to get the appliance host name, user name and password, and backup
file path.
2. Calls login-appliance to issue a REST request to get a session ID used to authorize restore
REST calls.
3. Calls uploadTo-appliance() to upload the backup to the appliance.
4. Calls start-restore() to start the restore.
5. Calls restore-status() to periodically check the restore status until the restore completes.
If the -status option is passed to the script, it checks and reports the status of the last or an
ongoing restore until the restore completes. It does the following:
1. Calls recover-restoreID() to get the URI for checking the status of the last or an ongoing
restore.
2. Calls restore-status() to periodically check the restore status until the restore completes.
The following table provides an overview of the functions in the sample script.
OutputParametersDescriptionFunction
loginVals: a hash table
that contains the information
obtained from user.
N.A.Obtains information from
user needed to interact with
appliance.
query-user
authInfo: the response
body returned by the remote
username: the user name
obtained from query-user
function.
Sends the user name and
password to the appliance,
and obtains an authorized
session ID.
login-appliance
appliance, which includes
the sessionID.
Restoring the appliance 55