Previous  |  Next  >  
Product: Volume Replicator Guides   
Manual: Volume Replicator 4.1 Administrator's Guide   

Administering Data Volumes

Associating a Volume to a Replicated Data Set

The vradmin addvol command can be used to add a volume to a RDS even when replication is in progress. This command associates a volume to all the RVGs of the RDS. Note that volumes of the same name and same length must exist on all Secondaries and the Primary of the RDS. You must create volumes of the required layout on the Secondary and Primary hosts before issuing the vradmin addvol command. If necessary, the vradmin addvol command can be used to add a volume to an RDS that only has a Primary RVG. In this case, there are no Secondary volumes.

By default, the vradmin addvol command adds DCM logs to the data volumes being added to the RDS, if they have not already been added. If any of the data volumes contains a DRL log, the vradmin addvol command removes the DRL log before adding the DCM to the data volume.

The -nodcm option with the vradmin addvol command adds data volumes to the RDS without adding DCMs to the data volumes. If any of the data volumes has a DRL, the DRL is removed before the data volume is associated with the RVG. If -nodcm is issued when any of the RLINKs has srlprot set to dcm or autodcm, and any of the data volumes being added to the RDS does not already have a DCM log, the command will fail.

The vradmin addvol command can be run from any host in the RDS. If the vradmin addvol command fails on any of the hosts in the RDS during its execution, the volume is not added on any host.

Before adding a volume, the vradmin addvol command displays a warning and prompts the user to confirm whether or not the Primary and Secondary volumes contain the same data. To verify that the Primary and Secondary volumes contain the same data, refer to the information provided in the section Performing Offline Data Verification. To synchronize the Primary and Secondary volumes, see Synchronizing Volumes on the Local Host and Remote Hosts. To skip this confirmation, use the -s option with the vradmin addvol command. The -s option to the vradmin addvol command proves useful in scripts.

Prerequisites for adding a volume to an RDS:

    Checkmark  Create volumes of same name and length as the Primary volume on all the hosts in the RDS.

    Checkmark  Verify that the volumes to be added are inactive.

    Checkmark  Synchronize the volumes using the vradmin syncvol command before adding the volumes to the RDS. Refer to Synchronizing Volumes on the Local Host and Remote Hosts.


    Note   Note    To add a volume to an RDS that has only a Primary RVG, the prerequisites above do not apply.

  To add a volume to an RDS:


 # vradmin -g diskgroup addvol local_rvgname volume_name
The argument local_rvgname is the name of the RVG on the local host and represents its RDS.
The argument volume_name is the name of the volume to be added to the RDS. Only one volume can be added at a time.

Use the -nodcm option when you do not want to add DCMs to the data volumes. By default, DCMs are automatically added.

Example:

This example shows how to add an existing volume hr_dv01 to all RVGs of the RDS. The disk group hrdg contains the local RVG hr_rvg of the RDS. To add the volume hr_dv01 to all RVGs in the RDS and automatically add DCMs to the data volumes, type the following command on any host:


 # vradmin -g hrdg addvol hr_rvg hr_dv01

Verifying the Data on the Primary and Secondary Volumes

The vradmin syncvol command when used with the -verify option enables you to verify whether the remote volumes and the corresponding local volumes are identical before adding them to an RDS. Use this command when the volumes are not associated with an RVG and the application is inactive (the volumes are not in use). VVR also allows you to verify the data volumes after they have been added to an RDS. For information, refer to Verifying the Data on the Secondary.

The vradmin -verify syncvol command only reports the amount of data that is different in percentage between remote and local volumes; it does not synchronize remote volumes with local volumes. If you find that the Primary data and Secondary data do not match then you can use some manual means such as backup and restore or some other method to make the data on the new Secondary volume the same as the Primary and then add it to the RDS.


Note   Note    Remote volumes can be verified with local volumes only if the /etc/vx/vras/.rdg file on the remote host contains a local disk group ID entry. Ensure that each disk group ID entry in the .rdg file is on a separate line.

Note that the order of the volume names in the local and remote volume lists is important. The vradmin -verify syncvol command verifies the first volume in the remote volume list with the first volume in the local volume list, and so on. Hence, the number of volumes in the local and remote volume lists must be same. Also, the remote disk group name must be specified if volume names are different on local and remote hosts.

It is recommended that the names of the volumes on the local and remote hosts be the same. However, you can verify volumes with different names on the local and remote hosts using the vradmin -verify syncvol command.

  To verify the difference between the local and remote data volumes


# vradmin -g diskgroup -verify syncvol local_vols_list \
remote_hostname...
The argument local_vols_list is a comma-separated list of volumes on the local host. The names of the volumes on the local and remote hosts are assumed to be the same.
The argument remote_hostname is a space-separated list of names of the remote hosts on which the volumes to be verified reside. It must be possible for IP to resolve the remote host names.

Example:

This example shows how to verify the differences between the remote volumes on host london with the local volumes hr_dv01, hr_dv02, hr_dv03 in the disk group hrdg on the local host seattle. The names of the disk group and the volumes on the remote host are the same as names of the disk group and volumes on the local host.


 # vradmin -g hrdg -verify syncvol hr_dv01,hr_dv02,hr_dv03 london

Synchronizing Volumes on the Local Host and Remote Hosts

The vradmin syncvol command enables you to synchronize remote volumes with local volumes when the volumes are not associated with an RVG and the volumes are not in use. The data in the volumes on the local host, where you enter the command, is transferred over the network to the volumes on the remote host.

Use the vradmin syncvol command only to synchronize volumes that are not part of an RVG. For example, before adding a volume to an RDS, synchronize the volume using the vradmin syncvol command, and then add it to the RDS.

Using the vradmin syncvol command, you can synchronize remote volumes with local volumes using one of the following options:

  • Difference-based synchronization
  • Full synchronization

By default, the vradmin syncvol command synchronizes the volumes using difference-based synchronization. We recommend that the names of the volumes on the local and remote hosts be the same. However, you can synchronize volumes with different names on the local and remote hosts using the vradmin syncvol command.


Note   Note    The vradmin syncvol command cannot be used for an RVG that has volume-set component volumes associated to it.

You can supply a list of volumes to be synchronized. If you choose this method, the order of the volume names in the local and remote volume lists is important. The vradmin syncvol command synchronizes the first volume in the remote volume list with the first volume in the local volume list, and so on. Hence, the number of volumes in the local and remote volume lists must be the same. Also, the remote disk group name must be specified if volume names are different on the local and remote hosts.


Note   Note    Remote volumes can be synchronized with local volumes only if the /etc/vx/vras/.rdg file on the remote host contains a local disk group ID entry. Ensure that each disk group ID entry in the .rdg file is on a separate line.

To enable the vradmin syncvol command for a specific disk group on a remote host, enter the local disk group ID in the /etc/vx/vras/.rdg file on the remote host. To enable the vradmin syncvol command for all disk groups on a remote host, enter a plus (+) sign in the /etc/vx/vras/.rdg file on the remote host. For more information, see the vradmin(1M) manual page.

Before synchronizing volumes, the vradmin syncvol command displays a warning and prompts the user to confirm whether or not the data on the volumes on the remote host can be overwritten with the data on the volumes on the local host. To skip this confirmation, use the -s option with the vradmin syncvol command. The -s option to the vradmin syncvol command proves useful in scripts.


Synchronizing Volumes Using Full Synchronization

In full synchronization, all data is transferred between hosts. Use full synchronization to create initial copies of volumes. To do a full synchronization, specify the option -full.

To synchronize volumes on local and remote hosts using full synchronization:


 # vradmin -g diskgroup -full syncvol local_vols_list \ 
   remote_hostname....
The argument local_vols_list is a comma-separated list of volumes on the local host. The names of the volumes on the local and remote hosts are assumed to be the same.
The argument remote_hostname is a space-separated list of names of the remote hosts on which the volumes to be resynchronized reside. It must be possible for IP to resolve the remote host names.

Example:

This example shows how to do a full synchronization of the remote volumes on host london with the local volumes hr_dv01, hr_dv02, hr_dv03 in the disk group hrdg on the local host seattle. The names of the disk group and the volumes on the remote host are the same as the names of the disk group and volumes on the local host.


 # vradmin -g hrdg -full syncvol hr_dv01,hr_dv02,hr_dv03 london

Synchronizing Volumes Using Difference-Based Synchronization

In difference-based synchronization, VVR compares the blocks of data between the hosts and then transfers over the network only those blocks of data that are different. Difference-based synchronization is useful when there is little difference between the data on the local and remote volumes.

To synchronize volumes on local and remote hosts using difference-based synchronization:


 # vradmin -g diskgroup syncvol local_vols_list remote_hostname....
The argument local_vols_list is a comma-separated list of volumes on the local host. In this case, the names of the volumes on the local and remote hosts are the same.
The argument remote_hostname is a space-separated list of names of the remote hosts on which the volumes to be resynchronized reside. It must be possible for IP to resolve the remote host names.

Example 1:

This example shows how to do a difference-based synchronization of the remote volumes on host london with the volumes hr_dv01, hr_dv02, hr_dv03 in the disk group hrdg on local host seattle. The names of the disk group and the volumes on the remote host are the same as names of the disk group and volumes on the local host.


 # vradmin -g hrdg syncvol hr_dv01,hr_dv02,hr_dv03 london

Example 2:

In this example, the names of the volumes on the remote host are different from the names of the volumes on the local host. It shows how to do a difference-based synchronization of the remote volumes hr_dvmaster and hr_dvoralog on host london with the local volumes hr_dv01 and hr_dv02 in the disk group hrdg.


 # vradmin -g hrdg syncvol hr_dv01,hr_dv02 \
   london:hrdg:hr_dvmaster,hr_dvoralog

Associating the Component Volumes of a Volume Set to an RDS

This section describes how to associate component volumes of a volume set to an RDS. A volume set is a container object for a group of volumes that can be a part of a Multi-device File System (MDFS). Associating the component volumes of a volume set to an RDS enables you to replicate an MDFS.

The component volumes of a volume set have assigned indices. Applications use these indices to identify a component volume. To be able to successfully start applications on the Secondary if a disaster occurs, the component volumes of the volume set on the Secondary must have the same indices as those of the corresponding Primary volumes.

This section assumes that the volume set that is to be replicated already exists on the Primary and its Secondaries. If the volume set does not exist, create the volume set. For more information about volume sets, see the VERITAS Volume Manager Administrator's Guide.


Note   Note    You cannot associate a component volume of a volume set as an SRL.

Before associating component volumes of a volume set to an RDS, ensure that these volumes have identical indices on the Primary and its Secondaries.


Note   Note    The vradmin syncrvg command cannot be used for an RDS that has component volumes of a volume set associated to it. Also, you cannot use the vradmin syncvol command to synchronize volumes that are components of a volume set.

  To associate component volumes of a volume set to an RDS

  1. Verify whether the component volumes of the volume set on the Primary and its Secondaries have identical indices. To view the indices, use the following command:
    vxvset -g diskgroup list vset_name
  2. If the indices of the component volumes on the Primary volume set and Secondary volume set are identical, go to step 4.
  3. If the indices of the component volumes on the Primary volume set and Secondary volume set are different, perform the following steps on the Secondary:
    1. Dissociate each volume from the volume set using the following command:

    2.    # vxvset -g diskgroup rmvol vset_name compvol_name

        When you remove the last volume, the volume set is also removed.

    3. Create the volume set using the following command:
      • # vxvset -g diskgroup -o index make vset_name compvol_name index

    4. Associate each of the remaining volumes to the volume set specifying the index of the corresponding volumes on the Primary using the following command:
      • # vxvset -g diskgroup -o index addvol vset_name compvol_name index

  4. Associate each component volume to the RDS using the following command:
    vradmin -g diskgroup addvol rvg_name compvol_name

Example:

This example shows how to associate the component volumes hr_cv1 and hr_cv2 of the volume set hr_vset to the RDS hr_rvg. The example assumes that the component volumes have identical indices.

  1. Verify whether the component volumes of the volume set hr_vset on the Primary and its Secondaries have identical indices using the following command on the Primary and its Secondaries:
    vxvset -g hrdg list hr_vset

    Output looks like this:


       VOLUME           INDEX        LENGTH     KSTATE  CONTEXT
       hr_cv1              0      8388608        ENABLED      -
       hr_cv2              1      8388608        ENABLED         -
  2. Associate the component volumes hr_cv1 and hr_cv2 to the RDS hr_rvg using the following commands:
    vradmin -g hrdg addvol hr_rvg hr_cv1
    vradmin -g hrdg addvol hr_rvg hr_cv2

Associating a Data Change Map to a Data Volume

The vradmin createpri, vradmin addsec, and vradmin addvol commands associate the Data Change Map (DCM) to the data volume by default. This section describes how to associate DCMs to a data volume in an existing VVR configuration. For more information about the DCM object, see Data Change Map.

  To associate a Data Change Map to a Data Volume

The vxassist command enables you to associate a DCM to a new data volume or an existing data volume.

  • Create the data volume and associate the DCM as follows:

  •    # vxassist -g diskgroup make dv_name....... logtype=dcm

OR

  • Associate the DCM with an existing data volume as follows:

  •    # vxassist -g diskgroup addlog dv_name logtype=dcm

VVR mirrors the DCM by default. If loglen is not specified, vxassist calculates a suitable size for the DCM. For more information, see Determining the Region Size.


Note   Note    If you try to grow a volume that has a DCM, an error message warns you if the DCM is not large enough for the increased size. In this case, dissociate the DCM, grow the volume, and then associate a new DCM to the volume.

Determining the Region Size

VVR calculates the DCM size based on the size of the volume. The default size of the DCM ranges from 4K to 256K depending on the size of the volume. However, you can specify the size of the DCM to a maximum of 2 MB. Internally, the DCM is divided into two maps: the active map and the replay map. Each bit in the DCM represents a contiguous number of blocks in the volume it is associated with, which is referred to as the region.

Click the thumbnail above to view full-sized image.

The region size is calculated based on the volume size divided by half the DCM size in bits. The minimum region size is 32 blocks or 32 kilobytes.

The following table gives examples of the region sizes for volumes of different sizes in a non-CDS (Cross-Platform Data Sharing) disk group and a CDS disk group with the default DCM size and a user-specified DCM size of 2 MB.

Volume Size Non-CDS Disk Group CDS Disk Group
Default DCM Size Region Size for Default DCM Size Region Size for a DCM Size of 2 MB Specified by the User Default DCM Size

Region Size for Default DCM Size Region Size for a DCM Size of 2 MB Specified by the User.

1 MB

1K

32K

32K

16K

32K

32K

100 MB

1K

32K

32K

16K

32K

32K

200 MB

2K

32K

32K

16K

32K

32K

400 MB

4K

32K

32K

16K

32K

32K

1 GB

9K

32K

32K

16K

32K

32K

2 GB

17K

32K

32K

32K

32K

32K

4 GB

33K

32K

32K

48K

32K

32K

8 GB

65K

32K

32K

80K

32K

32K

20 GB

161K

32K

32K

176K

32K

32K

40 GB

161K

64K

32K

176K

64K

32K

100 GB

201K

128K

32K

208K

128K

32K

200 GB

229K

224K

32K

240K

224K

32K

400 GB

247K

416K

64K

256K

416K

64K

1 TB

249K

1056K

160K

256K

1056K

160K

Resizing a Data Volume in a Replicated Data Set

The vradmin resizevol command enables you to resize a data volume in a Replicated Data Set (RDS) even when replication is in progress. The vradmin resizevol command resizes the data volumes in all the RVGs in the RDS. The vradmin resizevol command can be entered from any host in an RDS.


Caution  Caution    To avoid any problems with the file system on the Secondary, run the vradmin resizevol command only when the Secondary is up-to-date. VVR replicates changes to the meta data of a file system on the Primary data volumes to the Secondary. If a takeover happens while these changes are yet to be applied to the Secondary data volumes, the size of the file system may not match the size of the underlying data volume and it may not be possible to mount the file system on the new Primary. If this occurs, run the file system- specific commands to recover the file system.

Important Notes on Resizing a Data Volume in a Replicated Data Set

  • If the Primary data volume contains a file system, the vradmin resizevol command also resizes the file system using the vxresize command. For more information, see the vxresize (1M) manual page.
  • The vradmin resizevol command pauses replication, resizes the data volume, and then resumes replication.
  • If you want to increase the size of a data volume, make sure there is enough space on the Primary and the Secondary.

  • Note   Note    When you increase the size of a data volume, the newly added portions on the Primary and Secondary data volumes are not synchronized. In this case, the output of the vradmin verifydata command will show that the checksums for the Primary and Secondary data volumes do not match.
  • If the vradmin resizevol command fails on any of the hosts in the RDS during its execution, the original volume sizes are not restored. This results in volume size mismatch on the Primary and its Secondaries. To correct this mismatch, correct the error condition and then reissue the vradmin resizevol command and resume the Secondary RLINKs.


Prerequisites for resizing a data volume in an RDS:

    Checkmark  The data volume must exist in the disk group and be associated with the RVGs for all hosts in the RDS.

    Checkmark  If you want to increase the size of a data volume, make sure there is enough space in the disk group on the Primary and the Secondary by issuing the following command:


      # vxdg -g diskgroup free

To resize a volume in an RDS:


# vradmin -g diskgroup [-f] resizevol local_rvgname volume_name \
volume_length
The argument local_rvgname is the name of the RVG on the local host and represents its RDS. The -f option is required if the data volume involved in the resizevol operation is being decreased in size.
The argument volume_name is the name of the data volume to be resized.
The argument volume_length is the desired size of the data volume to be resized. You can specify the volume length using the standard length convention. You can specify a prefix of either the plus (+) or minus (-) sign to increase or decrease the data volume size by the specified amount.

Examples:

The following examples show how to resize to different lengths an existing volume hr_dv01 in all RVGs of the RDS represented by its local RVG hr_rvg. The disk group hrdg contains the local RVG hr_rvg.

To resize the volume hr_dv01 to 100 gigabytes, type the following command on any host in the RDS:


 # vradmin -g hrdg resizevol hr_rvg hr_dv01 100G

To increase the size of the data volume hr_dv01 by 100 megabytes when the Primary and Secondary data volumes are the same size, type the following command on any host in the RDS:


 # vradmin -g hrdg resizevol hr_rvg hr_dv01 +100M

To decrease the size of the data volume hr_dv01 by 500 kilobytes (K) when the Primary and Secondary data volumes are the same size, type the following command on any host in the RDS:


 # vradmin -g hrdg -f resizevol hr_rvg hr_dv01 -500K

Dissociating a Data Volume from its Replicated Data Set

You can remove a data volume from a Replicated Data Set (RDS) using the vradmin delvol command. The vradmin delvol command dissociates a data volume from all the RVGs in an RDS; the volumes are not deleted.

The vradmin delvol command can be entered from any host in an RDS. If the vradmin delvol command fails on any of the hosts in the RDS during its execution, the original configuration remains unchanged.

  To remove a data volume from an RDS when the Primary RVG has been stopped

Type the following command on any host in the RDS:


  # vradmin -g diskgroup delvol local_rvgname volume_name
The argument local_rvgname is the name of the RVG on the local host and represents its RDS.
The argument volume_name is the name of the volume to be removed from the RDS.

  To remove a data volume from an RDS when the Primary RVG has not been stopped


Note   Note    Although you can use -f option with vradmin delvol command to remove a data volume from an RDS when the Primary RVG has not been stopped, this is not the recommended approach. It is recommended that you stop the Primary RVG before proceeding with this command.

Type the following command on any host in the RDS:


 # vradmin -g diskgroup -f delvol local_rvgname volume_name
The argument local_rvgname is the name of the RVG on the local host and represents its RDS.
The argument volume_name is the name of the volume to be removed from the RDS.

Example:

This example shows how to remove a data volume hr_dv01 from all RVGs of its RDS. The data volume hr_dv01 resides on the local host london on which the command is entered. The data volume hr_dv01 is associated with the local RVG hr_rvg, which belongs to the disk group hrdg.


  # vradmin -g hrdg delvol hr_rvg hr_dv01
 ^ Return to Top Previous  |  Next  >  
Product: Volume Replicator Guides  
Manual: Volume Replicator 4.1 Administrator's Guide  
VERITAS Software Corporation
www.veritas.com