This chapter describes in detail how to use CA ARCserve RHA PowerShell commands to control, edit and monitor the Replication and HA processes. The commands are displayed in alphabetical order and they are divided into four groups: Connecting and Registration, Controlling, Editing and Monitoring.
This section contains the following topics:
Connecting and Registration Commands
This section describes how to connect to the Control Service, how to disconnect from it, and how to enter your license key for CA ARCserve RHA registration.
In order to work with CA ARCserve RHA scenarios using PowerShell, the first thing you need to do is connect to the Control Service that acts as the point-of-control of the CA ARCserve RHA operation. The Connect-XO command enables you to connect PowerShell to a specific Control Service.
Note: Once you finished working with CA ARCserve RHA PowerShell, do not forget to disconnect from the Control Service using the the Disconnect-XO command. Closing PowerShell window will also cause PowerShell to disconnect from the Control Service.
Connect-XO [-Host] <String> [-Credentials] <PSCredential> [[-Protocol] [<String>]] [[-Port] [<String>]]
The IP address or hostname of the machine where the Control service is running.
The Domain\User Name for the Control Service. These credentials must belong to a user who has Admin rights on the Control Service. After you enter the credentials, a Windows PowerShell Credential Request dialog appears, prompting you to enter your password.
Note: To avoid the need to manually enter your credentials into the PSCredentials dialog, refer to Connect PowerShell to a Control Service using a Script.
The protocol that is used for connecting to the Control Service. Enter one of the following: http or https.
The TCP/IP port that is used for connecting to the Control Service. For http the default value is 8088; For https the default value is 443.
Example: Connect to a Control Service
connect-xo 192.168.1.151 qa88-w3k3\administrator https
Outcome
A Windows PowerShell Credential Request dialog appears, prompting you to enter your password. Then, the following appears:
Connecting... 192.168.1.151 connected!
You can avoid the need to manually enter your credentials into the PSCredentials dialog by encrypting your password and running it as an object.
To encrypt your password and run it as an object
Enter the following commands, using your password where indicated, and run it once:
read-host -assecurestring | convertfrom-securestring | out-file C:\ securestring.txt <password>
$pass = cat C:\securestring.txt | convertto-securestring
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist <domain\user_name>, $pass
Connect -XO [-Host] <String> $mycred [[-Protocol][<String>]] [[-Port] [<String>]]
The outcome is the same as if you used a standard connection:
Connecting...
<IP Address> connected!
For more information, refer to the PowerShell documentation or search the internet.
After you finished working with CA ARCserve RHA PowerShell, you need to disconnect from the running Control Service. The Disconnect-XO command enables you to disconnect PowerShell from the running Control Service.
Note: Closing the PowerShell window also causes PowerShell to disconnect from the Control Service.
Disconnect-XO
Note: This command does not have parameters. It automatically disconnects the running Control Service.
Example: Disconnect from a Control Service
disconnect-xo
Outcome:
192.168.1.151 disconnected!
The Get-License command enables you to display your CA ARCserve RHA license details.
get-license
Example: Display your CA ARCserve RHA license detailes
get-license
Outcome:
Key: TVC2LF24FTU7G3WJ2QAFMCLGXA5KLPCCYIXTJTWX2MOZFU5GL7EJ3OYZQND7V3G123456
Company:
License expires on: 11 2009
Maintenance till: 11 2009
Number of Assured Recovery nodes:240
Number of CDP Repository nodes:240
Product list:
- Application Server, Windows Cluster edition, 30 instances HA
- File server, Windows Enterprise edition, 130 instances HA
- Application Server, Windows Enterprise edition, 130 instances DR
- File server, Windows Enterprise edition, 30 instances DR
- Application Server, Virtual Machine, 100 instances DR
- Application Server, Virtual Machine, 100 instances HA
The Set-License command enables you to register CA ARCserve RHA using a license key. You need to have a valid registration key before using this command.
set-license
A valid license key.
Example: Register CA ARCserve RHA using a license key
set-license TVC2LF24FTU7G3WJ2QAFMCLGXA5KLPCCYIXTJTWX2MOZFU5GL7EJ3OYZQND7V3G123456
Outcome:
Key registered successfully
This command reads all credential records in the given XML file and adds them to the connected Control Service, via the command Add-Credential.
Syntax
xo-import-credential
Parameters
Specify the XML file name.
Input
None. No object is piped to xo-import-credential.
This command converts a plain text CVS file to a secured XML file.
Syntax
xo-convertto-securefile
Parameters
Source file name and destination are specified.
The source should be a CSV file which has the following format:
hostname, |
username, |
password |
host1, |
user1, |
pwd1 |
host2, |
user2, |
pwd2 |
Input
None. No object is piped.
The xo-credential command lets you convert a username and password string to a secured credential object, for use within other commands that take PSCredential objects as command arguments.
Syntax
xo-credential <username> <password>
Example
xo-credential johnsmith mypword2
This section describes CA ARCserve RHA PowerShell commands that enable you to control the Replication and HA processes.
The Diff-Scenario command enables you to generate a Difference Report for a given scenario.
Important! We do not recommend initiating a Difference Report when data is being updated on the Master, since all updates that are not yet applied to the Replica will be shown as different.
Diff-Scenario [-Name] <String> [-Mode] <String> [-Ignore] <Boolean>
The name of the scenario for which you want to generate the report. You can enter several scenario names by using the Get-Scenario command.
The synchronization mode. Enter one of the following:
B=Binary
F=File
Ignore files of the same name and size during the data comparison. Enter one of the following:
1=Yes
0= No
Note: To view the Difference Report after its generation, open the Report Center from the Overview Page, and select the required report.
Example: Generate a Difference Report
diff-scenario "File Server 1" F 1
Outcome:
Differences report is running for scenario File Server 1... Done!
The Export-Scenario command enables you to export scenarios to other locations in order to reuse them. The scenario is exported as an XMC file, and you can specify its location.
Export-Scenario [-Name] <String> [[-File] [<String>]]
The scenario name.
The full path of the exported file. If you do not specify a path, the file is exported to the current directory and carries the name of the scenario with an .xmc extension.
Example: Export a scenario to a specified location
export-scenario "File Server 1" C:\Scenarios
Outcome:
Scenario File Server 1 exported successfully to C:\Scenarios
The Expose-Snapshot command enables you to expose a snapshot. You can either expose the snapshot as a local read-only folder by mounting it on an unused folder, or expose it as a local read-only volume by mounting it on an unused drive letter.
Notes:
Expose-Snapshot [-Name] <String> [-Index] <Int32> [-Path] <String> [-Port] <String>
The name of the host whose snapshot you want to expose.
The index no. of the snapshot, as returned by the Get-Snapshot command.
The path under which you want to expose the snapshot. The path can be either a drive letter or a full folder path.
The port that is used for connecting to the given host. The default port is 25000.
Example: Expose a snapshot as a local read-only volume
Expose-Snapshot 192.168.1.153 0 E: 25000
Outcome:
Snapshot {97127d0b-f1c9-4db5-943d-96c39b712fe6} mounted as E:
The Import-Scenario command enables you to import a scenario, in the form of an XMC file, from a specified location. Use this option if you want to relocate scenarios from one Control Service to another, or if you want to use older scenarios that were kept on your system.
Import-Scenario [-File] <String>
The full path of the imported scenario file.
Notes:
Example: Import a scenario from a specified location to your Manager
import-scenario c:\scenarios
Outcome:
Scenario File Server 2 imported successfully from c:\scenarios
The Mount-Snapshot command enables you to mount an exposed snapshot. You can either mount the snapshot as a local read-only folder on an unused folder, or mount it as a local read-only volume on an unused drive letter.
Mount-Snapshot [-Name] <String> [[-Index] [<Int32>]] [[-Path] [<String>]] [[-Port] [<String>]]
The name of the host whose snapshot you want to mount.
The index number of the snapshot, as returned by the Get-Snapshot command.
The path under which you want to expose the snapshot. The path can be either a drive letter or a full folder path.
The port that is used for connecting to the given host. The default port is 25000.
Example: Mount a snapshot as a local read-only volume
mount-snapshot 192.168.1.153 0 F:
Outcome:
Snapshot {745d6ce9-d880-40bf-a0cb-d4f0114bb0f8} mounted as F:
The Prepare-Reboot command enables you to perform maintenance procedures, such as rebooting a host or moving groups between Microsoft Cluster nodes, without performing re-synchronization once these processes are completed.
The hosts that can be prepared for maintenance need to participate in running scenarios. The preparation is done on one host at a time, but this host can participate in multiple scenarios. In these scenarios, the host can function as both the Master and the Replica. When a host participates in a scenario that is not running, the preparation that relates to this scenario does not occur.
After you receive the message informing you that the host is preparing for reboot, you can reboot your host or switch groups between cluster nodes. Once you completed your maintenance procedures, the replication process automatically resumes, without performing re-synchronization.
Note: If after preparing the host for maintenance, you decided not to reboot it and continue running its scenarios, you need to stop the scenarios and re-run them.
Prepare-Reboot [-Name] <String>
The host name.
Example: Prepare a Replica host for reboot
Prepare-Reboot QA95-W2K3-EX2
Outcome:
Host QA95-W2K3-EX2 Preparing for reboot
The Recover-Scenario command enables you to recover data that was lost on the Master by transferring it from any of the Replica hosts that participate in a scenario. This is done by activating a synchronization process in the reverse direction: from a Replica to the Master. When you activate the Recover-Scenario command, you need to define from which Replica host you want to recover the data, and whether to delete data already on the Master but not on the Replica during the recovery process.
Important! You must stop replication in order to initiate recovery.
To verify that the recovery process is completed, use the Get-Events command. After you get a message informing you that the "Recovery process has finished", you can restart the replication process from the Master to the Replica by using the Run-Scenario command.
Recover-Scenario [-Name] <String> [-Host] <String> [-Mode] <String> [-Ignore] <Boolean> [-RemoveMasterFiles] <Boolean> [-RecoveryMode] <String> [-RebootAfterRecovery] <Boolean>
The scenario name.
The Replica host from which you want to recover data.
The synchronization mode. Enter one of the following:
B=Binary
F=File
Ignore files of the same name and size during the data comparison. Enter one of the following:
1=Yes
0= No
Whether to delete files that exist only on the Master during the recovery process. Enter one of the following:
1 = Yes, delete files that exist only on the Master
0 = No, keep files that exist only on the Master
The data type to recover. Enter one of the following:
A = Application data
S = System State data (only if the System State Protection option is active)
B = Both types of data
The default value is A.
Whether to reboot the Master host once the recovery process is completed. Enter one of the following:
1 = Yes, reboot the Master
2 = No, do not reboot the Master
Example: Recover lost data
Recover-Scenario "File Server 1" 192.168.1.153 F 1 0 A 2
Outcome:
Recover application data process started
The Resume-IsAliveCheck command lets you manually resume IsAlive checking for a given running HA scenario.
Resume-IsAliveCheck [-ScenarioName] <String>
The target scenario name.
Example: Resume IsAlive checking of SQLscenario
Resume-IsAliveCheck SQLscenario
Outcome:
Resumes periodic is-alive checking of SQLscenario.
Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |