The <targetRef> element is an optional child of the <component> element. This element declares that the component is targetable. A targetable component is one that automatically creates a physical host or a virtual host that is associated with the component. This host is created when the component is installed. If used, this element can appear only one time, and it must appear immediately after the <varList> element. This element can be used by both simple and composite components. However, the <varList> element can only be used in components that are being installed as top-level components.
The <targetRef> element has one optional child element, <agent>, which indicates whether the associated host is a physical host or a virtual host. If the <agent> element is present, the host is a physical host. The <agent> element body defines the configuration of the remote agent. If the element is not present, the host is a virtual host, which is the default.
The <targetRef> element has the following attributes:
hostName – A required value, which is the name of the host to create when you install this component. The name must be unique at the time of installation and must be a valid host name. This value can include component-scoped substitution variable references.
typeName – An optional value of type systemName, which is the name of the host type to use for the associated host. The specified host type must exist at the time that the component is saved. If this host type is defined by a plug-in, the name should include pluginName as a prefix, such as pluginName#typeName.
If this attribute is omitted, the value is system#crhost.
The <agent> element is a child of the <targetRef> element. This element indicates that the associated host is a physical host. This element is optional and can be used only one time.
If this element is omitted, the associated host is created as a virtual host. If this element is used, the associated host is created as a physical host, and the <agent> element specifies the configuration of the associated remote agent.
This element is inherited by derived components. A derived component can declare a local <targetRef> element only if the base component did not. This means that a derived component cannot override an inherited <targetRef> element.
The <agent> element has the following attributes. These attributes can reference component-scoped substitution variables.
connection – A required value that specifies the connection type that is used to connect to the remote agent. This attribute can have one of the following values:
RAW
SSL
SSH
ipAddr – A required value that is the IP address of the physical host. This value can be either a server name or an IP address. Server names must be resolvable to an IP address by the master server.
port – An optional value that is the port on which the remote agent is listening. If connection is RAW or SSL, the default value of port is 1131. If connection is SSH, this attribute is ignored.
params – An optional value that is at least one parameter that is used to connect to the remote agent.