Solaris Volume Manager Administration Guide

Chapter 23 Automatic (Top Down) Volume Creation (Tasks)

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:

Top Down Volume Creation (Task Map)

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 

Creating a Volume AutomaticallyAllows you to use the metassist command to create one or more Solaris Volume Manager volumes.

Specifying Output Verbosity from the metassist Command

Allows you to control the amount of information about the volume creation process that the metassist command provides for troubleshooting or diagnosis.

Creating a Command File with the metassist Command

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.  

Changing the Volume Defaults File

Allows you to set default volume characteristics to customize the metassist command's behavior.

Overview Of Top Down Volume Creation

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.

Top Down Creation Capabilities

With the metassist command, you can specify volume characteristics in terms of quality of service. You can specify the following quality of service characteristics:

For cases in which it's important to more specificly define the volume characteristics (or constraints under which the volumes should be created), you can also specify Additionally, the system administrator can constrain the command to use (or not use) specific disks or paths.

Top Down Creation Implemention

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.

Top Down Creation Process

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 23–1.

Figure 23–1 The metassist command supports end-to-end processing, based on command line or files, or partial processing to allow the system administrator to provide file-based data or check volume characteristics.

Input to metassist comes from multiple sources, and output goes to the specification, command file, or to make volumes.

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 23–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 23–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.

Before You Begin

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:

Understanding Which Disks Are Available

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:

Any slices that meet these criteria are unavailable for use by the metassist command.

Creating Volumes Automatically

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.

Creating a Volume Automatically

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.

To Create a RAID 1 (Mirror) Volume with the metassist command
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. 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.

  3. Use the following form of the metassist command to create a two–way mirror:

    metassistcreate -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.

  4. Use the metastat command to view the new volumes (two striped submirrors and one mirror).

    metastat -s diskset-name

Example—Creating a Two-Way Mirror with the metassist command


# 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.

Example—Creating a Two-Way Mirror and Hot Spare with the metassist command


# 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).

Example—Creating a Stripe using a Specific Controller with the metassist command


# 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).

Analyzing Volume Creation with the metassist Command

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:

Specifying Output Verbosity from the metassist Command

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.

To Use the metassist Command with Verbose Output
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. Identify available storage on which to create the volume.

  3. Use the following form of the metassist command to create a stripe and specify verbose output:

    metassistcreate -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.

  4. Use the metastat command to view the new volume.

    metastat -s diskset-name

Example—Using the metassist Command with Verbose Output


# 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.

Example—Using the metassist Command with Minimal Output


# 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.

Creating a Command File with the metassist Command

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.

To Create a Command File with the metassist Command
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. Identify available storage on which to create the volume.

  3. 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:

    metassistcreate -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.

Example—Creating a Command File (Shell Script) with the metassist Command


# 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.

Example—Saving a Command File (Shell Script) from the metassist Command


# 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.

Creating a Volume with A Saved Shell Script Created by the metassist Command

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.


Note –

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.


To Execute a Saved metassist Command Shell Script
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. 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.

  3. Execute the saved shell script:

    sh ./metassist-shell-script-name
  4. Use the metastat command to view the new volume.

    metastat -s diskset-name

Creating a Volume Configuration File with the metassist Command

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.

To Create a Volume Configuration File with the metassist Command
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. Identify available storage on which to create the volume.

  3. 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.

Example—Creating a Volume Configuration File with the metassist Command


# 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.

Example—Saving a Volume Configuration File from the metassist Command


# 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.

Changing Default Behavior of the metassist Command

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 volume-defaults(4).

Changing the Volume Defaults File

Edit the volume defaults file (/etc/defaults/metassist.xml) to specify how the metassist command should behave.


Note –

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.


Example—Creating A Volume With Changed Defaults for the metassist Command

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.