HP Insight Control Server Provisioning 7.2 Administrator Guide

To get status about a restore under way, run the script with the -status parameter and the
appliance host name in the form https://{hostname}.
3.3.5.2 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!
3.3.5.3 Sample restore script main processing 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. It does 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.
3.3 Uploading and restoring a backup 21