Managing VIOS rules files

Virtual I/O Server (VIOS) rules management consists of two rules files. The default rules file contains the critical recommended device rules for VIOS best practice, and the current rules file captures the current VIOS system settings based on the default rules.

To deploy the recommended default device settings on a newly installed VIOS, run the rules –o deploy –d command and then restart the system. The default rules are contained in an XML profile, and you cannot modify the default rules.

You can customize rules on VIOS, by using the current rules. The initial current rules are captured from the system by using default rules as a template and then saving them in an XML profile. You can modify the current rules or add new rules. The new rules must be supported on the VIOS level. You can apply the changed current rules to VIOS, for currently discovered and newly discovered device types and instances.

You can use the rules command to manage VIOS rules files.

Viewing Virtual I/O Server rules

You can use the –o list option, with the rules command to view and list the contents of the default rules file, the current rules file, and the current system settings on the Virtual I/O Server. You can view the rules contained by a user-specified rules file by using the –f flag. The first column of the output describes a particular device in the class/subclass/type format. For example, hdisk4 is described as disk/fcp/osdisk, where disk is the class, hdisk4 might have the attribute reserve_policy with the value single_path.

Examples
  1. To list the rules that are currently applied to the system, type the following command:
    $ rules -o list -s 
  2. To list the rules in the current rules file, type the following command:
    $ rules -o list

Deploying Virtual I/O Server rules

You can use the rules command with the –o deploy option to deploy rules. The rules command accepts the –d flag to deploy the default rules. Otherwise, the command uses the current rules on the VIOS. This command deploys the device type and then deploys the device instances by using the default or current rules. However, not all device instances on the system are deployed because of the VIOS specific configuration requirements. The new settings do not take effect until VIOS restarts.
Note: If your system does not have enough memory to accommodate the values for the attributes in the rules file, the rules are not deployed and a warning message is displayed.
To deploy the default rules on VIOS, type the following command:
$rules –o deploy -d

Capturing Virtual I/O Server rules

You can use the –o capture option, with the rules command to capture the current settings on VIOS. If the current rules file exists, it is used as the template to capture the latest system settings. If the VIOS has changed, this operation changes the current rules file.

To capture the current rules on VIOS, type the following command:
$rules –o capture

Importing Virtual I/O Server rules

You can use -o import option, with the rules command to import a user-specified rules file to VIOS. This operation might change the current rules. This operation merges the imported rules and the current rules. The user-specified rules precede the current rules during the merge operation. When a rule is not supported on the VIOS level, the import operation fails and displays a message to indicate that VIOS does not support a rule specified in the import file. You must remove the unsupported rule entries before attempting the import operation again. A warning is displayed if the changed value is lower than the current default value in AIX® Object Data Manager (ODM). A lower value might impact performance or cause an LPM operation failure. If the ioslevel rule in the user-specified rules file is lower than the current rules, or if the ioslevel rule does not exist, the import operation stops. You can use the -F flag to force the import operation to continue and to ignore the ioslevel rule incompatibility.

To import the user rules file user_rules.xml to the current rules file on VIOS, type the following command:
$rules –o import –f user_rules.xml

Adding Virtual I/O Server rules

You can use the -o add option, with the rules command to add a new rule entry to the VIOS current rules file or user-specified rules file, based on the class/subclass/type format or the device instance. If the rule that you are adding already exists on the VIOS, an error message is displayed to indicate that the rule already exists. The add operation might also fail if the VIOS level does not support a rule for the particular class/subclass/type, and if a template for the particular device does not exist. Currently, you can only add device rules. If the attribute value of the newly added rule is lower than the current Object Data Manager (ODM) default value, a warning message is displayed, but the operation is not stopped.

To add a new rule for device type cvdisk, type the following command:
$ rules -o add -t disk/vscsi/cvdisk -a queue_depth=8

Modifying Virtual I/O Server rules

You can use the -o modify option, with the rules command to modify a rule from the current rules file or from the user specified file, based on the device type or device instance. If the rule that you want to modify does not exist in the current rules file, a message is displayed, prompting you to add the rule instead of modifying it. If the attribute value of the modified rule is lower than the current Object Data Manager (ODM) default value, a warning message is displayed, but the operation is not stopped.

To modify the queue_depth value of device type cvdisk, type the following command:
$ rules -o modify -t disk/vscsi/cvdisk -a queue_depth=16

Deleting Virtual I/O Server rules

You can use the -o delete option along with the rules command to delete a rule from the current rules file, or from the user-specified file, based on the device type or device instance.
Note: You cannot delete the rules that are taken from the current rules file and defined in the default rules file. The current rules file is used as a default template for capturing the rules, listing the rules, and other operations. After a rule is removed from the current rules file, that rule cannot be accessed for any rules operations that use the current rules file as the template.
To delete the rule for the queue_depth value of device type cvdisk, type the following command:
$ rules -o delete -t disk/vscsi/cvdisk -a queue_depth

Identifying mismatched rules on the Virtual I/O Server

You can use the -o diff operation to find the mismatched list of devices and attributes between the current rules file and the current VIOS settings, or between the default rules file and current rules file, or between the current VIOS setting and the default rules file. You can also detect the mismatched list between a rules file by specifying the -f flag with the current rules file, default rules file, or current system settings. If you use the –n flag, a count of all the mismatched list of devices and attributes is displayed.

Examples
  1. To see the difference between the current rules file and rules that are currently applied on the system, type the following command:
    $ rules -o diff -s
  2. To see the difference between the current rules file and the default rules file, type the following command:
    $ rules -o diff -d



Last updated: Thu, October 15, 2020