Using persistent attributes

You can define volume allocation attributes so they can be reused in subsequent operations. These attributes are called persistent attributes, and they are stored in a set of hidden volume tags. The persist attribute determines whether an attribute persists, and how the current command might use or modify preexisting persisted attributes. You can specify persistence rules in defaults files, in rules, or on the command line. For more information, see the vxassist manual page.

To illustrate how persistent attributes work, we'll use the following vxsf_rules file. It contains a rule, rule1, which defines the mediatype attribute. This rule also uses the persist attribute to make the mediatype attribute persistent.

# cat /etc/default/vxsf_rules
volume rule rule1 { mediatype:ssd persist=extended }

The following command confirms that LUNs ibm_ds8x000_0266 and ibm_ds8x000_0268 are solid-state disk (SSD) devices.

# vxdisk listtag
DEVICE               NAME                VALUE
ibm_ds8x000_0266     vxmediatype         ssd
ibm_ds8x000_0268     vxmediatype         ssd

The following command creates a volume, vol1, in the disk group dg3. rule1 is specified on the command line, so those attributes are also applied to vol1.

# vxassist -g dg3 make vol1 100m rule=rule1

The following command shows that the volume vol1 is created off the SSD device ibm_ds8x000_0266 as specified in rule1.

# vxprint -g dg3
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg3          dg3          -        -        -        -        -       -

dm ibm_ds8x000_0266 ibm_ds8x000_0266 - 2027264 -        -        -       -
dm ibm_ds8x000_0267 ibm_ds8x000_0267 - 2027264 -        -        -       -
dm ibm_ds8x000_0268 ibm_ds8x000_0268 - 2027264 -        -        -       -

v  vol1         fsgen        ENABLED  204800   -        ACTIVE   -       -
pl vol1-01      vol1         ENABLED  204800   -        ACTIVE   -       -
sd ibm_ds8x000_0266-01 vol1-01 ENABLED 204800  0        -        -       -

The following command displays the attributes that are defined in rule1.

# vxassist -g dg3 help showattrs rule=rule1
alloc=mediatype:ssd
persist=extended

If no persistent attributes are defined, the following command grows vol1 on hard disk drive (HDD) devices. However, at the beginning of this section, mediatype:ssd was defined as a persistent attribute. Therefore, the following command honors this original intent and grows the volume on SSD devices.

# vxassist -g dg3 growby vol1 1g

The following vxprint command confirms that the volume was grown on SSD devices.

# vxprint -g dg3
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg dg3          dg3          -        -        -        -        -       -

dm ibm_ds8x000_0266 ibm_ds8x000_0266 - 2027264 -        -        -       -
dm ibm_ds8x000_0267 ibm_ds8x000_0267 - 2027264 -        -        -       -
dm ibm_ds8x000_0268 ibm_ds8x000_0268 - 2027264 -        -        -       -

v  vol1         fsgen        ENABLED  2301952  -        ACTIVE   -       -
pl vol1-01      vol1         ENABLED  2301952  -        ACTIVE   -       -
sd ibm_ds8x000_0266-01 vol1-01 ENABLED 2027264 0        -        -       -
sd ibm_ds8x000_0268-01 vol1-01 ENABLED 274688  2027264  -        -       -