The types.cf file describes standard resource types to the VCS engine; specifically, the data required to control a specific resource.
The types definition performs the following two important functions:
Defines the type of values that may be set for each attribute.
In the following DiskGroup example, the NumThreads and OnlineRetryLimit attributes are both classified as int, or integer. The DiskGroup, StartVolumes and StopVolumes attributes are defined as str, or strings.
Defines the parameters that are passed to the VCS engine through the ArgList attribute. The line static str ArgList[] = { xxx, yyy, zzz } defines the order in which parameters are passed to the agents for starting, stopping, and monitoring resources.
The following example illustrates a DiskGroup resource type definition for Linux:
type DiskGroup ( static keylist SupportedActions = { "license.vfd", "disk.vfd", "udid.vfd", "verifyplex.vfd", campusplex, volinuse, checkudid, numdisks, joindg, splitdg, getvxvminfo } static int NumThreads = 1 static int OnlineRetryLimit = 1 static str ArgList[] = { DiskGroup, StartVolumes, StopVolumes, MonitorOnly, MonitorReservation, PanicSystemOnDGLoss, tempUseFence, DiskGroupType, UmountVolumes, Reservation } str DiskGroup boolean StartVolumes = 1 boolean StopVolumes = 1 boolean MonitorReservation = 0 boolean PanicSystemOnDGLoss = 0 temp str tempUseFence = INVALID str DiskGroupType = private int UmountVolumes str Reservation = ClusterDefault )
For another example, review the following main.cf and types.cf files that represent an IP resource:
The high-availability address is configured on the interface, which is defined by the Device attribute.
The IP address is enclosed in double quotes because the string contains periods.
The VCS engine passes the identical arguments to the IP agent for online, offline, clean, and monitor. It is up to the agent to use the arguments that it requires. All resource names must be unique in a VCS cluster.
main.cf for Linux:
IP nfs_ip1 ( Device = eth0 Address = "192.168.1.201" NetMask = "255.255.252.0" )
types.cf for Linux:
type IP ( static keylist SupportedActions = { "device.vfd", "route.vfd" } static str ArgList[] = { Device, Address, NetMask, PrefixLen, Options, IPOptions, IPRouteOptions } str Device str Address str NetMask int PrefixLen = 1000 str Options str IPOptions str IPRouteOptions )