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 name Type Description
predefined Object Information about all predefined OS-deployment settings
  globalSettings Object Information about global OS-deployment settings
    credentials Array of objects Information about user credentials
      name String  
      type String Operating system type. This can be one of the following values.
  • ESXi
  • LINUX
  • RHEL/ESXi (This value will be deprecated in a future release. Use "ESXi" or "LINUX" instead.)
  • WINDOWS
    ipAssignment String Host network setting option for operating system deployment. This can be one of the following values.
  • dhcpv4
  • staticv4
  • staticv6
    isVLANMode String Indicates whether VLAN mode is used. This can be one of the following values.
  • true. VLAN mode is used.
  • false. VLAN mode is not used.
  hostPlatforms Object Deployment settings from the host platforms
    licenseKey String License 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.
    networkSettings Array Information about network settings
      dns1 String Preferred DNS server for the host server to be used after the operating system is deployed
      dns2 String Alternative DNS server for the host server to be used after the operating system is deployed
      gateway String Gateway 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.
      hostname String Hostname for the host server. If a hostname is not specified, a default hostname is assigned.
      ipAddress String IP 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.
      mtu Long Maximum transmission unit for the host to be used after the operating system is deployed.
      prefixLength String Prefix 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.
      selectedMAC String MAC 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.
      subnetMask String Subnet mask 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.
      vlanId String VLAN 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.
    selectedImage String Profile 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.
    storageSettings Array Preferred storage location on which you want to deploy operating-system images
      targetDevice String Target 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. SAN storage (for example, lunpluswwn=2@50:05:07:68:05:0c:09:bb)
Note: For ThinkServer servers, this value is always "localdisk."
    unattendFileId String ID of the unattend file to be used with this deployment
    uuid String UUID of the host server to which the operating system is to be deployed
  imageSettings Object Information about each OS image and image profile
    name String Operating-system image name
    profile String Image profile name
  otherSettings Object Additional settings that are related to the currently running OS deployment jobs
    deployDataAndSoftwareLocation String Path to the extracted software payload, custom files, and deployment data (such as certificates and logs)
    installRepoUrl String (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>
    lxcaIp String IP address of the XClarity Administrator instance
    lxcaRelease String XClarity Administrator release (for example. 2.0.0)
    jobId String ID of the currently running OS deployment job
    ntpServer String NTP server that is associated with XClarity Administrator
    statusSettings Object OS deployment status settings
      urlStatus String HTTPS URL (including the port) that XClarity Administrator uses for reporting status
      certLocation String Folder containing the certificates that are needed to access the urlStatus web service from the host OS on first boot
      sdkLocation String Location of XClarity Administrator provided helper scripts and interfaces for access to the XClarity Administrator
    timezone String Time zone that is set for XClarity Administrator (for example, America/New_York)
  unattendSettings Object Settings that are used to populate the unattend file. These values are specific to the version of XClarity Administrator
    networkConfig String (ESXi and RHEL only) XClarity Administrator predefined content for use at unattend install time. This configures the network settings for the operating system
    preinstallConfig String XClarity 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).
    postinstallConfig String XClarity 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).
    reportWorkloadNotComplete String When this macro is present, the postinstallConfig macro does not report OS Installation Completed (17) status. The custom profile must report complete.
    storageConfig String (ESXi and RHEL only) XClarity Administrator predefined content for use at unattend install time. This configures the storage settings for the operating system.