Importing custom installation scripts

You can import installation scripts into the OS images repository. These files can then be used to customize Linux and Windows images.

About this task

Currently, only post-installation scripts are supported.

The following table lists the file types for installation scripts that Lenovo XClarity Administrator supports for each operating system. Note that certain operation system versions do not support all of the file types that XClarity Administrator supports (for example, some RHEL versions might not include Perl in the minimal profile and, therefore, Perl scripts will not run). Ensure that you use the correct file type for the operating system versions that you want to deploy.
Operating system Supported File Types More information
Microsoft® Windows® Server Command file (.cmd), PowerShell (.ps1) The default custom data and files path is C:\lxca.

For more information about installation scripts, see the Add a custom script to Windows Setup webpage

Microsoft Windows Hyper-V Server Not supported  
Red Hat® Enterprise Linux (RHEL) Server Bash (.sh), Perl (.pm or .pl), Python (.py) The default custom data and files path is /home/lxca.

For more information about installation scripts, see the RHEL: Post-installation Script webpage.

SUSE® Linux Enterprise Server (SLES) Bash (.sh), Perl (.pm or .pl), Python (.py) The default custom data and files path is /home/lxca.

For more information about installation scripts, see the SUSE: Custom user script webpage

VMware vSphere® Hypervisor (ESXi) with Lenovo Customization Bash (.sh), Python (.py) The default custom data and files path is /home/lxca.

For more information about installation scripts, see the VMware: Installation and Upgrade Scripts webpage

Note: The OS images repository can store an unlimited number of predefined and custom files, if space is available to store the files.

After the data is gathered during OS deployment, XClarity Administrator creates an instance of the configuration settings file (which includes the custom settings in the selected file and a subset of predefined settings) on the host system that can be used by the post installation script.

You can inject predefined and custom macros (configuration settings) in the post-installation script using the unique name of the object. Predefined values are dynamic based on the XClarity Administrator instances. Custom macros are dynamic based on user input that is specified during OS deployment.

Note:
  • Surround the macro name with a hash symbol (#).

  • For nested objects, separate each object name using a period (for example, #server_settings.server0.locale#).

  • For custom macros, do not include the top-most object name. For predefined macros, prefix the macro name with "predefined."

  • When an object is created from a template, the name is appended with a unique number, starting with 0 (for example, server0 and server1).

  • You can see the name for each macro from the Deploy OS Images dialog on the Custom Settings tabs by hovering over the Help icon (Help icon) next to each custom setting.

  • For a list of predefined macros, see Predefined macros. For information about custom configuration settings and macros, see Custom macros.

The recommended predefined macros in the unattend file report final operating-system deployment status and report status when downloading and running post-installation scripts. You can modify the post-installation script to include custom status reporting, depending on the target operating system. For more information, see Adding custom status reporting to installation scripts.

Procedure

To import installation scripts into the OS-images repository, complete the following steps.

  1. From the XClarity Administrator menu bar, click Provisioning > Manage OS Images to display the Deploy Operating System: Manage OS Images page.
  2. Click the Installation Scripts tab.

    Illustrates the Manage OS Images page with a list of installation scripts that have been imported to the OS images repository.
  3. Click the Import File icon (Import icon). The Import Installation Script dialog is displayed.
  4. Click the Local Import tab to upload files from the local system, or click the Remote Import tab to upload files from a remote file server.
    Note: To upload a file from a remote file server, you must first create a remote file-server profile by clicking the Configure File Server icon (Configure remote file server icon). For more information, see Configuring a remote file server.
  5. If you chose to use a remote file server, select the server that you want to use from the Remote File Server list.
  6. Select the operating-system type.
  7. Enter the file name of the installation script, or click Browse to find the file that you want to import.
  8. Optional: Enter a description for the installation script.
    Tip: Use the Description field to distinguish between custom files with the same name.
  9. Optional: Select a checksum type to verify that the file being uploaded is not corrupt, and copy and paste the checksum value in the provided text field.

    If you select a checksum type, you must specify a checksum value to check the integrity and security of the uploaded file. The value must come from a secure source from an organization that you trust. If the uploaded file matches with the checksum value, it is safe to proceed with deployment. Otherwise, you must upload the file again or check the checksum value.

    Three checksum types are supported:

    • MD5

    • SHA1

    • SHA256

  10. Click Import.
    Tip: The file is uploaded over a secure network connection. Therefore, network reliability and performance affects how long it takes to import the file.

    If you close the web browser tab or window in which the file is being uploaded locally before the upload completes, the import fails.

What to do next

The installation scripts are listed on the Installation Scripts tab on the Manage OS Images page.

From this page, you can perform the following actions.

For information about adding an installation script to a customized OS image profile, see Creating a custom OS-image profile.