Determining the minimum acceptable snapshot size

During the backup operation, if the snapshot status transitions to INACTIVE for Linux® LVM or INVALID for AIX® JFS2, the backup operation will end with an error.

About this task

The snapshot size must be large enough to accommodate the changes on the source logical volumes while the snapshot is being copied to the vSnap server. To fix the error, you must determine the snapshot size that doesn’t result in an INACTIVE status for Linux and INVALID status for AIX by using this procedure.

If the volume group has more free space than the source volume, you can skip this procedure by setting the Db2MaximumAllocationInPercent parameter to 100.
Remember: When the Db2MaximumAllocationInPercent is set to 100, the snapshot size is adjusted to match the size of the source volume. This applies to the scenarios where all blocks on the source volume change during the backup.

Procedure

Follow the instructions for your operating system:
  • To determine the minimum acceptable snapshot size for Linux, complete the following steps:
    1. Create a snapshot that is larger than 25% of the source logical volume size by issuing the following command:
      lvcreate -s -n snapshot_name -L snapshot_size source_lv

      where snapshot_name specifies the name of the snapshot, snapshot_size specifies the size, and source_lv specifies the source logical volume.

    2. Periodically run the following command to monitor the status. Continue to monitor the status for a length of time that is equal to a backup operation.
      lvs snapshot_name
      or
      lvdisplay snapshot_name
      If the snapshot size is valid, you will see output that is similar to the following example:
      lvdisplay /dev/SPPlog0vg/snap-test0
       ? Logical volume ?
       LV Path                /dev/SPPlog0vg/snap-test0
       LV Name                snap-test0
       VG Name                SPPlog0vg
       LV UUID                pkKCh1-C5mm-oCs8-JMFc-kTiY-FOtE-r3isw8
       LV Write Access        read/write
       LV Creation host, time floridaprod1, 2021-10-12 16:06:15 +0200
       LV snapshot status     active destination for lvSPPlog0
       LV Status              available
       open                   0
       LV Size                252.00 MiB
       Current LE             63
       COW-table size         52.00 MiB
       COW-table LE           13
       Allocated to snapshot  96.25%
       Snapshot chunk size    4.00 KiB
       Segments               1
       Allocation             inherit
       Read ahead sectors     auto
       currently set to       8192
       Block device           253:25
      

      If the LV snapshot status field has a value of active, the snapshot size is valid. Note the snapshot size that you used for future reference.

      If the snapshot size is valid, skip the remaining steps in this procedure.

      If the snapshot size is invalid, you will see output that is similar to the following example. The LV snapshot status field shows a value of INACTIVE:
      lvdisplay /dev/SPPlog0vg/snap-test0
       ? Logical volume ?
       LV Path                /dev/SPPlog0vg/snap-test0
       LV Name                snap-test0
       VG Name                SPPlog0vg
       LV UUID                pkKCh1-C5mm-oCs8-JMFc-kTiY-FOtE-r3isw8
       LV Write Access        read/write
       LV Creation host, time floridaprod1, 2021-10-12 16:06:15 +0200
       LV snapshot status     INACTIVE destination for lvSPPlog0
       LV Status              available
       open                   0
       LV Size                252.00 MiB
       Current LE             63
       COW-table size         52.00 MiB
       COW-table LE           13
       Snapshot chunk size    4.00 KiB
       Segments               1
       Allocation             inherit
       Read ahead sectors     auto
       currently set to       8192
       Block device           253:25 
      
    3. If the LV snapshot status is INACTIVE, you must delete the snapshot by issuing the following command:
      lvremove -f snapshot_name
    4. Repeat steps 1 to 3 to determine a valid snapshot size that does not result in an INACTIVE status.
  • To determine the minimum acceptable snapshot size for AIX, complete the following steps:
    1. Create a snapshot that is larger than 25% of the source logical volume size by issuing the following command:
      snapshot -o snapfrom=src_fs_path -o size=snapshot_size M

      where src_fs_path specifies source file system path, and snapshot_size specifies the snapshot size.

    2. Periodically run the following command to monitor the status. Run the command for a length of time that is equal to the time required for a backup operation.
      snapshot -q srv_fs_path
      If the snapshot size is valid, you will see output that is similar to the following example:
      snapshot -q /db2/SPN/log_dir/NODE0000
      Snapshots for /db2/SPN/log_dir/NODE0000
      Current  Location          512-blocks        Free Time
      *   /dev/fslv00            65536       64768 Wed Oct 13 19:41:19
      CEST 2021
      

      If the output does not include the word INVALID, the snapshot size is valid. Note the snapshot size that you used for future reference.

      If the snapshot size is valid, skip the remaining steps in this procedure.

      If the snapshot size is invalid, you will see output that is similar to the following example:
      snapshot -q /db2/SPN/log_dir/NODE0000
      Snapshots for /db2/SPN/log_dir/NODE0000
      Current  Location          512-blocks        Free Time
      INVALID  /dev/fslv00       65536             Wed Oct 13
      19:41:19 CEST 2021
      
    3. If the snapshot status is INVALID, you must delete the snapshot by issuing the following command:
      snapshot -d snapshot_LV
    4. Repeat steps 1 to 3 to determine a valid snapshot size that does not result in INVALID status.

What to do next

Configure the guestapps.conf file by using the resulting snapshot size. For instructions, see Configuring the guestapps.conf file.