Deploying SLES 12 SP3 with custom packages and time zone

This scenario installs the SLES 12 SP3 operating system (in English) and several optional SLES packages. It also prompts for the time zone. A custom OS-image profile is used that includes a custom configuration file and custom unattend file. This custom profile can be selected on the Deploy OS Images page. Then, the SLE packages that you want to deploy can be selected and time zone can be specified on the Custom Settings tab. The selected values are substituted for the custom macros in the custom unattend, and the SLES autoyast installer uses those values in the unattend file to configure the operating system.

Before you begin

This scenario uses the following sample files.

Procedure

To deploy SLES 12 SP3 to servers using a custom OS-image profile, complete the following steps.

  1. Download the base SLES operating system from the SUSE website to the local system, and import the image to the OS-images repository. For more information, see Importing operating-system images.
    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 OS Images tab.

    3. Click Import icon (Import icon).

    4. Click Local Import.

    5. Click Browse to find and select the SLES 12 SP3 image to import (for example, SLE-12-SP3-Server-DVD-x86_64-GM-DVD1.iso).

    6. Click Import to upload the image to the OS-images repository.

    7. Wait for the import to complete. This might take a while.

  2. Create a custom configuration-settings file, and import the file to the OS-images repository.

    The configuration-settings file is a JSON file that describe the data that needs to be gathered dynamically during the OS deployment process. For this scenario, we want to specify the optional SLES packages that can be installed (including SLES Linux, Apache, MySQL, PHP software package, SLES mail-server package, and SLES file-server package) and a time zone to use for each OS deployment. For more information about creating a configuration-settings file, see Custom macros.

    To import the configuration-settings file, complete these steps. For more information, see Importing custom configuration settings.

    1. Click the Configuration Files tab.

    2. Click the Import icon (Import icon).

    3. Click Local Import.

    4. Select SLES for the operating system.

    5. Click Browse to find and select the configuration-settings file to import (for example, SLES_installPackages_customConfig.json).

    6. Click Import to upload the file to the OS-images repository.

      Note: When you import a custom configuration-settings file, XClarity Administrator generates custom macros for each setting in the file. You can add those macros to the unattend file. During OS deployment, the macros are replaced with actual values.
  3. Modify the SLES unattend file to specify dynamic values for the optional SLES packages and time zone, and then import the custom file to the OS-images repository. For more information, see Importing custom unattend files.
    In the <general> section, add the time zone information, for example:
    <timezone>
       <hwclock></hwclock>
       <timezone></timezone>
    </timezone>
    In the <patterns> section, add three pattern tags. These tags are used for the custom macros for the optional SLES package settings, for example:
    <patterns config:type="list">
       <pattern>32bit</pattern>
       <pattern>Basis-Devel</pattern>
       <pattern>Minimal</pattern>
       <pattern>WBEM</pattern>
       <pattern>apparmor</pattern>
       <pattern>base</pattern>
       <pattern>documentation</pattern>
       <pattern>fips</pattern>
       <pattern>gateway_server</pattern>
       <pattern>ofed</pattern>
       <pattern>printing</pattern>
       <pattern>sap_server</pattern>
       <pattern>x11</pattern>
       <pattern></pattern>
       <pattern></pattern>
       <pattern></pattern>
    </patterns>
    Note:
    • These tags are in the sample unattend file.

    • When you use a custom unattend file, XClarity Administrator does not provide many of the normal convenience features that you get when you use a predefined unattend file. For example, the targets <DiskConfiguration>, <ImageInstall>, <ProductKey>, and <UserAccounts> for Administrator, <Interfaces> for networking, and <package> list for installation features must be specified in the custom unattend file that is being uploaded.

    To import the custom unattend file, complete these steps.

    1. Click the Unattend Files tab.

    2. Click the Import icon (Import icon).

    3. Click Local Import.

    4. Select SLES for the operating system.

    5. Click Browse to find and select the unattend file to import (for example, SLES_installPackages_customUnattend.xml).

    6. Click Import to upload the file to the OS-images repository.

      Note: A warning that there are missing predefined macros in the unattend file is displayed. You can ignore the warning for now. You will add the predefined macros in the next step
    7. Click Close in the warning dialog to open the Edit Unattend File dialog.

  4. Associate the custom unattend file with the custom configuration-settings file, and add the required predefined and custom macros (settings) from the configuration-settings file to the unattend file. For more information, see Associating an unattend file with a configuration settings file and Injecting predefined and custom macros to an unattend file.
    Tip: You can optionally associate the custom unattend file with the custom configuration-settings file and add macros when importing the unattend file.
    1. From the Edit Unattend File dialog, select the configuration-settings file to associate with the unattend file from the Associate a Configuration File drop-down list (for example, SLES_installPackages_customConfig).

    2. Add the required predefined macros to the unattend file.

      1. Select Predefined from the Available Macros drop-down list.

      2. Place the cursor in the unattend file anywhere after line 1 (after the <xml> tag).

      3. Expand the predefined > unattendSettings list in the list of available predefined macros.

      4. Click the preinstallConfig and postinstallConfig macros to add the macros to the unattend file.

      For example:

      <?xml version="1.0"?>
      <!DOCTYPE profile SYSTEM "/usr/share/YaST2/include/autoinstall/profile.dtd">
      #predefined.unattendSettings.preinstallConfig#
      #predefined.unattendSettings.postinstallConfig#
      <profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
    3. Add the custom macro for specifying the time zone.

      1. Select Custom from the Available Macros drop-down list.

      2. Place the cursor after the <hwclock> tag, and click timezone to add the time zone macro.

      3. Place the cursor after the <timezone> tag, and click timezone to add the time zone macro.

      For example:

      <timezone>
         <hwclock>#timezone#</hwclock>
         <timezone>#timezone#</timezone>
      </timezone>
    4. Add the custom macro for specifying the optional SLES packages.

      1. Expand the server-settings > node list in the list of available custom macros.

      2. Place the cursor in one of the empty <pattern> tags, and click fileserver.

      3. Place the cursor in one of the empty <pattern> tags, and click lampserver.

      4. Place the cursor in one of the empty <pattern> tags, and click mailserver.

      For example:

      <patterns config:type="list">
         <pattern>32bit</pattern>
         <pattern>Basis-Devel</pattern>
         <pattern>Minimal</pattern>
         <pattern>WBEM</pattern>
         <pattern>apparmor</pattern>
         <pattern>base</pattern>
         <pattern>documentation</pattern>
         <pattern>fips</pattern>
         <pattern>gateway_server</pattern>
         <pattern>ofed</pattern>
         <pattern>printing</pattern>
         <pattern>sap_server</pattern>
         <pattern>x11</pattern>
         <pattern>#server-settings.node.fileserver#</pattern>
         <pattern>#server-settings.node.lampserver#</pattern>
         <pattern>#server-settings.node.mailserver#</pattern>
      </patterns>
    5. Click Save to bind the files together and save the changes to the unattend file.

  5. Create a custom OS-image profile that includes the custom configuration-settings and unattend files. For more information, see Creating a custom OS-image profile.
    1. Click the OS Images tab.

    2. Select an OS-image profile to customize (for example, Basic).

    3. Click Create icon (Create icon) to display the Create Customized Profile dialog.

    4. On the General tab:

      1. Enter a name for the profile (for example, Custom SLES with optional packages).

      2. Use the default value for the Custom data and file path field.

      3. Select Associated unattend and configuration-settings files for the customization type.

      4. Click Next.

    5. On the Driver Options tab, click Next. The inbox device drivers are included by default.

    6. On the Software tab, click Next.

    7. On the Unattend Files tab, select the unattend file (for example, SLES_installPackages_customUnattend.xml), and click Next.

      The associated configuration-settings file is automatically selected.

    8. On the Installation Scripts tab, click Next.

    9. On the Summary tab, review the settings.

    10. Click Customize to create the custom OS-image profile.

  6. Deploy the custom OS-image profile to the target servers. For more information, see Deploying an operating-system image.
    1. From the XClarity Administrator menu bar, click Provisioning > Deploy OS Images to display the Deploy Operating System: Deploy OS Images page.

    2. For each target server:

      1. Select the server.

      2. Click Change Selected > Network Settings, and specify the hostname, IP address, DNS, MTU and VLAN settings for the server.

        Tip: VLAN settings are available only when VLAN mode is set in Global Settings > IP Assignment > Use VLANs.
      3. Select the custom OS-image profile (for example, <base_OS>|<timestamp>_Custom SLES with optional packages) from the drop-down list in the Image to Deploy column

        Note: Ensure that all target servers use the same custom profile.
      4. Select the preferred storage location where you want to deploy the operating system image from the Storage column.

        Note: To ensure that operating-system deployments are successful, detach all storage from the managed server except the storage that is chosen for the operating-system deployment.
      5. Verify that the deployment status for the selected server is Ready.

    3. Select all target servers, and click the Deploy image icon (Deploy image icon) to initiate the operating-system deployment.

    4. On the Custom Settings tab, click the Unattend and Configuration Settings subtab, and select the custom configuration-settings file (for example, SLES_installPackages_customConfig).

      Note: The associated custom unattend file is selected automatically.

      Illustrates the Deploy OS Images dialog for selecting the custom configuration file.
    5. On the Server-Specific Settings subtab, select the target server and the optional SLES packages that you want to deploy.


      Illustrates the Deploy OS Images dialog for selecting the server-specific settings.
    6. On the Common Settings subtab, select the time zone to set for all target servers.
      Illustrates the Deploy OS Images dialog for selecting the custom settings.

    7. On the Summary tab, review the settings.

    8. Click Deploy to deploy the operating system.