Assigning allocation policies

The following example shows how to assign allocation policies. The example volume set contains four volumes from different classes of storage.

To assign allocation policies

  1. List the volumes in the volume set:

      # vxvset -g rootdg list myvset
      vol1     0       102400    ACTIVE  -
      vol2     1       102400    ACTIVE  -
      vol3     2       102400    ACTIVE  -
      vol4     3       102400    ACTIVE  -
  2. Create a file system on the myvset volume set and mount the file system:

      # mkfs -t vxfs /dev/vx/rdsk/rootdg/myvset
      version 7 layout
      204800 sectors, 102400 blocks of size 1024,
      log size 1024 blocks
      largefiles supported
      # mount -t vxfs /dev/vx/dsk/rootdg/myvset /mnt1
  3. Define three allocation policies, v1, bal_34, and rr_all, that allocate from the volumes using different methods:

      # fsapadm define /mnt1 v1 vol1
      # fsapadm define -o balance -c 64k /mnt1 bal_34 vol3 vol4
      # fsapadm define -o round-robin /mnt1 rr_all vol1 vol2 vol3 vol4
      # fsapadm list /mnt1
      name       order       flags    chunk    num  comps
      rr_all     round-robin 0        0        4    vol1, vol2, vol3, vol4
      bal_34     balance     0       64.000KB  2    vol3, vol4
      v1         as-given    0        0        1    vol1

    These policies allocate from the volumes as follows:


    Allocations are restricted to vol1.


    Balanced allocations between vol3 and vol4.


    Round-robin allocations from all four volumes.

  4. Assign the policies to various objects in the file system. The data policy must be specified before the metadata policy:

      # fsapadm assignfile -f inherit /mnt1/appdir bal_34 v1
      # fsapadm assignfs /mnt1 rr_all ''

    These assignments will cause allocations for any files below /mnt1/appdir to use bal_34 for data, and v1 for metadata. Allocations for other files in the file system will default to the file system-wide policies given in assignfs, with data allocations from rr_all, and metadata allocations using the default policy as indicated by the empty string (''). The default policy is as-given allocations from all metadata-eligible volumes.