Wednesday, 22 June 2011

Example of Using CLIQ to Change the Coordinating Manager within a SAN/iQ 9.0 (HP LeftHand / Storageworks P4000) Management Group

1: Discover the current coordinating manager node

Using the HP StorageWorks P4000 Centralized Management Console

Click on the Management Group icon → Details Tab → Status





2: Change the coordinating manager

i: Use PuTTY or similar to establish an SSH connection to the coordinating NSM on port 16022, and login using Management Group administrator credentials






login as: admin
Using keyboard-interactive authentication.
Password:
SAN/iQ Command Line Interface, v9.0.00.3561 (type exit to quit)
(C) Copyright 2007-2010 Hewlett-Packard Development Company, L.P.

CLIQ>

ii: From the prompt run the command stopManager

CLIQ>stopManager

iii: After a short wait run the command startManager to restart the manager on that node

CLIQ>startManager

The coordinating manager will automatically have moved to another NSM






Access to live volumes are uninterrupted by the change of coordinating manager.

Output below:

CLIQ>stopManager

SAN/iQ Command Line Interface, v9.0.00.3561
(C) Copyright 2007-2010 Hewlett-Packard Development Company, L.P.

RESPONSE
result 0
processingTime 14293
name CliqSuccess
description Operation succeeded.

CLIQ>startManager

SAN/iQ Command Line Interface, v9.0.00.3561
(C) Copyright 2007-2010 Hewlett-Packard Development Company, L.P.

RESPONSE
result 0
processingTime 15803
name CliqSuccess
description Operation succeeded.


Appendix: SAN/iQ 9.0 CLIQ Command Reference and Error Codes from Help Output

CLIQ>help

SYNTAX
CLIQ is the command-line interface (CLI) for the HP LeftHand Networks SAN. The CLI specifies parameters in the form parameter= (specification), rather than dictating a particular order (positional) notation.

PARAMETER ORDERING
Ordering of parameters is not specified. Any order will do. For example:
cliq deleteVolume volumeName=theVolume userName=user passWord=secret login=10.1.2.3
is equivalent to
cliq deleteVolume login=10.1.2.3 passWord=secret userName=user volumeName=theVolume
The method parameter may be optionally specified as "method=":
cliq userName=user passWord=secret login=10.1.2.3 volumeName=theVolume method=deleteVolume

CASE SENSITIVITY
All commands and parameter names are case-insensitive. "createVolume" is the same as "CreateVolume" is the same as "CREATEVOLUME". In some cases, parameter values, while not sensitive, are case significant as the system will preserve the case specified. For example, the description parameter value in the createVolume command will preserve the case specified by the caller, and impose this on the newly created volume.

TRUE/FALSE
Any parameter that indicates true/false, may be specified as "1|0" or "true|false".

COMMAND ABBREVIATION
There is no command or parameter abbreviation in the CLI when scripted. All commands and parameter names must be fully specified. This is to prevent ambiguity in legacy scripts if new commands or parameters are added.

OS ERROR CODE INTEGRATION
The CLI will map error codes to reasonable OS status codes (status in Linux, ERRORLEVEL in DOS). Since these are limited to 0..255, some of the OS errors may have less granularity than the API error codes.

COMPOSITE COMMANDS
Some commands take multiple elements for the parameter value. In this case, the parameter is interpreted as an delimiter-separated ordered list. For example:
volumeName=volume1;volume2
login=10.0.1.2;10.1.2.3;10.2.3.4
If a parameter contains fewer elements in the list than needed for the composite command, the last one in the list will be repeated. There must be at least one element in the list, if it's required.

SIZE SPECIFICATION
When volume sizes or thresholds are specified, the format is

The integrated shell supports rich command line editing features specific to the HP LeftHand API. The following editing keys are supported:

Key Meaning
LEFT Moves the cursor one space to the left.
RIGHT Moves the cursor one space to the right.
BACKSPACE Deletes the character under the cursor and moves it to the left.
DELETE Deletes the character under the cursor.
UP Recalls the previous command entered.
DOWN Recalls the first command entered.
HOME Moves the cursor to the beginning of the line.
END Moves the cursor to the end of the line.
ESCAPE Clears the current command line.
INSERT Toggles between insert mode (the default) and overwrite mode.
TAB Completes the command.

GLOBAL PARAMETERS

TIMETOWAIT=
Some commands may take a long time to complete. The default is to wait until the command completes or fails. This parameter allows you to specify a maximum wait time for completion. If this time is exceeded, the CLI returns CliqOperationTimedOut.

PROMPT=
Some potentially destructive commands prompt before proceeding. This default behavior can be turned off by specifying prompt=false.

OUTPUT=
In the default case, the CLI returns information to standard output, formatted in a way that's easy to read rather than easy to parse. The XML setting returns all output information as an XML document, allowing easier parsing of the result. There is no guarantee that newer versions of the API will preserve the same formatting in the default case. It is strongly discouraged to use this form of the CLI programmatically. If the output needs to be parsed, the XML variant is preferred.

SEPARATOR=
Some CLI parameters comprise parameters for multiple operations. For example, the snapshotVolumes command allows the caller to specify simultaneous snapshotting of multiple volumes. In this scenario, some parameters specify an ordered list that apply to each snapshot in succession. For example:
description="This applies to snapshot1;This applies to snapshot2"
The default separator character is a semicolon (';'). This can be overridden with the separator parameter in the event that the default separator is in the body of a parameter.
description="This applies to snapshot1;This applies to snapshot2"

INPUTFILE=
This takes all command input from a file containing XML input.

COMMANDS
The following section lists the commands supported

addVirtualManager
assignVolume
assignVolumeChap
cacheCredentials
cancelRemoteSnapshot
clearCredentials
clearCredentials
clearCredentials
clearVssVolumeFlags
cloneSnapshot
configureRaid
connectVolume
convertSnapshotTempSpace
createAdminGroup
createAdminUser
createCluster
createGroup
createKey
createRemoteAssociation
createRemoteSnapshot
createSite
createSnapshot
createVolume
deleteAdminGroup
deleteAdminUser
deleteCluster
deleteGroup
deleteRemoteAssociation
deleteSite
deleteSnapshot
deleteSnapshotTempSpace
deleteVirtualManager
deleteVolume
disconnectLocalVolume
discoverTcp
discoverUdp
getAlertLog
getClusterInfo
getGroupInfo
getLocalVolumes
getNsmInfo
getPerformanceStats
getRemoteSnapshotInfo
getScsiInfo
getServerCapabilities
getServerVolumeInfo
getSiteInfo
getSnapshotInfo
getSupportInfo
getSystemInfo
getVolumeInfo
help
makePrimary
makeRemote
modifyAdminGroup
modifyAdminUser
modifyCluster
modifyGroup
modifyRemoteAssociation
modifySite
modifySnapshot
modifyVolume
provisionVolume
rebalanceVip
removeSnapshot
removeVolume
resetSession
rollbackSnapshot
runDiagnostic
setGossipList
setLicenseKey
shutdownGroup
shutdownNsm
startManager
startVirtualManager
stopManager
stopVirtualManager
testCredentials
unassignVolume
vssSnapshot
waitForAlert
waitForUpdate

Return Codes

0 CliqSuccess - Everything succeeded normally.
1 CliqNothingDone - Operation has succeeded, but nothing was done (the system was already in the requested state).
2 CliqOperationPending - Operation has not failed, but is not yet complete. The "handle" parameter contains a value that can be used to query and cancel the operation.
3 CliqOperationAbandoned - Operation was intentionally cancelled or abandoned.
4 CliqNothingFound - Nothing was found.
5 CliqSnapshotSet - This snapshot was a part of the snapshot set.
6 CliqVssSnapshotWarning - Warning: The writer operation failed.
128 CliqUnexpected - An unexpected error has occurred.
129 CliqXmlError - The XML given is not well-formed.
130 CliqParameterFormat - The parameter is not specified correctly.
131 CliqParameterRepeat - A parameter is repeated.
132 CliqMissingMethod - The command method is missing.
133 CliqMissingParameter - One or more expected parameters are missing.
134 CliqUnrecognizedCommand - This command is unrecognized.
135 CliqUnrecognizedParameter - This parameter is unrecognized.
136 CliqIncompatibleParameters - Two or more parameters supplied are incompatible with each other.
137 CliqNotYetImplemented - This is a legal command - we just haven't done it yet.
138 CliqNoMemory - Out of memory.
139 CliqVolumeNotFound - Could not find the requested volume.
140 CliqVolumeInUse - The requested volume is in use.
141 CliqVolumeInitFailure - Volume initialization failed.
142 CliqUnrecognizedVolume - The volume is an unrecognized type.
143 CliqOperationFailed - General SAN/iQ error - the operation failed.
144 CliqCredentialsFailed - The supplied credentials are incorrect.
145 CliqInvalidParameter - Invalid parameter.
146 CliqObjectNotFound - Object not found.
147 CliqConnectionFailure - Failed to connect to the API server.
148 CliqNotEnoughSpace - Not enough space to complete the command.
149 CliqNoManager - Could not find a manager.
150 CliqSocketError - Network socket error.
151 CliqOperationTimedOut - Operation exceeded the specified timeout.
152 CliqNoPlatformSupport - This operating system type does not support the operation.
153 CliqIncorrectOsVersion - This operating system version does not support the operation.
154 CliqUtilityNotFound - The utility command requested was not found.
155 CliqUtilityNotAllowed - The utility command requested is not in the allowed list.
156 CliqUtilityIllegalParameter - The utility command contains unsupported parameters or redirection.
157 CliqUtilityFailed - The utility command executed, but returned a non-zero status code.
158 CliqNodeNotFound - The specified storage node can't be found.
159 CliqIllegalUsername - The username must be 3..40 characters, starting with a letter.
160 CliqIllegalPassword - The password must be 5..40 characters, not / or :.
161 CliqFileError - General file error.
162 CliqMissingInitiator - No iSCSI initiator found.
163 CliqInitiatorStopped - The iSCSI initiator is not running.
164 CliqSanIqTooOld - The version of SAN/iQ software must be upgraded.
165 CliqDefaultAdmin - You cannot delete, modify permissions, or remove the last user from the default administration group.
166 CliqVssProviderNotInstalled - The HP LeftHand Networks VSS Provider is not installed.
167 CliqVssProviderNotRunning - The HP LeftHand Networks VSS Provider is not running.
168 CliqVolumeNoSessions - Cannot create an application-managed snapshot because there are no iSCSI connections associated with this volume. To create application-managed snapshots, there must be at least one application server associated with the volume via an iSCSI connection.The volume must be connected to a VSS-enabled server.
169 CliqVolumeMultipleSessions - Cannot create an application-managed snapshot because there is more than one IQN (iSCSI Qualified Name) associated with this volume. To create application-managed snapshots, there must be only one application server associated with the volume or the servers must be in a server cluster. (Note: ensure all servers have VSS installed and running.)
170 CliqNoVssCapabilities - Cannot create an application-managed snapshot because the server does not support this capability.
171 CliqServerUnresponsive - Cannot create an application-managed snapshot because the system could not communicate to the necessary software component on the application server.
172 CliqVssSnapshotFailed - The system could not quiesce the application associated with this volume. Point in time snapshot is created.
173 CliqVssLunInfoFailed - Cannot create an application-managed snapshot because the system failed to get LUN data.
174 CliqVssWriterUnavailable -One or more VSS writers or their components are unavailable.
175 CliqVssSnapshotInProgress - The creation of a shadow copy is in progress, and only one shadow copy creation operation can be in progress at one time.
176 CliqWindowsServerIsBusy - The application server is busy.
177 CliqUpdateVssProvider - This version of VSS provider must be upgraded.
178 CliqVssOperationTimedOut - VSS operation timed out.


No comments:

Post a Comment