Skip to main content

Predefined macros

Macros give you the ability to add variable data (configuration settings) to an unattend file or post-installation script. Lenovo XClarity Administrator provides a set of predefined configuration settings that you can use.

To inject predefined macros to an unattend or post-installation script file, prefix the macro with "predefined" for predefined macros, separate nested objects using a period, and then surround the macro name with a hash symbol (#), for example #predefined.globalSettings.ipAssignment#.

The value for each predefined macro varies based on the XClarity Administrator instance. For example, the Deploy OS Images > Global Settings > IP Assignment field allows you to specify the IP mode. After the user-inputted value is gathered during OS deployment, the value is represented in the predefined configurations settings by the predefined macro #predefined.globalSettings.ipAssignment# and in the instance of the configuration-settings JSON file under the ipAssignment Object name.

The following table lists the predefine macros (configuration settings) that are available in XClarity Administrator.

Macro nameTypeDescription
predefinedObjectInformation about all predefined OS-deployment settings
 globalSettingsObjectInformation about global OS-deployment settings
  credentialsArray of objectsInformation about user credentials
   nameString 
   typeStringOperating system type. This can be one of the following values.
  • ESXi
  • LINUX
  • WINDOWS
  ipAssignmentStringHost network setting option for operating system deployment. This can be one of the following values.
  • dhcpv4
  • staticv4
  • staticv6
  isVLANModeStringIndicates whether VLAN mode is used. This can be one of the following values.
  • true. VLAN mode is used.
  • false. VLAN mode is not used.
 hostPlatformsObjectDeployment settings from the host platforms
  licenseKeyStringLicense key to be used for Microsoft Windows or VMware ESXi. If you do not have a license key, you can set this field to null.
  networkSettingsArrayInformation about network settings
   dns1StringPreferred DNS server for the host server to be used after the operating system is deployed
   dns2StringAlternative DNS server for the host server to be used after the operating system is deployed
   gatewayStringGateway of the host server to be used after the operating system is deployed. This is used when the network setting is set to static in the Global OS deployment settings.
Tip
To determine the IP mode, use GET /osdeployment/globalSettings.
   hostnameStringHostname for the host server. If a hostname is not specified, a default hostname is assigned.
   ipAddressStringIP address of the host server to be used after the operating system is deployed. This is used when the network setting is set to static in the Global OS deployment settings.
   mtuLongMaximum transmission unit for the host to be used after the operating system is deployed.
   prefixLengthStringPrefix length of the host IP address to be used after the operating system is deployed. This is used when the network setting is set to static IPv6 in the Global OS deployment settings.
   selectedMACStringMAC address of the host server to which the IP address is to be bound.

The MAC address is set to AUTO by default. This setting automatically detects the Ethernet ports that can be configured and used for deployment. The first MAC address (port) that is detected is used by default. If connectivity is detected on a different MAC address, the XClarity Administrator host is automatically restarted to use the newly detected MAC address for deployment, and selectedMAC is set to the newly detected MAC address.

VLAN mode is supported only for servers that have MAC addresses in their inventory. If AUTO is the only the MAC address that is available for a server, then VLANs cannot be used to deploy operating systems to that server.

Tip
To obtain the MAC address, use the macaddress response property in GET /hostPlatforms.
   subnetCIDRNumberIntegerSubnet mask of the host server to be used after the operating system is deployed, in Classless Inter-Domain Routing (CIDR) format. This is used when the network setting is set to static in the Global OS deployment settings.

The CIDR number is typically preceded by a slash “/” and follows the IP address. For example, an IP address of 131.10.55.70 with a subnet mask of 255.0.0.0 (which has 8 network bits) would be represented as 131.10.55.70 /8. For more information, see the CIDR Notation Tutorial webpage.

Tip
To determine the IP mode, use GET /osdeployment/globalSettings.
   subnetMaskStringSubnet mask of the host server to be used after the operating system is deployed, in dotted decimal notation (for example, 255.0.0.0). This is used when the network setting is set to static in the Global OS deployment settings.
Tip
To determine the IP mode, use .
   vlanIdStringVLAN ID for operating-system VLAN tagging.

This parameter is valid only if in VLAN mode is enabled. To determine if VLAN mode is enabled use GET /osdeployment/globalSettings).

Important
Only specify a VLAN ID when a VLAN tag is required to function on the network. Using VLAN tags can affect the network routability between the host operating system and the XClarity Administrator.
  selectedImageStringProfile ID of the operating-system image to be deployed.
Tip
To obtain the operating-system image profile IDs, use the availableImages response property in GET /hostPlatforms.
  storageSettingsArrayPreferred storage location on which you want to deploy operating-system images
   targetDeviceStringTarget device. This can be one of the following values.
  • localdisk. Local disk drive. The first enumerated local disk drive in the managed server is used.
  • M.2drive. M.2 drive. The first enumerated M.2 drive in the managed server is used.
  • usbdisk. Embedded USB Hypervisor. This location is applicable only when a VMware ESXi image is being deployed to managed servers. If two hypervisor keys are installed on the managed server, the VMware installer selects the first enumerated key for deployment.
  • lunpluswwn=LUN@WWN. FC SAN storage (for example, lunpluswwn=2@50:05:07:68:05:0c:09:bb).
  • lunplusiqn=LUN@IQN. iSCSI SAN Storage (for example, lunplusiqn=0@iqn.1990-01.com.lenovo:tgt1). Specifying the IQN is optional if only one iSCSI target is configured If the IQN is not specified, the first detected iSCSI target is selected for OSDN. If specified, and exact match is made.
Note
For ThinkServer servers, this value is always localdisk.
  unattendFileIdStringID of the unattend file to be used with this deployment
  uuidStringUUID of the host server to which the operating system is to be deployed
 imageSettingsObjectInformation about each OS image and image profile
  nameStringOperating-system image name
  profileStringImage profile name
 otherSettingsObjectAdditional settings that are related to the currently running OS deployment jobs
  deployDataAndSoftwareLocationStringPath to the extracted software payload, custom files, and deployment data (such as certificates and logs)
  installRepoUrlString(SLES 15 and later only) URL for the imported package image
You can use this predefined macro in the custom unattend for the media_url in the add-on section, for example:
<add-on>
<add_on_products config:type="list">
<listentry>
<media_url>#predefined.otherSettings.installRepoUrl#
</media_url>
<product>sle-module-basesystem</product>
<product_dir>/Module-Basesystem</product_dir>
</listentry>
</add_on_products>
</add-on>
  lxcaIpStringIP address of the XClarity Administrator instance
  lxcaReleaseStringXClarity Administrator release (for example. 2.0.0)
  jobIdStringID of the currently running OS deployment job
  ntpServerStringNTP server that is associated with XClarity Administrator
  statusSettingsObjectOS deployment status settings
   urlStatusStringHTTPS URL (including the port) that XClarity Administrator uses for reporting status
   certLocationStringFolder containing the certificates that are needed to access the urlStatus web service from the host OS on first boot
   sdkLocationStringLocation of XClarity Administrator provided helper scripts and interfaces for access to the XClarity Administrator
  timezoneStringTime zone that is set for XClarity Administrator (for example, America/New_York)
 unattendSettingsObjectSettings that are used to populate the unattend file. These values are specific to the version of XClarity Administrator
  networkConfigString(ESXi and RHEL only) XClarity Administrator predefined content for use at unattend install time. This configures the network settings for the operating system
  preinstallConfigStringXClarity Administrator predefined content for use at pre-installation unattend time. This includes pre-installation status.
  • For ESXi and RHEL, this uses the %pre pre-installation scripts hook.

  • For SLES, this uses the <scripts> pre-installation scripts hook.

Attention
It is strongly recommended that you include this macro in the custom unattend file. You can place the macro in the unattend file anywhere after line 1 (after the <xml> tag).
  postinstallConfigStringXClarity Administrator predefined content for use after the server is configured and booted for the first time. This includes post-installation status.
  • For ESXi and RHEL, this uses the %post post- installation scripts hook

  • For SLES, this uses the <scripts> post-installation scripts hook.

  • For Windows ,this uses the “specialize settings” section.

Attention
It is strongly recommended that this macro be included in the custom unattend file. You can place the macro in the unattend file anywhere after line 1 (after the <xml> tag).
  reportWorkloadNotCompleteStringWhen this macro is present, the postinstallConfig macro does not report OS Installation Completed (17) status. The custom profile must report complete.
  storageConfigString(ESXi and RHEL only) XClarity Administrator predefined content for use at unattend install time. This configures the storage settings for the operating system.