In a diskset configuration, two hosts are physically connected to the same set of disks. When one host fails, the other host has exclusive access to the disks. The metaset command administers sets of disks shared for exclusive (but not concurrent) access between such hosts. While disksets enable a high-availability configuration, Solaris Volume Manager itself does not actually provide a high-availability environment.
Shared metadevices/hot spare pools can be created only from drives which are in the diskset created by metaset. To create a set, one or more hosts must be added to the set. To create metadevices within the set, one or more devices must be added to the set. The drivename specified must be in the form cxtxdx with no slice specified.
When you add a new disk to a disk set, Solaris Volume Manager checks the disk format. If necessary, it repartitions the disk to ensure that the disk has an appropriately configured slice 7 (or slice 6 on an EFI labelled device), with adequate space for a state database replica. The precise size of slice 7 (or slice 6 on an EFI labelled device), depends on the disk geometry. The slice will be no less than 4 Mbytes, and probably closer to 6 Mbytes, depending on where the cylinder boundaries lie.
The minimal size for slice 7 (or slice 6 on an EFI labelled device), might change in the future. This change is based on a variety of factors, including the size of the state database replica and information to be stored in the state database replica.
For use in disk sets, disks must have a slice seven that meets specific criteria:
Slice 7 must start at sector 0
Slice 7 must include enough space for disk label
State database replicas cannot be mounted does not overlap with any other slices, including slice 2
If the existing partition table does not meet these criteria, Solaris Volume Manager repartitions the disk. A small portion of each drive is reserved in slice 7 (or slice 6 on an EFI labelled device), for use by Solaris Volume Manager. The remainder of the space on each drive is placed into slice 0. Any existing data on the disks is lost by repartitioning.
After you add a drive to a disk set, it might be repartitioned as necessary, with the exception that slice 7 (or slice 6 on an EFI labelled device), is not altered in any way. The minimum size for slice seven is variable, based on disk geometry, but is always equal to or greater than 4MB.
After a diskset is created and metadevices are set up within the set, the metadevice name will be in the following form:
where setname is the name of the diskset, and number is the number of the metadevice (0-127).
Hot spare pools within local disksets use standard Volume Manager naming conventions. Hot spare pools with shared disksets use the following convention:
where setname is the name of the diskset, and number is the number of the hot spare pool (0-999).
SVM provides support for a low-end HA solution consisting of two hosts that share only two strings of drives. The hosts in this type of configuration, referred to as mediators or mediator hosts, run a special daemon, rpc.metamedd(1M). The mediator hosts take on additional responsibilities to ensure that data is available in the case of host or drive failures.
A mediator configuration can survive the failure of a single host or a single string of drives, without administrative intervention. If both a host and a string of drives fail (multiple failures), the integrity of the data cannot be guaranteed. At this point, administrative intervention is required to make the data accessible. See mediator(7D) for further details.
Use the -m option, described below, to add or delete a mediator host.
The following options are supported:
Adds drives or hosts to the named set. For a drive to be accepted into a set, the drive must not be in use within another metadevice or diskset, mounted on, or swapped on. When the drive is accepted into the set, it is repartitioned and the metadevice state database replica (for the set) may be placed on it. However, if a slice 7 (or slice 6 on an EFI labelled device), starts at cylinder 0, and is large enough to hold a state database replica, then the disk is not repartioned. Also, a drive is not accepted if it cannot be found on all hosts specified as part of the set. This means that if a host within the specified set is unreachable due to network problems, or is administratively down, the add will fail.
Insures that the replicas are distributed according to the replica layout algorithm. This can be invoked at any time, and will do nothing if the replicas are correctly distributed. In cases where the user has used the metadb command to manually remove or add replicas, this command can be used to insure that the distribution of replicas matches the replica layout algorithm.
Deletes drives or hosts from the named diskset. For a drive to be deleted, it must not be in use within the set. The last host cannot be deleted unless all of the drives within the set are deleted. Note that deleting the last host in a diskset destroys the diskset.
Forces one of three actions to occur: takes ownership of a diskset when used with -t; deletes the last disk drive from the diskset; or deletes the last host from the diskset. (Deleting the last drive or host from a diskset requires the -d option.) When used to forcibly take ownership of the diskset, this causes the diskset to be grabbed whether or not another host owns the set. All of the disks within the set are taken over (reserved) and fail fast is enabled, causing the other host to panic if it had diskset ownership. The metadevice state database will be read in by the host performing the take, and the shared metadevices contained in the set will be accessible. The -f option is also used to delete the last drive in the diskset, because this drive would implicitly contain the last state database replica. The -f option is also used for deleting hosts from a set. When specified with a partial list of hosts, it can be used for one-host administration. One-host administration could be useful when a host is known to be non-functional, thus avoiding timeouts and failed commands. When specified with a complete list of hosts, the set is completely deleted. It is generally specified with a complete list of hosts to clean up after one-host administration has been performed.
Specifies one or more host names to be added to or deleted from a diskset. Adding the first host creates the set. The last host cannot be deleted unless all of the drives within the set have been deleted. The host name is not accepted if all of the drives within the set cannot be found on the specified host. The host name is the same name found in /etc/nodename.
Sets the size (in blocks) for the metadevice state database replica. The length can only be set when adding a new drive; it cannot be changed on an existing drive. The default (and maximum) size is 8192 blocks, which should be appropriate for most configurations. The minimum size of the length is 64 blocks.
Adds (-a) or deletes (-d) mediator hosts to the specified diskset. A mediator_host_list is the nodename(4) of the mediator host to be added and (for adding) up to two other aliases for the mediator host. The nodename and aliases for each mediator host are separated only by commas. Up to two mediator hosts can be specified for the named diskset. For deleting a mediator host, specify only the nodename of that host as the argument to -m.
In a single metaset command you can add or delete two mediator hosts. See EXAMPLES.
Returns an exit status of 0 if the local host or the host specified with the -h option is the owner of the diskset.
Releases ownership of a diskset. All of the disks within the set are released. The metadevices set up within the set are no longer accessible.
Specifies the name of a diskset on which metaset will work. If no setname is specified, all disksets are returned.
Takes ownership of a diskset safely. If metaset finds that another host owns the set, this host will not be allowed to take ownership of the set. If the set is not owned by any other host, all the disks within the set will be owned by the host on which metaset was executed. The metadevice state database is read in, and the shared metadevices contained in the set become accessible. The -t option will take a diskset that has stale databases. When the databases are stale, metaset will exit code 66, and a message will be printed. At that point, the only operations permitted are the addition and deletion of replicas. Once the addition or deletion of the replicas has been completed, the diskset should be released and retaken to gain full access to the data.
This example defines a diskset.
# metaset -s relo-red -a -h red blue
The name of the diskset is relo-red. The names of the first and second hosts added to the set are red and blue, respectively. (The hostname is found in /etc/nodename.) Adding the first host creates the diskset. A diskset can be created with just one host, with the second added later. The last host cannot be deleted until all of the drives within the set have been deleted.
This example adds drives to a diskset.
# metaset -s relo-red -a c2t0d0 c2t1d0 c2t2d0 c2t3d0 c2t4d0 c2t5d0
The name of the previously created diskset is relo-red. The names of the drives are c2t0d0, c2t1d0, c2t2d0, c2t3d0, c2t4d0, and c2t5d0. Note that there is no slice identifier ("sx") at the end of the drive names.
The following command adds two mediator hosts to the specified diskset.
# metaset -s mydiskset -a -m myhost1,alias1 myhost2,alias2
See attributes(5) for descriptions of the following attributes:
metaclear(1M), metadb(1M), metadetach(1M), metahs(1M), metainit(1M), metaoffline(1M), metaonline(1M), metaparam(1M), metareplace(1M), metaroot(1M), metastat(1M), metasync(1M), metattach(1M), md.cf(4), md.tab(4), mddb.cf(4), attributes(5)
Diskset administration, including the addition and deletion of hosts and drives, requires all hosts in the set to be accessible from the network.