amCLI is a command line interface to ServerView RAID Manager. It can be used to create, delete or manage RAID arrays or manage ServerView RAID Manager itself from the command line or from a script.
At the top level, amCLI has the following command options:
-c|--create: create a logical drive
-d|--delete: delete last logical drive
-e|--exec: execute a device-specific command
-g|--get: get a target's property
-i|--import: import a certificate
-l|--list: list information
-m|--migrate: migrate a RAID array to another RAID level
-r|--restore: restore the state from a file
-s|--set: set a target's property to a given value
-w|--write: write the current state to a file
-Z|--zap: zap a target
-?|--help: give a short help
Up to one of these may be specified, -? being the default.
All objects that can be manipulated by this command (the entire ServerView RAID Manager subsystem, adapters, physical drives, and logical drives i.e. RAID arrays) are identified by two numbers separated by a slash (/) character: the first number specifies a module and the second number is a (0-based) index: <mod/idx>. In this documentation, such a pair of numbers is referred to as the address of an object.
Currently, the following module numbers are supported:
mod | Module |
21 | ServerView RAID Manager |
32 | Avago MegaRAID SAS Adapter, SAS/SAS2/SAS3 IT/IR Adapter, MegaSR |
36 | Fujitsu Aries SAS Adapter |
39 | Linux Software RAID |
40 | Avago MegaRAID SAS Adapter, SAS/SAS2/SAS3 IT/IR Adapter (via CIM) |
47 | AMD Chipset RAID |
48 | Fusion-io PCIe SSD's |
53 | Intel PCIe SSD's |
Note that index values need not be consecutive (e.g if 27/5 and 27/7 exist, 27/6 must not necessarily exist, too), are relative to a module (i.e. 26/5 and 27/5 can both exist at the same time) and the numbering continues between adapters, logical and physical drives (i.e. 27/5 and 27/10 can be adapters, 27/6 and 27/7 can be physical drives and 27/8 and 27/9 can be logical drives).
In the following,
Use amCLI -l to find the addresses of objects you wish to use.
For scripting purposes it is possible to suppress all confirmation requests by using the option -quiet.
Before creating a logical drive, you must decide which RAID level to use, what parameters the chosen RAID level requires and what (physical and/or logical) drives this logical drive should consist of. It is assumed here that you are familiar with the concepts of RAID and the various RAID levels.
amCLI [-c|--create] <mod/AdpIdx> raid=<raidLevel> parameters <mod/PDIdx>+
Use amCLI --help create <mod/AdpIdx> to find out which RAID-levels and parameters the specified adapter supports.
To create a RAID-5 array consisting of physical drives 32/5, 32/6, and 32/7 on the Avago MegaRAID adapter 32/1 with default parameters, the following command could be used:
# amCLI -c 32/1 raid=5 32/5 32/6 32/7
A confirmation is then required to execute this command (the input is treated case-insensitive):
Are you sure to create a new Logical Drive on Adapter '32/1'?
Type YES to confirm _
ServerView RAID Manager will allocate an address for the new logical drive. Use amCLI -l to determine the address.
This command deletes the logical drive with the highest logical drive ID on a given adapter (which is usually the logical drive most recently created).
amCLI [-d|--delete] <mod/AdpIdx>
To delete the logical drive created above immediately after having created it, use
# amCLI -d 32/1
Again, an explicit confirmation is required to execute this command:
Are
you sure to delete the last Logical Drive on Adapter '32/1'?
Type YES to confirm _
This command starts execution of a device-specific command on a given device.
amCLI [-e|--exec] <mod/idx> <operation> <param>*
To find out which operations are supported by a given object and what additional parameters they require, use
amCLI [-?|--help] exec <mod/idx>
# amCLI -? exec 32/26
amCLI v5.7.0
Usage:
-e | --exec <32/PDIdx> locate
-e | --exec <32/PDIdx> stop_location
-e | --exec <32/PDIdx> create_global_hot_spare
-e | --exec <32/PDIdx> delete_global_hot_spare
-e | --exec <32/PDIdx> create_dedicated_hot_spare <mod/LDIdx>
-e | --exec <32/PDIdx> delete_dedicated_hot_spare
-e | --exec <32/PDIdx> make_online
-e | --exec <32/PDIdx> make_offline
-e | --exec <32/PDIdx> make_ready
-e | --exec <32/PDIdx> replace_missing_disk <mod/LDIdx>
# amCLI -e 32/26 locate
This command retrieves the value of a given property of a given object.
amCLI [-g|--get] <mod/idx> <property>
Use amCLI -? get to find out which object classes support which properties in general or amCLI -? get <mod/idx> to find out which properties a specific object supports.
# amCLI -? get 32/2
amCLI v5.7.0
Usage:
-g | --get <32/LDIdx> activity
-g | --get <32/LDIdx> status
-g | --get <32/LDIdx> disk_cache_mode
-g | --get <32/LDIdx> bgi
...
# amCLI -g 32/2 status
Operational
This command imports a certificate.
amCLI [-i|--import] <certificate file> <private key file>
# amCLI -i cert.pem key.pem [intermediate.pem]
This command lists information available about a given object.
amCLI [-l|--list] [all|struct|<mod/idx>]
# amCLI -l struct
21/3: System, 'hostname'
32/1: SAS Adapter 0, 'Avago MegaRAID SAS PCI Express(TM) ROMB (0)'
32/2: Logical Drive 0, 'LogicalDrive_0', RAID-0, 69472MB
32/3: SAS Port 0
32/11: Physical Drive 0, 'SEAGATE ST373454SS (0)', 69472MB
32/4: SAS Port 1
32/12: Physical Drive 1, 'SEAGATE ST336754SS (1)', 34464MB
...
This command changes the RAID level of a logical drive, if this is possible in the current configuration and if it is supported by the adapter controlling the logical drive.
amCLI [-m|--migrate] <mod/LDIdx> [raid=<raidLevel>] parameters <mod/PDIdx>*
To find out which RAID levels a given logical drive can be migrated to and whether additional physical drives may be needed, use
# amCLI -l 32/2
32/2: Logical Drive 0, 'LogicalDrive_0', RAID-0, 69472MB
Parents: 1
Children: -
Containers: 1
Drives: 1 --> ( 32/11 )
Properties:
Unique ID: PCI:Bus=2&Device=14&Function=0&ID=0
Logical Drive Number: 0
Name: LogicalDrive_0, settable
Logical Size: 69472 MB
Physical Size: 69472 MB
RAID Level: RAID-0
...
# amCLI -? migrate 32/2
amCLI v5.7.0
Usage:
-m | --migrate 32/2
[raid=(0|1|5)]
(<PDIdx>)+
This means that logical drive 32/2 (a RAID-0 logical drive) can only be migrated to RAID levels 0, 1 or 5 and it may be possible to include additional physical drives (in this specific case they would be even required to migrate to RAID levels 1 or 5).
# amCLI -m 32/2 raid=1 32/8
A confirmation is again required:
Are
you sure to modify Logical
Drive '32/2' on Adapter '32/1'?
Type YES to confirm _
This command restores the state of the RAID configuration from a file previously created by amCLI -w.
amCLI [-r|--restore] <filename>
# amCLI -r OldState
Again, an explicit confirmation is required:
Are you sure to restore the configuration?
Type YES to confirm _
Restoring the state of the adapter managing the system disk may render the system unusable!
This commands sets the given property of a given object to a given new value.
amCLI [-s|--set] <mod/idx> <property> <value>
Use amCLI -? set to find out which device classes support which properties in general or amCLI -? set <mod/idx> to find out which properties a given device supports.
# amCLI -? set 32/2
amCLI v5.7.0
Usage:
-s | --set <32/LDIdx> name <string>
...
# amCLI -g 32/2 name
LogicalDrive_0
# amCLI -s 32/2 name 'OS disk'
# amCLI -g 32/2 name
OS disk
This command saves the internal state of a specified object into a given file or prints it to the standard output.
amCLI [-w|--write] <mod/SysIdx> [<file>]
amCLI [-w|--write] <mod/AdpIdx> [<file>]
# amCLI -w 32/1
<ServerViewRAIDManager Version="5.7.0">
<SASAdapter UniqueID="PCI:Bus=2&Device=14&Function=0" AdapterNumber="0
...
This command clears an existing configuration of an adapter, e.g. deletes all logical drives, hot spares, etc.
amCLI [-Z|--zap] [<mod/idx>]
(Note the upper case Z)
# amCLI -Z 32/17
A confirmation is then required to execute this command (the input is treated case-insensitive):
Are you sure to zap Adapter '32/17'?
Type YES to confirm _
The help command serves two purposes:
amCLI [-?|--help] [[create | get | set | exec | migrate] [<mod/idx>]]
Without any additional parameters, amCLI -?
will just print out the syntax of all amCLI commands. As -?
is the default, typing amCLI
will do the same.
Additional parameters can be given to retrieve specific information
about parameters of a given command when applied to a given object:
If no device is given, the syntax of the command is shown. If the address of an object is given, specific information about the execution of the command on that object is shown.
# amCLI -?
amCLI v5.7.0
Usage:
-c <mod/AdpIdx> raid=<raidLevel> [span=<spanCount>] [stripe=<stripeSize>]
[<raidFlag>=<flag>] [size=<megabytes>] (<mod/PDIdx>)+
--create <mod/AdpIdx> raid=<raidLevel> [span=<spanCount>]
[stripe=<stripeSize>] [<raidFlag>=<flag>] [size=<megabytes>]
(<mod/PDIdx>)+
-d <AdpIdx>
--delete <AdpIdx>
...
# amCLI -? create
amCLI v5.7.0
Usage:
-c <mod/AdpIdx> raid=<raidLevel> [span=<spanCount>] [stripe=<stripeSize>]
[<raidFlag>=<flag>] [size=<megabytes>] (<mod/PDIdx>)+
--create <mod/AdpIdx>
raid=<raidLevel> [span=<spanCount>]
[stripe=<stripeSize>] [<raidFlag>=<flag>]
[size=<megabytes>]
(<mod/PDIdx>)+
# amCLI --help create 32/17
amCLI v5.7.0
Usage:
-c | --create 32/17
raid=(0|1|5|6|10|50|60|1e)
[span=<(RAID-0:1)|
(RAID-1:1)|
(RAID-5:1)|
(RAID-6:1)|
(RAID-10:2..8)|
(RAID-50:2..8)|
(RAID-60:2..8)|
(RAID-1E:1)>]
[stripe=<(RAID-0:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-1:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-5:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-6:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-10:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-50:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-60:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)|
(RAID-1E:(8kb|16kb|32kb|64kb|128kb|256kb|512kb|1mb)>]
[init_mode=(no_initialization|fast_initialization|normal_initialization)]
[read_mode=(readahead|no_readahead)]
[write_mode=(writeback|always_writeback|writethrough)]
[cache_mode=(cached|direct)]
[disk_cache_mode=(disabled|enabled)]
[cache_settings=(data_protection|performance|advanced)]
[name=<string>]
[size=<megabytes>]
(<PDIdx>)+
The exit status (or error level) approximates the error conditions defined by ServerView RAID Manager and takes on the following values:
Exit status | Description |
0 | Normal; no errors or warnings detected |
1 | Internal error |
2 | Invalid syntax |
3 | Invalid object |
4 | Memory failure |
5 | Operation not supported |
6 | Property not supported |
7 | Operation cannot be executed at this time |
8 | Communication with Core Service failed |
10 | Core Service initialization failed |
11 | Core Service database failed |
12 | Operation failed |
13 | Invalid parameter value |
14 | Login failed |
15 | Shutdown in progress |
16 | No administration rights granted |
17 | Cannot open file |
18 | Cannot read file |
19 | Cannot write file |
20 | Core Service is initializing |