File placement policy grammar

VxFS allocates and relocates files within a multi-volume file system based on properties in the file system metadata that pertains to the files. Placement decisions may be based on file name, directory of residence, time of last access, access frequency, file size, and ownership. An individual file system's criteria for allocating and relocating files are expressed in the file system's file placement policy.

A VxFS file placement policy defines the desired placement of sets of files on the volumes of a VxFS multi-volume file system. A file placement policy specifies the placement classes of volumes on which files should be created, and where and under what conditions the files should be relocated to volumes in alternate placement classes or deleted. You can create file placement policy documents, which are XML text files, using either an XML or text editor, or a VxFS graphical interface wizard.

The following output shows the overall structure of a placement policy:

<?xml version="1.0"?>
<!DOCTYPE PLACEMENT_POLICY [
<!-- The placement policy document definition file -->

<!-- Specification for PLACEMENT_POLICY element.
     It can contain the following
  1. 0 or 1 COMMENT element
  2. 1 or more RULE elements
  -->
<!ELEMENT PLACEMENT_POLICY (COMMENT?, RULE+)>
<!-- The attributes of PLACEMENT_POLICY element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST PLACEMENT_POLICY
  Name CDATA #REQUIRED
  Version (5.0) #REQUIRED
>


<!-- Specification for COMMENT element -->
<!ELEMENT COMMENT (#PCDATA)>


<!-- Specification for RULE element.
     It can contain the following
  1. 0 or 1 COMMENT element
  2. 1 or more SELECT elements
  3. 0 or 1 CREATE element

     The elements must appear in the above order.

  4. 0 or more DELETE elements
  5. 0 or more RELOCATE elements

     DELETE elements, if any, are recommeded to preceed RELOCATE
     elements, so that if a file is meant for deletion, will not
     unnecessarily be subject relocation. The reason being,
     if any of the DELETE elements triggers an action, subsequent
     elements (DELETE and/or RELOCATE elements, if any) will not be
     processed.
  -->
<!ELEMENT RULE (COMMENT?, SELECT+, CREATE?, DELETE*, RELOCATE*)>
<!-- The attributes of RULE element -->
  <!-- The possible and accepted values for Flags are
    1. data
    2. checkpoint

  The "data" is supported in 5.0 release. The "data" centric
  RULEs deal with data of the files.
  However "checkpoint" that is now introduced will allows
  RULE specification to place data of the checkpoints
  on a given set of placement classes. But in "checkpoint"
  RULE only CREATE is supported, and DELETE and RELOCATE
  are not supported, i.e., it is possible to direct the
  data placement of the checkpoints that would be created
  after such a placement policy becomes active but it is
  not possible to relocate that of the already created
  checkpoints.
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST RULE
  Name CDATA #REQUIRED
  Flags (data) #REQUIRED
>


<!-- Specification for SELECT element. This describes selection criteria.
     It can contain the following
     1. 0 or 1 COMMENT elements
     2. 0 or more DIRECTORY elements
     3. 0 or more PATTERN elements
     4. 0 or more USER elements
     5. 0 or more GROUP elements
     6. 0 or more UID elements
     7. 0 or more GID elements
     8. 0 or more TAG elements

     The elements can appear in any order.
  -->
<!ELEMENT SELECT (COMMENT?, DIRECTORY*, PATTERN*, USER*, GROUP*, UID*,
  GID*, TAG*)>
<!-- The attributes of SELECT element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST SELECT
  Name CDATA #IMPLIED
>


<!-- Specification for DIRECTORY element
  The DIRECTORY element takes a path relative to the
  mount point. So if the intention is to sweep from
  /db/finance/data and /db is the mount point,
  DIRECTORY element should contain finance/data

  Only one value can be specified per element.
  -->
<!ELEMENT DIRECTORY (#PCDATA)>
<!-- The attributes of DIRECTORY element -->
  <!-- The possible and accepted values for Flags are
    1. recursive
    2. nonrecursive

    If a given directory appears in more than one RULE,
    all such DIRECTORY elements must all be recursive or
    nonrecursive but can not be a combination. If no DIRECTORY
    element is specified, all the files under the mount point
    will be selected. 
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST DIRECTORY
  Flags (recursive|nonrecursive) #REQUIRED
>


<!-- Specification for PATTERN element
  The PATTERN can be a full name of a file, i.e., can not contain
  "/" characters. Or it can have a '*' character. The first '*'
  character will be considered as wild character and any other
  character, including a second '*' are treated as literals.

  Only one value can be specified per element.

  -->
<!ELEMENT PATTERN (#PCDATA)>
<!-- The attributes of PATTERN element -->
  <!-- The possible and accepted values for Flags are
    1. recursive

    This is an optional attribute. It is meaningful only
    if the PATTERN is a dirctory. Default is nonrecursive,
    which will be case for file PATTERNs. If this attribute
    is specified, the enclosing SELECTion criteria will
    select all files in any component directory (for example
    dir1, in /mnt/dir0/dir1 if PATTERN is dir1) that is
    anywhere (below the DIRECTORY,
      - if it is specified and has 'recursive flag or
      - anywhere in file system, if DIRECTORY is not
        specified),
    provided the component directory  matches the PATTERN
    (here 'dir1' in the example). If PATTERN has wild
    character '*' in it, wild char based matching is performed.
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST PATTERN
  Flags (recursive | nonrecursive) "nonrecursive" 
>


<!-- Specification for USER element
  The USER is a name string of the unix domain user

  Only one value can be specified per element.
 -->
<!ELEMENT USER (#PCDATA)>


<!-- Specification for GROUP element
  The GROUP is a name string of the unix domain group

  Only one value can be specified per element.
  -->
<!ELEMENT GROUP (#PCDATA)>


<!-- Specification for UID element
  The UID is a numeric id of the unix domain user

  Only one value can be specified per element.
 -->
<!ELEMENT UID (#PCDATA)>


<!-- Specification for GID element
  The GID is a numeric id of the unix domain group

  Only one value can be specified per element.
 -->
<!ELEMENT GID (#PCDATA)>


<!-- Specification for TAG element
  The TAG is a file tag created by file tagging command

  Only one value can be specified per element.
 -->
<!ELEMENT TAG (#PCDATA)>


<!-- Specification for CREATE element. This describes creation criteria.
     It can contain the following
     1. 0 or 1 COMMENT element
     2. 1 ON element
  -->
<!ELEMENT CREATE (COMMENT?, ON)>
<!-- The attributes of CREATE element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST CREATE
  Name CDATA #IMPLIED
  Flags CDATA #IMPLIED
>


<!-- Specification for ON element. This describes location criteria.
     It can contain the following
     1. 0 or more DESTINATION elements

     Though zero DESTINATION elements is defined in grammar, current
     implementation requires at least on DESTINATION.
  -->
<!ELEMENT ON (DESTINATION*)>
<!-- The attributes of ON element -->
  <!-- The possible and accepted values for Flags is
    1. any

    If this attribute is set, there may or may not be any CLASS
    elements in the DESTINATION elements under the ON element.
    If any of the DESTINATION elements have CLASS element, such
    CLASSes in the file system would be used first before other
    placement class storage is used.
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST ON
  Name CDATA #IMPLIED
  Flags (any) #IMPLIED
>


<!-- Specification for DESTINATION element. This describes target
  location.
     It can contain the following
     1. 0 or 1 CLASS element
     2. 0 or 1 PERCENT element
     3. 0 or 1 BALANCE_SIZE element

     The order of CLASS elements is significant.
     Earlier CLASSes would be used before the latter ones.
  -->
<!ELEMENT DESTINATION (CLASS?, PERCENT?, BALANCE_SIZE?)>
<!-- The attributes of DESTINATION element -->
  <!-- The possible and accepted values for Flags
    (THIS IS NOT IMPLEMENTED)

    1. disallow

    If this 'disallow' is set, there must not be any PERCENT or
    BALANCE_SIZE elements in such DESTINATION element but there
    must be a CLASS element. There must not be any RELOCATE and
    DELETE statements in the enclosing RULE element either.
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST DESTINATION
  Name CDATA #IMPLIED
  Flags (disallow) #IMPLIED
>


<!-- Specification for CLASS element
  The file system resides on a multi-component volume set.
  Each volume in the volume set will be in what is called a
  placement class. The placement classes are implemented as tags
  on the volumes. These tags are organized into a hierarchy prefix.
  The placement policy uses the vxfs.placement_class. prefix.
  The CLASS element specifies the placement class of the
  underlying storage, without the prefix. For example, if a
  volume has a placement class of vxfs.placment_class.gold 
  then gold would be the value of CLASS element.
 -->
<!ELEMENT CLASS (#PCDATA)>


<!-- Specification for PERCENT element
  (THIS IS NOT IMPLEMENTED)

  If the PERCENT element is in DESTINATION element, it determines
  how much of its CLASS can be filled up with the files selected
  by a given RULE. 

  If the PERCENT element is in SOURCE element, it determines
  how much of its CLASS can be emptied when the files are relocated
  our deleted from it.
 -->
<!ELEMENT PERCENT (#PCDATA)>


<!-- Specification for BALANCE_SIZE element
  Multiple volumes may have the same placement class and there can
  be multiple DESTINATIONs (hence CLASSes) in a given ON (and TO)
  element. If a BALANCE_SIZE is specified for a given CLASS,
  the usage of volumes of that given placement class will be used
  evenly by allocating BALANCE_SIZE amount of space for each
  volume for each allocation.
 -->
<!ELEMENT BALANCE_SIZE (#PCDATA)>
<!-- The attributes of BALANCE_SIZE element -->
  <!-- The possible and accepted values for Units are
    1. bytes
    2. KB
    3. MB
    4. GB
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST BALANCE_SIZE
  Units (bytes|KB|MB|GB) #REQUIRED
>

<!-- Specification for DELETE element. This describes deletion criteria.
     It can contain the following
     1. 0 or 1 COMMENT element
     2. 0 or 1 FROM element
     3. 0 or 1 WHEN element
  -->
<!ELEMENT DELETE (COMMENT?, FROM?, WHEN?)>
<!-- The attributes of DELETE element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST DELETE
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>

<!-- Specification for RELOCATE element. This describes relocation
  criteria.
     It can contain the following
     1. 0 or 1 COMMENT element
     2. 0 or 1 FROM element (0 in the case of "ckpt" rule)
     3. 1 TO element
     4. 0 or 1 WHEN element (0 in the case of "ckpt" rule)
  -->
<!ELEMENT RELOCATE (COMMENT?, FROM?, TO, WHEN?)>
<!-- The attributes of RELOCATE element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST RELOCATE
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>


<!-- Specification for FROM element. This describes source criteria.
     It can contain the following
     1. 1 or more SOURCE elements
  -->
<!ELEMENT FROM (SOURCE+)>
<!-- The attributes of FROM element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST FROM
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>


<!-- Specification for SOURCE element. This describes source location.
     It can contain the following
     1. 1 CLASS element
     2. 0 or 1 PERCENT element
  -->
<!ELEMENT SOURCE (CLASS, PERCENT?)>
<!-- The attributes of SOURCE element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST SOURCE
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>


<!-- Specification for TO element. This describes destination criteria.
     It can contain the following
     1. 1 or more DESTINATION elements
  -->
<!ELEMENT TO (DESTINATION+)>
<!-- The attributes of TO element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST TO
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>


<!-- Specification for WHEN element. This describes relocation specifiers.
     It can contain the following
     1.  0 or 1 SIZE element
     2.  0 or 1 ACCAGE element
     3.  0 or 1 MODAGE element
     4.  0 or 1 IOTEMP element
     5.  0 or 1 ACCESSTEMP element
  -->
<!ELEMENT WHEN (SIZE?, ACCAGE?, MODAGE?, IOTEMP?, ACCESSTEMP?)>
<!-- The attributes of WHEN element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST WHEN
  Name CDATA #IMPLIED
  Flags (none) #IMPLIED
>


<!-- Specification for SIZE element
     It can contain the following
     1.  0 or 1 MIN element
     2.  0 or 1 MAX element

  -->
<!ELEMENT SIZE (MIN?, MAX?)>
<!-- The attributes of SIZE element -->
  <!-- The possible and accepted values for Prefer are
    (THIS IS NOT IMPLEMENTED)

    1. low
    2. high

       The possible and accepted values for Units are
    1. bytes
    2. KB
    3. MB
    4. GB
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST SIZE
  Prefer (low|high) #IMPLIED
  Units (bytes|KB|MB|GB) #REQUIRED
>


<!-- Specification for ACCAGE element
     It can contain the following
     1.  0 or 1 MIN element
     2.  0 or 1 MAX element

  -->
<!ELEMENT ACCAGE (MIN?, MAX?)>
<!-- The attributes of ACCAGE element -->
  <!-- The possible and accepted values for Prefer are
    (THIS IS NOT IMPLEMENTED)

    1. low
    2. high

       The possible and accepted values for Units are
    1. hours
    2. days
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST ACCAGE
  Prefer (low|high) #IMPLIED
  Units (hours|days) #REQUIRED
>


<!-- Specification for MODAGE element
     It can contain the following
     1.  0 or 1 MIN element
     2.  0 or 1 MAX element

  -->
<!ELEMENT MODAGE (MIN?, MAX?)>
<!-- The attributes of MODAGE element -->
  <!-- The possible and accepted values for Prefer are
    (THIS IS NOT IMPLEMENTED)

    1. low
    2. high
   
       The possible and accepted values for Units are
    1. hours
    2. days
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST MODAGE
  Prefer (low|high) #IMPLIED
  Units (hours|days) #REQUIRED
>


<!-- Specification for IOTEMP element
     The value of IOTEMP represents bytes read (nrbytes),
     bytes written (nwbytes) or bytes transferred, i.e.,
     read and written (nrwbytes), divided by the size of the
     file, over a specified PERIOD (in days).

     It can contain the following
     1. 0 or 1 MIN element
     2. 0 or 1 MAX element
     3. 1 PERIOD element
  -->
<!ELEMENT IOTEMP (MIN?, MAX?, PERIOD)>
<!-- The attributes of IOTEMP element -->
  <!-- The possible and accepted values for Prefer are
    (THIS IS NOT IMPLEMENTED)

    1. low
    2. high
   -->
  <!-- The possible and accepted values for Type are
    1. nrbytes
          2. nwbytes
          3. nrwbytes
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST IOTEMP
  Prefer (low|high) #IMPLIED
  Type (nrbytes|nwbytes|nrwbytes) #REQUIRED
>


<!-- Specification for ACCESSTEMP element
     The value of ACCESSTEMP represents times read (nrbytes),
     times written (nwbytes) or times access i.e.,
     read and written (nrws) over a specified PERIOD (in days).

     It can contain the following
     1. 0 or 1 MIN element
     2. 0 or 1 MAX element
     3. 1 PERIOD element
  -->
<!ELEMENT ACCESSTEMP (MIN?, MAX?, PERIOD)>
<!-- The attributes of ACCESSTEMP element -->
  <!-- The possible and accepted values for Prefer are
    (THIS IS NOT IMPLEMENTED)

    1. low
    2. high
   -->
  <!-- The possible and accepted values for Type are
    1. nreads
          2. nwrites
          3. nrws
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST ACCESSTEMP
  Prefer (low|high) #IMPLIED
  Type (nreads|nwrites|nrws) #REQUIRED
>


<!-- Specification for MIN element -->
<!ELEMENT MIN (#PCDATA)>
<!-- The attributes of MIN element -->
  <!-- The possible and accepted values for Flags are
    1. gt for greater than
    2. eq for equal to
    3. gteq for greater than or equal to
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST MIN
  Flags (gt|eq|gteq) #REQUIRED
>


<!-- Specification for MAX element -->
<!ELEMENT MAX (#PCDATA)>
<!-- The attributes of MAX element -->
  <!-- The possible and accepted values for Flags are
    1. lt for less than
    2. lteq for less than or equal to
   -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST MAX
  Flags (lt|lteq) #REQUIRED
>


<!-- Specification for PERIOD element -->
<!ELEMENT PERIOD (#PCDATA)>
<!-- The attributes of PERIOD element -->
<!-- XML requires all attributes must be enclosed in double quotes -->
<!ATTLIST PERIOD
  Units (days) #REQUIRED
>
]>