mkclass Command

Purpose

Create a Workload Management class.

Syntax

mkclass [ -a Attribute=Value  ...  ] [ -c | -m | -b | -v | -C | -B | -P | -T | -V | -L | -A KeyWord=Value ] [ -d Config_Dir ] [ -S SuperClass ] Name

Description

The mkclass command creates a superclass or a subclass identified by the Name parameter. The class must not already exist. The Name parameter can contain only uppercase and lowercase letters, numbers, and underscores. The name is in the format supername or subname (with the -S supername flag) or supername.subname. The supername and subname parameters are each limited to 16 characters in length. The names Default, System, and Shared are reserved. They refer to predefined classes. Any Attribute=Value or KeyWord=Value argument initializes the specified attribute or resource limit. See Attributes for more information. To set the process total limits (the limits that apply to each process of the class), use one or more of the options -C (totalCPU), -B (totalDiskIO), -A (totalConnectTime), or -v (totalVirtualMemoryLimit), with the keyword value of hardmax. To set the class total limits (the limits that apply to the whole class), use one or more of the options -P (totalProcesses), -T (totalThreads), -L (totalLogins), or -V (totalVirtualMemoryLimit) with the keyword value of hardmax. To reset any total limit, use - for Value. Process, class, or both total limits may be disabled when starting or updating the WLM (see wlmcntrl command).

Normally, mkclass adds the class and its attributes in the relevant WLM property files, and the modifications is applied to the in-core class definitions (active classes) only after an update of WLM using the wlmcntrl command.

If an empty string is passed as the configuration name (Config_dir) with the -d flag, the class is created only in the WLM in-core data structures, and no property file is updated, making the new class temporary (the change is lost if WLM is stopped and restarted or the system is rebooted).

Note: This command cannot apply to a set of time-based configurations (do not specify a set with the -d flag). If the current configuration is a set, the -d flag must be given to indicate which regular configuration the command should apply to.

Attributes

The following attributes can be changed:

Class properties:

Item Description
tier Specifies the tier value. The tier value for a class is the position of the class in the hierarchy of resource limitation desirability for all classes. A class with a lower tier value is more favored. The tier value ranges from 0 through 9 (the default is 0).
inheritance If the inheritance attribute is set to yes, the children of processes in this class remain in the class upon exec regardless of the automatic assignment rules in effect. If the inheritance attribute is set to no, the assignment rules apply normally. The default if not specified is no.
localshm Indicates whether memory segments that are accessed by processes in different classes remain local to the class they were initially assigned to or if they go to the Shared class. You can specify a value of Yes or No. If not specified, the default is No.
authuser Specifies the user name of the user who is allowed to assign processes to this class. The default when the attribute is not specified is root.
authgroup Specifies the group name of the group of users that is allowed to assign processes to this class. There is no default value.
rset Specifies the name of a resource set that the processes in the class have access to. By default, the class has access to all resources on the system.
vmenforce Specifies whether all processes or only the offending processes in the class need to be terminated when the class hits the maximum VM limit. You can specify the value of class or proc. The default value is proc.
delshm Specifies whether the shared segments will be deleted when the last process referencing them ends because virtual memory is exceeded. You can specify the value of yes or no. The default value is no.
adminuser Specifies the user name of the user who is allowed to administer the subclasses of this superclass. This attribute is valid only for superclasses. The default, when the attribute is not specified, is a null string, and in this case, only root users can administer the subclasses.
Note: If the adminuser or admingroup attribute is changed for a superclass that belongs to the running configuration (or to a configuration of the running set), a global WLM update should be performed to reflect these changes to the in-core configuration, elsewhere, updates that are restricted to superclass by such a user might fail due to lack of authority.
admingroup Specifies the group name of the group of users that is allowed to administer the subclasses of this superclass. This attribute is valid only for superclasses. The default value, when the attribute is not specified, is a null string, meaning that no group can administer the subclasses.
Note: If the adminuser or admingroup attribute is changed for a superclass that belongs to the running configuration (or to a configuration of the running set), a global WLM update should be performed to reflect these changes to the in-core configuration, elsewhere, updates that are restricted to superclass by such a user might fail due to lack of authority.

Class limits and shares for CPU, memory, or disk I/O resource:

Item Description
min Specifies the minimum percentage of the resource that must be made available when requested, expressed as a percentage of the total resource available in the system. Possible values range from 0 through 100 (the default is 0).
shares Specifies the maximum ratio of the resource that can be made available if there is contention. This parameter is expressed in shares of the total resource available in the system. The actual ratio of the resource is dynamically computed, proportionally to the shares of all active classes. If a class has no running process, its shares are excluded from the computation. The shares are arbitrary numbers ranging from 1 through 65535. If shares is specified as a hyphen (-), the class is always considered on target and its utilization for this resource is not regulated by WLM, but the minimum and maximum limits if any still apply. This is the default if the shares for a resource are not specified.
softmax Specifies the maximum percentage of the resource that can be made available, when there is contention. Possible values range from 1 through 100 (the default is 100). A class can exceed its soft maximum for a given resource if there is no contention on the resource.
hardmax Specifies the maximum percentage of the resource that can be made available, even if there is no contention. Possible values range from 1 through 100 (the default is 100). Specifying a value different from the default value of 100 for memory can result in some memory pages remaining unused, while some processes in the class use more.
max Specifies the maximum percentage of the resource that can be made available, even if there is no contention. Possible values range from 1 through 100 (the default is 100). Specifying a value different from the default value of 100 for memory can result in some memory pages remaining unused, while some processes in the class use more.
Note: The default values for a class can be read using the lsclass -D command and can be changed by manually editing the property files classes, shares, or limits to add a default stanza. For more information about these files, see the AIX® Version 7.1 Files Reference.

Class description:

Item Description
description The class description text can be composed of any ASCII character, except colons (:) and commas (,).
Note: This command is not supported when executed within a workload partition.

Flags

Item Description
-A hardmax=Value Sets the maximum amount of time a login session in the class can stay active. Value is specified as an integer, possibly appending the unit (s for seconds, m for minutes, h for hours, d for days, and w for weeks, default is seconds). As a user approaches this connection time limit, WLM will send a warning message to the session terminal. When the limit is reached, the user will be notified and the session leader will be sent the SIGTERM signal, and after a short grace period, the session will be terminated (SIGKILL).
-B hardmax=Value Sets the total amount of disk I/Os allowed for each process in the class. Value is specified as an integer, possibly appending the unit (KB for kilobytes, MB for megabytes, TB for terabytes, PB for petabytes, and EB for exabytes, default is kilobytes). After a process has used this amount of disk I/Os, the process will be sent the SIGTERM signal, and after a grace period, it will be killed (SIGKILL).
-C hardmax=Value Sets the total amount of CPU time allowed for each process in the class. Value is specified as an integer, possibly appending the unit (s for seconds, m for minutes, h for hours, d for days, and w for weeks, default is seconds). After a process has used this amount of time, the process will be sent the SIGTERM signal, and after a grace period, it will be killed (SIGKILL).
-d Config_Dir Use /etc/wlm/Config_Dir as an alternate directory for the properties files. When this flag is not used, mkclass uses the configuration files in the directory pointed to by /etc/wlm/current. If an empty string is passed as the configuration name (-d "") the new class is created only in the WLM in-core data structures and no configuration file is modified.
-L hardmax=Value Sets the total number of login sessions simultaneously available in the class. If a user tries to log onto the system and the login shell would end up in a class that has reached the total logins limit, the login operation will fail.
-P hardmax=Value Sets the maximum number of processes allowed in the class. If an operation would result in a new process entering the class when the class has this many processes in it, the operation will fail.
-S SuperClass Specifies the name of the superclass when creating a subclass. There are two ways of creating the subclass Sub of superclass Super:
  1. Specify the full name of the subclass as Super.Sub for Name and not use -S
  2. Specify the -S flag to give the superclass name and use the short name for the subclass:
    mkclass options -S Super  Sub
-T hardmax=Value Sets the maximum number of threads allowed in the class. If an operation would result in a new thread entering the class when the class has this many processes in it, the operation will fail. The total thread limit must be at least as large as the total process limit for a class. If a class has a total thread limit but no total process limit specified, the total process limit will be set to the total thread limit.
-v hardmax=Value Specifies the virtual memory limit allowed per process in the specified class. The maximum amount of virtual memory allowed per process is (2^31)-1 for 32-bit kernels and (2^63)-1 for 64-bit kernels.
-V hardmax=Value Specifies the virtual memory allowed for the specified class. The maximum amount of virtual memory allowed per process is (2^31)-1 for 32-bit kernels and (2^63)-1 for 64-bit kernels.

Security

Access control: Only the root user can create a superclass. Only root or authorized users whose user ID or group ID matches the user name or group name specified in the attributes adminuser and admingroup of a superclass can create a subclass of this superclass.

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Files

Item Description
classes Contains the names and definitions of the classes.
limits Contains the resource limits enforced each class.
shares Contains the resource shares attributed to each class.