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.
Operating system | Supported File Types | More information |
---|---|---|
CentOS Linux | Not supported | |
Microsoft® Windows® Azure Stack HCI | Not supported | |
Microsoft Windows Hyper-V Server | Not supported | |
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 |
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. |
Rocky Linux | 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 |
Ubuntu | Not supported | |
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 |
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.
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 () 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.
After you finish
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.
Create a remote-file-server profile by clicking the Configure File Server icon ().
Remove selected installation scripts by clicking the Delete icon ().
For information about adding an installation script to a customized OS image profile, see Creating a custom OS-image profile.