This chapter explains how to run script commands from the command line to create a virtual disk from a group of physical disks and how to configure a redundant array of independent disks (RAID) storage array. This chapter assumes that you understand basic RAID concepts and terminology. Before configuring the storage array, become familiar with the concepts of physical disks, disk groups, virtual disks, host groups, hosts, and RAID controller modules. Additional information about configuring a storage array and related definitions is in the online help, the Installation Guide, the MD Storage Manager User's Guide, and the Owner's Manual.
Configuring a RAID storage array requires caution and planning to ensure that you define the correct RAID level and configuration for your storage array. The main purpose in configuring a storage array is to create virtual disks addressable by the hosts from a collection of physical disks. The commands described in this chapter enable you to set up and run a RAID storage array. Additional commands are also available to provide more control and flexibility. Many of these commands, however, require a deeper understanding of the firmware as well as various structures that need to be mapped. Use all of the command line interface (CLI) commands and script commands with caution.
The following sections in this chapter show some, but not all, of the CLI and script commands. The purpose of showing these commands is to explain how you can use the commands to configure a storage array. The presentation in this chapter does not explain all possible usage and syntax for the commands. (For complete definitions of the commands, including syntax, parameters, and usage notes, see Script Commands.)
This chapter contains examples of CLI and script command usage. The command syntax used in the examples is for a host running a Microsoft® Windows® operating system. As part of the examples, the complete C:\prompt and DOS path for the commands are shown. Depending on your operating system, the prompt and path construct will vary.
For most commands, the syntax is the same for all Windows and Linux operating systems, as well as for a script file. Windows operating systems, however, have an additional requirement when entering names in a command. On Windows, you must enclose the name between two backslashes (\) in addition to other delimiters. For example, the following name is used in a command that runs under Windows:
[\"Engineering\"]
For a Linux system when used in a script file, the name appears as:
["Engineering"]
Configuring a Storage Array
When you configure a storage array, you can maximize data availability by ensuring that data is quickly accessible while maintaining the highest level of data protection possible. The speed at which a host can access data is affected by the disk group RAID level and the segment size settings. Data protection is determined by the RAID level, hardware redundancy (such as global hot spares), and software redundancy (such as the Snapshot feature).
In general, you configure a storage array by defining the following entities:
A disk group and associated RAID level
The virtual disks
Which hosts have access to the virtual disks
This section explains how to use the script commands to create a configuration from an array of physical disks.
Determining What is on Your Storage Array
Even when you create a configuration on a previously unconfigured storage array, you still need to determine the hardware and software features that must be included with the storage array. When you configure a storage array with an existing configuration, you must ensure that your new configuration does not inadvertently alter the existing configuration, unless you are reconfiguring the entire storage array. For example, to create a new disk group on unassigned physical disks, you must determine which physical disks are available. The commands described in this section enable you to determine the components and features in your storage array.
The show storageArray command returns the following general information about the components and properties of the storage array:
A detailed profile of the components and features in the storage array
The battery age
The default host type (which is the current host type)
Other available host types
The hot spare locations
The identifiers for enabled features
The logical and physical component profiles
The time to which both RAID controller modules are set
The RAID controller module that currently owns each virtual disk in the storage array
To return the most information about the storage array, run the show storageArray command with the profile parameter. The following is an example of the complete CLI and script command running on Windows:
This example identifies the storage array by the dummy IP address 123.45.67.89. You can also identify the storage array by name.
The show storageArray profile command returns detailed information about the storage array. The information is presented in several screens on a display. You might need to increase the size of your display buffer to see all of the information. Because this information is so detailed, you might want to save the output to a file. To save the output to a file, enter the command as shown in the following example:
In this example, the name folder is the folder in which you choose to place the profile file, and storageArrayprofile.txt is the name of the file. You can choose any folder and any file name.
NOTICE: When you write information to a file, the script engine does not check to determine if the file name already exists. If you choose the name of a file that already exists, the script engine writes over the information in the file without warning.
When you save the information to a file, you can use the information as a record of your configuration and as an aid during recovery.
To return a brief list of the storage array features and components, use the summary parameter. The command is similar to the following example:
The summary information is also returned as the first section of information when you use the profile parameter.
The following show commands return information about the specific components of a storage array. The information returned by each of these commands is the same as the information returned by the show storageArray profile command, but is constrained to the specific component. (The following commands are not complete commands. For information about a command, see the referenced section next to the command.)
For descriptions of the show commands, including examples of the information returned by each command, see Script Commands. Other commands can help you learn about your storage array. To see a list of the commands, see Commands Listed by Function. These commands are organized by the storage array activities that the commands support. (Examples include virtual disk commands, host commands, enclosure commands, and others).
Saving a Configuration to a File
NOTICE: When you write information to a file, the script engine does not check to determine if the file name already exists. If you choose the name of a file that already exists, the script engine writes over the information in the file without warning.
After you have created a new configuration or if you want to copy an existing configuration for use on other storage arrays, you can save the configuration to a file. To save the configuration, use the save storageArray configuration command. Saving the configuration creates a script file that you can run on the command line. The following syntax is the general form of the command:
You can choose to save the entire configuration or specific configuration features. The command for setting this parameter value looks like the following example:
In this example, the name folder is the folder in which you choose to place the configuration file, and storageArrayconfig1.scr is the name of the file. Choose any folder and any file name. MD Storage Manager uses the file extension .scr when it creates the configuration file.
Using the Create Virtual Disk Command
The create virtualDisk command enables you to create new virtual disks in the storage array in three ways:
Create a new virtual disk while simultaneously creating a new disk group to which you assign the physical disks.
Create a new virtual disk while simultaneously creating a new disk group to which the MD Storage Manager software assigns the physical disks.
Create a new virtual disk in an existing disk group.
You must have unassigned physical disks in the disk group. You do not need to assign the entire capacity of the disk group to a virtual disk.
Creating Virtual Disks with User-Assigned Physical Disks
When you create a new virtual disk and assign the physical disks to use, the MD Storage Manager software creates a new disk group. The RAID controller module firmware assigns a disk group number to the new disk group. The following syntax is the general form of the command:
NOTE: The capacity, owner, segmentSize, and enclosureLossProtect parameters are optional. You can use one or all of the optional parameters as needed to help define your configuration. You do not, however, need to use any optional parameters.
The userLabel parameter is the name to give to the virtual disk. The virtual disk name can be any combination of alphanumeric characters, hyphens, and underscores. The maximum length of the virtual disk name is 30 characters. Spaces are not allowed. You must put quotation marks (" ") around the virtual disk name.
The physicalDisks parameter is a list of the physical disks that you want to use for the disk group. Enter the enclosure ID and slot ID of each physical disk that you want to use. Put parentheses around the list. Separate the enclosure ID and slot ID of a physical disk by a comma. Separate each enclosure ID and slot ID pair by a space. For example:
(0,0 0,1 0,2 0,3 0,4)
The capacity parameter defines the size of the virtual disk. You do not have to assign the entire capacity of the physical disks to the virtual disk. You can later assign any unused space to another virtual disk.
The owner parameter defines the RAID controller module to which you want to assign the virtual disk. If you do not specify a RAID controller module, the RAID controller module firmware determines the owner of the virtual disk.
The segmentSize parameter is the same as described for the autoConfigure storageArray command. See Using the Auto Configure Command.
The enclosureLossProtect parameter turns on or turns off enclosure loss protection for the disk group. (For a description of how enclosure loss protection works, see Enclosure Loss Protection.)
Example of Creating Virtual Disks with User-Assigned Physical Disks
NOTE: The capacity parameter returns an error if you specify a value greater than or equal to 10 without a space separating the numeric value and its unit of measure. (For example, 10GB will return an error, but 10 GB will not return an error).
The command in this example automatically creates a new disk group and a virtual disk with the name Engineering_1. The disk group will have a RAID level of 5 (RAID 5). The command uses three physical disks to construct the disk group. The virtual disk created has a capacity of 20 GB. If each physical disk has a capacity of 73 GB, the total capacity of the disk group is 219 GB. Because only 20 GB are assigned to the virtual disk, 199 GB remain available for other virtual disks that you can later add to this disk group. The segment size for each virtual disk is 64 KB. Hot spares have not been created for this new disk group. You must create hot spares after running this command.
Creating Virtual Disks with Software-Assigned Physical Disks
You can let the MD Storage Manager software assign the physical disks when you create the virtual disk. To have the software assign the physical disks, you need only specify the number of physical disks to use. The MD Storage Manager software then chooses the physical disks on which the virtual disk is created. The RAID controller module firmware assigns a disk group number to the new disk group. The following syntax is the general form for the command:
NOTE: The physicalDiskType, capacity, owner, segmentSize, and enclosureLossProtect parameters are optional. You can use one or all of the optional parameters as needed to help define your configuration. You do not, however, need to use any optional parameters.
This command is similar to the previous create virtualDisk command, which allows the user to assign the physical disks. This version of the command requires only the number and the type of physical disks to use in the disk group. You do not need to enter a list of physical disks. All other parameters are the same. Enclosure loss protection is performed differently when MD Storage Manager assigns the physical disks as opposed to when a user assigns the physical disks. (For an explanation of the difference, see Enclosure Loss Protection.)
Example of Creating Virtual Disks with Software-Assigned Physical Disks
The command in this example creates the same virtual disk as the previous create virtualDisk command, however, in this case the user does not know which physical disks are assigned to this disk group.
Creating Virtual Disks in an Existing Disk Group
To add a new virtual disk to an existing disk group, use the following command:
NOTE: The freeCapacityArea, capacity, owner, and segmentSize parameters are optional. You can use one or all optional parameters as needed to help define your configuration, though you do not need to use any of them.
ThediskGroup parameter is the number of the disk group in which you want to create a new virtual disk. If you do not know the disk group numbers on the storage array, you can use the show allVirtualDisks summary command. This command displays a list of the virtual disks and the disk groups to which the virtual disks belong.
The userLabel parameter is the name you want to give to the virtual disk. The virtual disk name can be any combination of alphanumeric characters, hyphens, and underscores. The maximum length of the virtual disk name is 30 characters. You must enclose the virtual disk name with quotation marks (" ").
ThefreeCapacityAreaparameter defines the free capacity area to use for the virtual disk. If a disk group has several free capacity areas, you can use this parameter to identify which free capacity area to use for virtual disk creation. You do not have to assign the entire capacity of the physical disks to the virtual disk. Assign any unused space to another virtual disk at another time.
The userLabel, capacity, owner, and segmentSize parameters are the same as in the previous versions of the create virtualDisk command.
Enclosure Loss Protection
The enclosureLossProtect parameter is a boolean switch that turns enclosure loss protection on or off. To work properly, each physical disk in a virtual disk group must be in a separate enclosure. Enclosure loss protection is set under the following conditions:
You assign the physical disks.
The RAID controller module assigns the physical disks.
The following table shows possible results for the enclosureLossProtectparameter. The results depend on whether you assign the physical disks or the RAID controller module assigns the physical disks.
Method
enclosureLossProtect=TRUE
enclosureLossProtect=FALSE
You assign the physical disks.
If you select more than one physical disk from any one enclosure, the storage array returns an error.
The storage array performs the operation, but the created disk group does not have enclosure loss protection.
The RAID controller module firmware assigns the physical disks.
The storage array posts an error if the RAID controller module firmware cannot provide physical disks to ensure that the new disk group has enclosure loss protection.
The storage array performs the operation even if it means that the disk group might not have enclosure loss protection.
The enclosureLossProtectparameter is not valid when creating virtual disks on existing disk groups.
Using the Auto Configure Command
The autoConfigure storageArray command creates the disk groups on a storage array, the virtual disks in the disk groups, and the hot spares for the storage array. When you use the autoConfigure storageArray command, define the following parameters:
Type of physical disks (Serial Attached SCSI [SAS] or Serial Advanced Technology Attachment [SATA])
RAID level
Number of physical disks in a disk group
Number of disk groups
Number of virtual disks in each disk group
Number of hot spares
Size of each segment on the physical disks
After defining these parameters, the MD Storage Manager automatically creates the disk groups, virtual disks, and hot spares. The RAID controller modules assign disk group and virtual disk numbers as they are created. After MD Storage Manager creates the initial configuration, you can use the set virtualDisk command to define virtual disk labels.
Before running the autoConfigure storageArray command, run the show storageArray autoConfigure command. The show storageArray autoConfigure command returns a list of parameter values that MD Storage Manager will use to create a storage array. Change any of the parameter values by entering new values for the parameters when you run the autoConfigure storageArray command. If you are satisfied with the parameter values that theshow storageArray autoConfigurationcommand returns, run the autoConfigure storageArraycommand without new parameter values.
The following syntax is the general form of autoConfigure storageArray command:
NOTE: All parameters are optional. You can use one or all of the parameters as needed to define your configuration.
When you use the autoConfigure storageArray command without specifying the number of disk groups, the firmware determines how many virtual disks and disk groups to create. The firmware creates one disk group and one virtual disk up to the maximum number that the storage array can support. When you specify the number of disk groups, the firmware creates only that number of disk groups. When you create more than one disk group, all of the disk groups have the same number of physical disks and the same number of virtual disks.
The diskGroupWidthparameter defines the number of unassigned physical disks wanted for each new disk group.
The diskGroupCount parameter defines the number of new disk groups wanted in the storage array.
The virtualDisksPerGroupCount parameter defines the number of virtual disks wanted in each disk group.
The hotSpareCount parameter defines the number of hot spares wanted in each disk group.
The segmentSizeparameter defines the amount of data in kilobytes that the RAID controller module writes on a single physical disk in a virtual disk before writing data on the next physical disk. The smallest units of storage are data blocks. Each data block stores 512 bytes of data. The size of a segment determines how many data blocks that it contains. An 8-KB segment holds 16 data blocks. A 64-KB segment holds 128 data blocks.
Valid values for the segment size are 8, 16, 32, 64, 128, 256, and 512.
When you enter a value for the segment size, the value is checked against the supported values provided by the RAID controller module at run time. If the value you enter is not valid, the RAID controller module returns a list of valid values.
If the virtual disk is for a single user with large I/O requests (such as multimedia), performance is maximized when a single I/O request can be serviced with a single data stripe. A data stripe is the segment size multiplied by the number of physical disks in the disk group that are used for data storage. In this environment, multiple physical disks are used for the same request, but each physical disk is accessed only once.
For optimal performance in a multi-user database or file system storage environment, set the segment size to minimize the number of physical disks needed to satisfy an I/O request. Using a single physical disk for a single request leaves other physical disks available to simultaneously service other requests.
After you have finished creating the disk groups and virtual disks by using the autoConfigure storageArray command, you can further define the properties of the virtual disks in a configuration using the set virtualDisk command. (See Modifying Your Configuration.)
The command in this example creates a storage array configuration that uses SAS physical disks set to RAID level 5. Three disk groups are created. Each disk group consists of eight physical disks configured into four virtual disks. The storage array has two hot spares, and segment size for each virtual disk is 8 KB.
Modifying Your Configuration
After creating your initial configuration, modify the properties of the configuration to ensure that it meets your requirements for data storage. Use the following commands to modify the properties of your configuration:
autoConfigure storageArray
create virtualDisk
Use the set commands to modify a storage array configuration. This section explains how to modify the following properties:
Storage array password
Simple Mail Transport Protocol (SMTP) and Simple Network Management Protocol (SNMP) alerts
RAID controller module clocks
Storage array host type
Global hot spares
NOTE: Before modifying your configuration, save a copy of your current configuration to a file (see Saving a Configuration to a File). If you have problems with your modifications, you can use the information in the file to restore your previous configuration.
Setting the Storage Array Password
The set storageArray command enables you to define a password for a storage array. The following syntax is the general form of the command:
set storageArray password="password"
The password parameter defines a password for the storage array. Passwords provide added security to a storage array to reduce the possibility of implementing destructive commands.
NOTE: CLI commands do not have interactive warnings for destructive commands.
NOTICE: Implementing destructive commands can cause serious damage, including data loss.
Unless you define a password for the storage array, anyone can run all of the script commands. A password protects the storage array from any command that the RAID controller modules consider destructive. A destructive command is any command that can change the state of the storage array, such as virtual disk creation, reset, delete, rename, or change. If you have more than one storage array in a storage configuration, each array has a separate password. Passwords can have a maximum length of 30 characters. You must put quotation marks (" ") around the password. The following example shows how to use the set storageArray command to define a password:
The storage array can be set up to send automatic email alert messages to specified email addresses when specific events occur. View the current alert configuration settings using the following command:
SMcli -d -i -s -w -v -S
By default, all alert configuration settings are None.
The following example shows how to set the mail server IP and the sender address configurations for SMTP alerts:
An example of a command to set the email alert destination and specify that only event information is to be sent is:
SMcli -a email:MyCompanySupport@MyCompany.com 123.45.67.89 -I eventOnly
The following example shows how to set the SNMP trap alert configuration. In this example, the trap destination is 123.45.67.891. The storage array is 123.45.67.892, and the community name is public.
SMcli -a trap:public, 123.45.67.891 123.45.67.892
Setting the RAID Controller Module Clocks
To synchronize the clocks on the RAID controller modules with the host, use the set storageArray time command. Running this command helps ensure that event timestamps written by RAID controller modules to the Major Event Log (MEL) match event timestamps written to the host log files. The RAID controller modules remain available during synchronization. An example of the command is:
The set storageArray command enables you to define the default host type. The following syntax is the general form of the command:
set storageArray defaultHostType=(hostTypeName | hostTypeIdentifier)
ThedefaultHostType parameter defines how the RAID controller modules communicate with the operating system on undefined hosts connected to the storage array. This parameter defines the host type only for storage array data I/O activities; it does not define the host type for the management station. The operating system can be Windows or Linux. For example, if you set the defaultHostType to Linux, the RAID controller module communicates with any undefined host if the undefined host is running Linux. Typically, you need to change the host type only when you are setting up the storage array. The only time you might need to use this parameter is if you need to change how the storage array behaves relative to the hosts.
Before you can define the default host type, you need to determine what host types are connected to the storage array. To return information about host types connected to the storage array, you can use the show storageArray command with thedefaultHostType parameter orhostTypeTableparameter. This command returns a list of the host types with which the RAID controller modules can communicate; it does not return a list of the hosts. The following examples show how to use the defaultHostType parameter and the hostTypeTableparameter:
The value 11 is the host type index value from the host type table.
Setting Modification Priority
Modification priority defines how much processing time is allocated for virtual disk modification operations. Time allocated for virtual disk modification operations affects system performance. Increases in virtual disk modification priority can reduce read/write performance. Operations affected by modification priority include:
Copyback
Reconstruction
Initialization
Changing segment size
Defragmentation of a disk group
Adding free capacity to a disk group
Changing the RAID level of a disk group
The lowest priority rate favors system performance, but the modification operation takes longer. The highest priority rate favors the modification operation, but the system performance might be degraded.
The set virtualDisk command enables you to define the modification priority for a virtual disk. The following syntax is the general form of the command:
set (allVirtualDisks | virtualDisk [virtualDiskName] | virtualDisks [virtualDiskName1 ... virtualDiskNamen] | virtualDisk <wwid> | accessVirtualDisk) modificationPriority=(highest | high | medium | low | lowest)
The following example shows how to use this command to set the modification priority for virtual disks named Engineering 1 and Engineering 2:
The modification rate is set to lowest so that system performance is not significantly reduced by modification operations.
Assigning Global Hot Spares
Hot spare physical disks can replace any failed physical disk in the storage array. The hot spare must be the same type of physical disk as the physical disk that failed and must have capacity greater than or equal to any physical disk that can fail. If a hot spare is smaller than a failed physical disk, the hot spare cannot be used to rebuild the data from the failed physical disk. Hot spares are available only for RAID levels 1 or 5.
You can assign or unassign global hot spares by using the set physicalDisk command. To use this command, you must perform these steps:
Identify the location of the physical disks by enclosure ID and slot ID.
Set thehotSpareparameter to TRUE to enable the hot spare or FALSE to
disable an existing hot spare.
The following syntax is the general form of the command:
Enter the enclosure ID and slot ID of each physical disk that you want to use. You must put brackets ([ ]) around the list. Separate the enclosure ID and slot ID of a physical disk by a comma. Separate each enclosure ID and slot ID pair by a space.