createvsd Command

Purpose

createvsd – Creates a set of virtual shared disks, with their associated logical volumes.

Syntax

createvsd
-n {node_list | ALL} -s size_in_MB -g vg_name
 
[{-c vsds_per_node | -L}] [-A]
 
[{-m mirror_count | -p lvm_strip_size_in_K}] [-v vsd_name_prefix]
 
[-l lv_name_prefix] [-T lp_size_in_MB] [ -k vsd_type] [-x]
 

Description

Use this command to create a volume group with the specified name (if one does not already exist) and to create a logical volume within that volume group. You specify the logical volume size using the -s flag.

You can use the System Management Interface Tool (SMIT) to run this command. To use SMIT, enter:

smit vsd_data

and select the Create a virtual shared disk option.

Flags

Note: Some examples shown in this list do not contain enough flags to be executable. They are shown in an incomplete form to illustrate specific flags.
-n node_list
Specifies the node numbers of the peer domain on which you are creating virtual shared disks. The backup node cannot be the same as the primary node. For nonconcurrent virtual shared disks, the format of the node list is:
[P/S] : disk_list1+disk_list2/
For concurrent virtual shared disks, the format of the node list is:
[S1/S2/...Sn] : disk_list1+disk_list2/
"P" specifies the primary server node for serially accessed shared disks, "S" specifies the backup (secondary) server node for serially accessed shared disks, and S1 and S2 specifies the server nodes for concurrently accessed shared disks. disk_list1 is the list of local physical disks, or vpaths, for the logical volume on the primary. In other words, this list can be made up of hdiskx, hdisky,… or vpathx, vpathy,….
Note:
  1. Vpaths are available only if the "Subsystem Device Driver" is installed. Vpaths provide "virtual paths" to the same physical volume.
  2. Hdisks and vpaths cannot both be specified in the same list.
disk_list1+disk_list2 is the list of local physical disks or vpaths in the volume group on the primary, if you want to have more disks in the volume group than are needed for the logical volume. The sequence in which nodes are listed determines the names given to the virtual shared disks. For example:
createvsd -n 1,6,4 -v PRE
(with the vsd_prefix PRE) creates virtual shared disks PRE1n1 on node 1, PRE2n6 on node 6, and PRE3n4 on node 4.

To create a volume group that spans hdisk2, hdisk3, and hdisk4 on node 1, with a backup on node 3, enter:

createvsd -n 1/3:hdisk2,hdisk3,hdisk4/ -v DATA
This command creates:
  • Virtual shared disk DATA1n1 with logical volume lvDATA1n1 on a volume group with the global volume group name DATA1n1b3 on node 1, exported to node 3. The Logical Volume Manager (LVM) volume group name is DATA. The logical volumes span hdisk2, hdisk3, and hdisk4.

To create volume groups just like that one on nodes 1, 2, and 3 of a system with backup on nodes 4, 5, and 6 of the same system, enter:

createvsd -n 1/4:hdisk1,hdisk2,hdisk3/,2/5:hdisk5,hdisk6, \
          hdisk7/,3/6:hdisk2,hdisk4,hdisk6/ -v DATA

This command is shown on two lines here, but you must enter it without any spaces between the items in node_list.

The command creates:
  • Virtual shared disk DATA1n1 with logical volume lvDATA1n1 on a volume group with the local volume group name DATA on node 1, exported to node 4. The global volume group name is DATAn1b4.
  • Virtual shared disk DATA2n2 with logical volume lvDATA2n2 on a volume group with the local volume group name DATA on node 2, exported to node 5. The global volume group name is DATAn2b5.
  • Virtual shared disk DATA3n3 with logical volume lvDATA3n3 on a volume group with the local volume group name DATA on node 3, exported to node 6. The global volume group name is DATAn3b6.

To create a virtual shared disk where the logical volume spans only two of the physical disks in the volume group, enter:

createvsd -n 1/3:hdisk1,hdisk2+hdisk3/ -v DATA

This command creates the virtual shared disk DATA1n1 with logical volume lvDATA1n1 spanning hdisk1 and hdisk2 in the volume group DATA, which includes hdisk1, hdisk2, and hdisk3. It exports the volume group DATA to node 3.

If a volume group is already created and the combined physical hdisk lists contain disks that are not needed for the logical volume, those hdisks are added to the volume group. If the volume group has not already been created, createvsd creates a volume group that spans hdisk_list1+hdisk_list2.

Backup nodes cannot use the same physical disk as the primary does to serve virtual shared disks.

ALL specifies that you are creating virtual shared disks on all nodes in the RSCT peer domain. No backup nodes are assigned if you use this operand. The virtual shared disks will be created on all the physical disks attached to the nodes in node_list (you cannot specify which physical disks to use.)

-s
Specifies the size in megabytes of each virtual shared disk.
-g
Specifies the Logical Volume Manager (LVM) volume group name. This name is concatenated with the node number to produce the global volume group name. For example:
createvsd -n 6 -g VSDVG
creates a volume group with the local volume group name VSDVG and the global volume group name VSDVG1n6 on node 6. The node number is added to the prefix to avoid name conflicts when a backup node takes over a volume group. If a backup node exists, the global volume group name will be concatenated with the backup node number as well as the primary. For example:
createvsd -n 6/3/ -g VSDVG
creates a volume group with the local volume group name VSDVG and the global volume group name VSDVGn6b3. The primary node is node 6 and the backup node for this volume group is node 3.
-c
Specifies the number of virtual shared disks to be created on each node. If number_of_vsds_per_node is not specified, one virtual shared disk is created for each node specified on createvsd. If more than one virtual shared disk is to be created for each node, the names will be allocated alternately. For example:
createvsd -n 1,6 -c 2 -v DATA
creates virtual shared disks DATA1n1 on node 1, DATA2n6 on node 6, DATA3n1 on node 1, and DATA4n6 on node 6.
-L
Allows you to create one virtual shared disk on each node without using sequential numbers, for locally accessed virtual shared disks.
-A
Specifies that virtual shared disk names will be allocated to each node in turn, for example:
createvsd -n 1,6 -c 2 -A DATA
creates DATA1n1 and DATA2n1 on node 1, and DATA3n6 and DATA4n6 on node 6.
-m
Specifies the LVM mirroring count. The mirroring count sets the number of physical partitions allocated to each logical partition. The range is from 1 to 3 and the default value is 1.
-p
Specifies the LVM strip size (a strip size multiplied by the number of disks in an array equals the stripe size). If this flag is not specified, the logical volumes are not striped. To use striping, the node on which the virtual shared disks are defined must have more than one physical disk.
-v
Specifies a prefix to be given to the names of the created virtual shared disks. This prefix will be concatenated with the virtual shared disk number, node number, and backup node number, if a backup disk is specified. For example, if the prefix PRE is given to a virtual shared disk created on node 1 and there are already two virtual shared disks with this prefix across the partition, the new virtual shared disk name will be PRE3n1. The name given to the underlying logical volume will be lvPRE3n1, unless the -l flag is used. The createvsd command continues to sequence virtual shared disk names from the last PRE-prefixed virtual shared disk.
If -v is not specified, the prefix vsd is used.
Note: The last character of the vsd_name_prefix cannot be a digit. Otherwise, the 11th virtual shared disk with the prefix PRE would have the same name as the first virtual shared disk with the prefix PRE1. Nor can the vsd_name_prefix contain the character '.' because '.' can be any character in regular expressions.
-l
Overrides the prefix lvx that is given by default to a logical volume by the createvsd command, where x is the virtual shared disk name prefix specified by vsd_name_prefix or the default (vsd). For example:
createvsd -n 1 -v DATA
creates one virtual shared disk on node 1 named DATA1n1 with an underlying logical volume lvDATA1n1. If the command
createvsd -n 1 -v DATA -l new
is used, the virtual shared disk on node 1 is still named DATA1n1, but the underlying logical volume is named lvnew1n1.

It is usually more helpful not to specify -l, so that your lists of virtual shared disk names and logical volume names are easy to associate with each other and you avoid naming conflicts.

-T
Specifies the size of the physical partition in the Logical Volume Manager (LVM) logical volume group and also the logical partition size (they will be the same) in megabytes. You must select a power of 2 in the range 2 - 256. The default is 4MB.

The Logical Volume Manager limits the number of physical partitions to 1016 per disk. If a disk is greater than 4 gigabytes in size, the physical partition size must be greater than 4MB to keep the number of partitions under the limit.

-k vsd_type
Specifies the type of virtual shared disk. The options are:
  • VSD: specifies a serial access, or nonconcurrent, shared disk, or
  • CVSD: specifies a concurrent access shared disk.
The default is VSD.
-x
Specifies that the steps required to synchronize the virtual shared disks on the primary and secondary nodes should not be performed; that is, the sequence:
  • varyoffvg on the primary node
  • exportvg on the secondary node
  • importvg on the secondary node
  • chvg on the secondary node
  • varyoffvg on the secondary node
  • varyonvg on the primary nodes

is not done as part of the createvsd processing. This speeds the operation of the command and avoids unnecessary processing in the case where several virtual shared disks are being created on the same primary/secondary nodes. In this case, however, you should either not specify -x on the last createvsd in the sequence or issue the volume group commands listed above explicitly.

Parameters

None.

Security

You must have root authority to run this command.

Exit Status

0
Indicates the successful completion of the command.
-1
Indicates that an error occurred.

Restrictions

  1. The backup node cannot be the same as the primary node.
  2. The last character of vsd_name_prefix cannot be numeric.
  3. The vsd_name_prefix cannot contain the character '.'.

You must issue this command from a node that is online in the peer domain. To bring a peer domain online, use the startrpdomain command. To bring a particular node online in an existing peer domain, use the startrpnode command. For more information on creating and administering an RSCT peer domain, refer to the RSCT: Administration Guide.

Standard Output

For the following command:

createvsd -n 1/2:hdisk13/ -s 1024 -g testvg -v testvsd -T 16

The messages to standard output will be similar to:

createvsd: calls Getopts.
createvsd: parsing node_list.
createvsd: creates task tables.
createvsd: calls checkclvm.perl on the nodes c164n11.ppd.pok.ibm.com
createvsd: calls domkvglv.perl.
OK:1:mkvg -f -y testvg -s 16 hdisk13
OK:1:mklv -a c -y lvtestvsd1n1 -e x testvg 64 hdisk13
It took about 8 seconds in mkvglv.
createvsd: calls dovaryoffvg.perl testvg on the primary node c164n11.ppd.pok.ibm.com
OK:1:chvg -a n testvg
OK:1:varyoffvg testvg
createvsd: calls doimportvg.perl testvg on the nodes c164n12.ppd.pok.ibm.com with 000048186b991a6f
importvg : testvg
importvg : OK:2:importvg -y testvg hdisk5
importvg : OK:2:chvg -a n testvg
importvg : timestamp 2 testvg 3e036cb33403c8c8
importvg : OK:2:varyoffvg testvg
importvg : It took about 10 seconds.
It took about 12 seconds in importvg.
createvsd: calls vsdvg.
OK:1:vsdvg -g testvgn1b2 testvg 1 2
It took about 12 seconds in vsdvg.
createvsd: calls dovaryonvg.perl testvg on pri nodes c164n11.ppd.pok.ibm.com
OK:1:varyonvg  testvg
createvsd: calls defvsd.
OK:1:defvsd lvtestvsd1n1 testvgn1b2 testvsd1n1
It took about 5 seconds in defvsd.   

Examples

To create two 4MB virtual shared disks on each of three primary nodes, one of which has a backup, enter:

createvsd -n 3,4,7/8/ -c 2 -s 4 -g vsdvg -v TEMP

This command creates the following virtual shared disks:

To create three virtual shared disks, where the logical volume created on node 3 spans fewer disks than the volume group does, enter:

createvsd -n 3,4/:hdisk1,hdisk2+hdisk3/,7/8/ -s 4 -g datavg -v USER
This command creates:
  • USER1n3, with logical volume lvUSER1n3 defined on a volume group with the global volume group name datavgn3 on node 3.
  • USER2n4, with logical volume lvUSER2n4 defined on a volume group with the global volume group name datavgn4 on node 4. datavgn4 spans hdisk1, hdisk2, and hdisk3. lvUSER2n4 spans hdisk1 and hdisk2.
  • USER3n7, with logical volume lvUSER3n7 defined on a volume group with the global volume group name datavgn7b8 on node 7, also imported to node 8.
  • If no volume group was defined on nodes 3 and 7 before this createvsd command was issued, the volume groups datavgn3 and datavgn7b8 are created with one 4MB partition from a single physical disk.

Location

/opt/rsct/vsd/bin/createvsd