The metassist command allows you to create top level Solaris Volume Manager volume configurations with a single command. For example, rather than manually working through the process of partitioning disks, creating RAID 0 volumes (as submirrors), creating hot spare pools and hot spares, and finally creating a mirror, with the metassist command, you can issue a single command to create a volume, and Solaris Volume Manager will do the rest for you.
This is a list of the information in this chapter:
The following task map identifies the procedures needed to create Solaris Volume Manager volumes with the metassist command, which allows you to specify volumes based on quality of service characteristics and create sets of layered volumes with a single command.
Task |
Description |
---|---|
Allows you to use the metassist command to create one or more Solaris Volume Manager volumes. |
|
Allows you to control the amount of information about the volume creation process that the metassist command provides for troubleshooting or diagnosis. |
|
Helps you create a shell script with the metassist command to generate the volumes that the command specified. |
|
Creating a Volume with A Saved Shell Script Created by the metassist Command |
Shows you how to create the Solaris Volume Manager volumes that the metassist command specified with the shell script previously generated by the command. |
Creating a Volume Configuration File with the metassist Command |
Helps you create a volume configuration file, describing the characteristics of the volumes you want to create. |
Allows you to set default volume characteristics to customize the metassist command's behavior. |
The metassist command allows you to create top level Solaris Volume Manager volume configurations with a single command. Input to the metassist command provides the volume's size, level of redundancy (the number of copies of the data it provides), the number of data paths (separate controllers through which it may be accessed) to it, and whether it will have hot spare partitions - without specifying the hardware components to be used in the volume. You can specify the volume by quality of service with command line options or in an input file named on the command line. If you prefer to specify the names, sizes, and components of a volume in more detail, you can do that in an input file.
With the metassist command, you can specify volume characteristics in terms of quality of service. You can specify the following quality of service characteristics:
size
redundancy (number of copies of data)
data paths
fault recovery (whether the volume should be associated with a hot spare pool)
For cases in which it's important to more specifically define the volume characteristics (or constraints under which the volumes should be created), you can also specify
volume types (for example, RAID 0 (concatenation) or RAID 0 (stripe))
components to use in specific volumes
components that are available or unavailable for use
number of components to use
details specific to the type of volume being created (including interlace value for stripes, read policy for mirrors, and similar characteristics)
Additionally, the system administrator can constrain the command to use (or not use) specific disks or paths.
The metassist command uses Solaris Volume Manager disk sets to manage volumes and available disks for top down creation. For any given top-down creation process, all the disks used as building blocks must be either in the disk set or be available to be added to the disk set. You can use the top-down process to create volumes in different disk sets, but the disks and components available are constrained by disk set functionality.
By default, all disk sets that the metassist command creates in a non-clustered environment have the autotake feature enabled. For more information on the autotake feature, see Autotake Disk Sets.
The top down volume creation process provides flexibility by offering both a fully automated end-to-end process through which you can specify needed constraints and have the necessary volumes created when the command completes, and a more granular process with breakpoints at which you can write out a XML-based file, as shown in Figure 24–1.
The metassist command supports end-to-end processing, based on input from the command line or files, or partial processing, to allow the system administrator to provide file-based data or to check volume characteristics.
For an automatic, hands-off approach to volume creation, use the command line to specify the quality of service attributes you require, and allow the metassist command to create the necessary volumes for you. This could be as simple as:
# metassist create -s storagepool -S 10Gb |
This command would create a stripe volume of 10Gb in size in the storagepool disk set, using available storage existing in the storagepool disk set.
Alternatively, you can use a volume request file to define characteristics of a volume, then use the metassist command to implement it.
As shown in Figure 24–1, a volume specification file can be produced, so the system administrator can assess the intended implementation or edit it if needed. This volume specification file can then be used as input to the metassist command to create volumes.
The command file shown in Figure 24–1 is a shell script that implements the Solaris Volume Manager device configuration that the metassist command specifies. A system administrator can use that file for repeated creation or to edit as appropriate, or can skip that step completely and create the volumes directly.
Creating volumes and volume configurations automatically with the metassist command requires that you have a functional Solaris Volume Manager configuration before you begin. At a minimum, you should have the following:
root access or have assumed an equivalent role. See Becoming Superuser (root) or Assuming a Role in System Administration Guide: Basic Administration for more information.
state database replicas, distributed appropriately for your system. See About the Solaris Volume Manager State Database and Replicas for more information about state database replicas.
available disks to use for the volumes you will create. The metassist command uses disk sets to help manage storage, so complete disks (or an existing disk set) must be available to create new volumes with the metassist command.
In addition to these minimum requirements, do not disable the disk set RPC daemons (rpc.metad, rpc.metamhd, and rpc.metamedd) in the /etc/inetd.conf file. These daemons are configured to start by default. and must remain enabled to allow Solaris Volume Manager to use its full functionality.
The metassist command checks disks to see which disks appear to be unused, and attempts to conservatively determine which disks are available. Any disk or slice that is determined to be in use is considered unavailable for use by the metassist command. Key checks include:
Disks used in other disk sets
Mounted slices
Slices with a file system superblock, indicating a mountable file system
Slices used in other Solaris Volume Manager volumes
Any slices that meet these criteria are unavailable for use by the metassist command.
The Solaris Volume Manager metassist command allows you to create individual Solaris Volume Manager volumes as well as sets of volumes based on quality of service criteria, with fewer commands than traditional Solaris Volume Manager commands would require.
You can use the metassist command to create RAID 1 (mirror) volumes directly, without having to first create the submirrors (concatenations or stripes) used as component parts of the RAID 1 (mirror) volume.
Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).
Identify available storage on which to create the mirror.
If you do not explicitly specify any storage, Solaris Volume Manager will identify unused storage on the system and use it as appropriate. If you choose to specify storage, either broadly (for example, all storage on controller 1) or specifically (for example, use c1t4d2, but do not use c1t4d1), Solaris Volume Manager will use the storage you specify as needed.
Use the following form of the metassist command to create a two–way mirror:
metassist create-s diskset-name-r redundancy -S size |
create is the subcommand to create volumes.
-s diskset-name specifies the name of the disk set to use for the volumes.
-r redundancy specifies the level of redundancy (number of data copies) to create.
-S size specifies the size of the volume to create in KB, MB, GB, or TB, for kilobytes, megabytes, gigabytes, and terabytes, respectively.
See the following examples and the metassist(1M) man page for more information.
Use the metastat command to view the new volumes (two striped submirrors and one mirror).
metastat -s diskset-name |
# metassist create -s myset -r 2 -S 10mb |
This example shows how to create a two-way mirror, 10Mb in size, with the metassist command. The metassist command identifies unused disks and creates the best mirror possible using those disks. The -s myset argument specifies that the volumes will be created in the myset disk set, which will be created if necessary.
# metassist create -s myset -f -r 2 -S 10mb |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance).
# metassist create -s myset -a c1 -S 10mb |
This example shows how to use the metassist command to create a stripe using disks available on controller 1 (the -a option specifies the available controller).
When you use the metassist command, you can take several steps to gain visibility into what the metassist command does and how it makes decisions. This information can be useful for troubleshooting some of the following:
Why a volume was created in a certain way
Why a volume was not created
What volumes the metassist command would create, without actually creating the volumes
When you run the metassist command, you can specify the level of verbose output. More verbose output can help diagnose problems, such as determining why disks were or were not selected for use in a volume, or to determine why a specific attempted command failed. Less verbose output can reduce the amount of extraneous information that you must review.
Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).
Identify available storage on which to create the volume.
Use the following form of the metassist command to create a stripe and specify verbose output:
metassist create-s diskset-name -S size-v verbosity |
create is the subcommand to create volumes.
-s diskset-name specifies the name of the disk set to use for the volumes.
-S size specifies the size of the volume to create in KB, MB, GB, or TB, for kilobytes, megabytes, gigabytes, and terabytes, respectively.
-v verbosity specifies how verbose the output should be. The default level is 1, and allowable values range from 0 (nearly silent output) to 2 (significant output).
See the following examples and the metassist(1M) man page for more information.
Use the metastat command to view the new volume.
metastat-s diskset-name |
# metassist create -s myset -f -r 2 -S 10mb -v 2 |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-v) specifies a verbosity level of two, which is the maximum level and will provide the most information possible about how the metassist command worked.
# metassist create -s myset -f -r 2 -S 10mb -v 0 |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-v 0) specifies a verbosity level of zero, which is the minimum level and will provide nearly silent output when the command runs.
By running the metassist command with the -c argument, you can generate a Bourne shell script containing the commands that would be used to create the volume configuration. This technique allows you to review the commands before actually creating the volume, or even to modify the script somewhat to meet specific needs.
Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).
Identify available storage on which to create the volume.
Use the following form of the metassist command to create a stripe and specify that the volume should not actually be created, but that a command sequence (shell script) to create the volumes should be sent to standard output:
metassist create -s diskset-name-S size -c |
create is the subcommand to create volumes.
-s diskset-name specifies the name of the disk set to use for the volumes.
-S size specifies the size of the volume to create in KB, MB, GB, or TB, for kilobytes, megabytes, gigabytes, and terabytes, respectively.
-c specifies that the volume should not actually be created. Instead, a shell script that can be used to create the specified configuration will be sent to standard output.
See the following examples and the metassist(1M) man page for more information.
Note that the shell script required by the -c argument will be sent to standard output, while the rest of the output from the metassist command goes to standard error, so you can redirect the output streams as you choose.
# metassist create -s myset -f -r 2 -S 10mb -c |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-c) specifies that the volume should not actually be created, but rather than a shell script that could be used to create the specified configuration should be sent to standard output.
# metassist create -s myset -f -r 2 -S 10mb -c > \ /tmp/metassist-shell-script.sh |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-c) specifies that the volume should not actually be created, but rather that a shell script that could be used to create the specified configuration should be sent to standard output. The end of the command redirects standard output to create the /tmp/metassist-shell-script.sh shell script that can later be used to create the specified volume.
After you have created a shell script with the metassist command, you can use that script to create the volumes specified when the shell script was created.
The command script created by the metassist command has significant dependencies on the specific system configuration of the system on which the script was created, at the time the script was created. Using the script on different systems or after any changes to the system configuration can lead to data corruption or loss.
Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).
Ensure that the system configuration has not changed since the shell script was created, and that you are executing the script on the same system it was created on.
Execute the saved shell script:
sh ./metassist-shell-script-name |
Use the metastat command to view the new volume.
metastat -s diskset-name |
By running the metassist command with the -d argument, you can generate an XML-based volume configuration file that specifies the volumes and their components in detail, including all options and relevant information about the volumes. Reviewing this file helps you understand the configuration that the metassist command recommends. Making careful changes to this file can also allow you to fine-tune the configuration, then to use the volume configuration file as input to the metassist command to actually create volumes.
Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).
Identify available storage on which to create the volume.
Use the following form of the metassist command to create a stripe and specify that the volume should not actually be created, but that a volume configuration file describing the proposed volumes should be sent to standard output:
metassist create -s diskset-name-S size -d |
create is the subcommand to create volumes.
-s diskset-name specifies the name of the disk set to use for the volumes.
-S size specifies the size of the volume to create in KB, MB, GB, or TB, for kilobytes, megabytes, gigabytes, and terabytes, respectively.
-d specifies that the volume should not actually be created. Instead, an XML-based volume configuration file that can eventually be used to create the specified configuration will be sent to standard output.
See the following examples and the metassist(1M) man page for more information.
Note that the XML-based volume configuration file required by the -d argument will be sent to standard output, while the rest of the output from the metassist command goes to standard error, so you can redirect the output streams as you choose.
# metassist create -s myset -f -r 2 -S 10mb -d |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-d) specifies that the volume should not actually be created, but rather that a volume configuration file that could eventually be used to create the specified configuration should be sent to standard output.
# metassist create -s myset -f -r 2 -S 10mb -d > \ /tmp/metassist-volume-config.xml |
This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-d) specifies that the volume should not actually be created, but rather that a volume configuration file that could eventually be used to create the specified configuration should be sent to standard output. The end of the command redirects standard output to create the /tmp/metassist-volume-config.xml shell script that can later be used to create the specified volume.
You can use the volume defaults file (/etc/defaults/metassist.xml) to establish default behavior for the metassist command. By changing the defaults file, you can explicitly exclude—or include—disks or controllers from consideration, and additionally specify requirements for most volume settings used by the metassist command.
The format of the /etc/defaults/metassist.xml is specified by the /usr/share/lib/xml/dtd/volume-defaults.dtd Document Type Definition (DTD), and documented in the volume-defaults(4) man page.
Edit the volume defaults file (/etc/defaults/metassist.xml) to specify how the metassist command should behave.
When you edit the file, you must ensure that the file continues to be compliant with the /usr/share/lib/xml/dtd/volume-defaults.dtd Document Type Definition. If the XML file is not compliant with the DTD, the metassist command will fail with an error message.
Before creating a volume, edit the /etc/default/metassist.xml file to specify the default settings that you want to apply to all volumes you will create with the metassist command. In this example, the metassist command will only create volumes on controller c1 and, when creating stripes, will only create stripes with exactly 4 components and an interlace of 512KB. These constraints will apply to all uses of the metassist command until the /etc/default/metassist.xml file is changed again.
# cat /etc/default/metassist.xml <!DOCTYPE volume-defaults SYSTEM \ "/usr/share/lib/xml/dtd/volume-defaults.dtd"> <volume-defaults> <available name="c1" /> <stripe mincomp="4" maxcomp="4" interlace="512KB" ></stripe> </volume-defaults> # metassist create -s myset -S 10Gb |
This example shows how to use the metassist command to create a 10GB stripe, using exactly four slices and an interlace value of 512KB, as specified in the /etc/default/metassist.xml file.