Skip to main content

Deploying VMware ESXi v6.7 with Lenovo Customization with a configurable locale and second-user credentials

This scenario installs the VMware ESXi v6.7 with Lenovo Customization operating system with a configurable language enabled for the keyboard locale and credentials for a second ESXi user. This example also uses basic network and storage settings that are defined in the UI. A custom OS-image profile is used that includes an unattend file (with predefined and custom macros) and a configuration-settings file for selecting the password. This custom profile can be selected on the Deploy OS Images page. Then, the password can be specified on the Custom Settings tab. The specified value is substituted for the custom macro in the custom unattend file, and the ESXi 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 VMware ESXi v6.7 using custom OS-image profile, complete the following steps.

  1. Download the VMware vSphere® Hypervisor (ESXi) with Lenovo Customization operating system from the VMware Support – Downloads webpage 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 ESXi image to import (for example, ESXi6.7-7535516-RC-Lenovo_20180126_Async.iso).

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

    7. Wait for the import to complete.

  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 choose keyboard locale and the user ID and password for a second ESXi user 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 ESXi for the operating system.

    5. Click Browse to find and select the configuration-settings file to import (for example, ESXi_locale_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 ESXi unattend (kickstart) file to specify the operating-system locale and keyboard locale and user credentials for the second ESXi user, and then import the custom file to the OS-images repository. For more information, see Importing custom unattend files.
    Add commands to set the keyboard locale, for example:
    # Set the keyboard locale
    keyboard ''
    Add commands to create a second ESXi user. In the following example, <user_id> and <password> will be replaced with custom macros in the next step.
    #Create second user
    /usr/lib/vmware/auth/bin/adduser -D -h /tmp <user_id>
    echo <password> | /usr/lib/vmware/auth/bin/passwd <user_id> --stdin
    /bin/vim-cmd vimsvc/auth/entity_permission_add vim.Folder:ha-folder-root <user_id> false Admin true

    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 ESXi for the operating system.

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

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

  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.

    • XClarity Administrator provides some basic convenience macros, such as OOB driver injection, status reporting, post-install scripts, custom software. However, to take advantage of these predefine macros, you must specify the following macros in the custom unattend file. The example file already contains the required macros. Note that because the %firstboot section is included, the ordering of these predefined macros matters. For more information, see Importing custom unattend files.

      #predefined.unattendSettings.preinstallConfig#
      #predefined.unattendSettings.postinstallConfig#
    • XClarity Administrator also provides macros that inject all network and storage-location settings that are defined in the UI. These macros are useful when only basic settings are needed for the deployment. The example file already contains the required macros.

      #predefined.unattendSettings.networkConfig#
      #predefined.unattendSettings.storageConfig#

    For more information about adding macros to unattend files, see Injecting predefined and custom macros to an unattend file. For more information about available predefined macros, see Predefined macros.

    To associate the custom unattend file with the custom configuration-settings file, complete these steps.

    1. From the Unattend Files tab, select the custom attend file (for example, ESXi_locale_customUnattend.cfg).

    2. Click the Associate a Configuration File icon (Associate a configuration file icon) to display the Associate an Unattend File dialog.

    3. Select the configuration-settings file to associate with the unattend file (for example, ESXi_locale_customConfig).

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

    5. Add the custom macro for specifying the keyboard locale by placing the cursor between the single quotes after keyboard, and then clicking keyboard_locale.

      For example:

      # Set the keyboard locale 
      keyboard '#keyboard_locale#'

    6. Add the custom macro for specifying the second user's ID by placing the cursor at each location where you want to add the user ID, and then clicking second_user_id. In the example file, replace each occurrence of <user_id> with the custom macro.

      For example:

      #Create second user
      /usr/lib/vmware/auth/bin/adduser -D -h /tmp #second_user_id#
      echo <password> | /usr/lib/vmware/auth/bin/passwd #second_user_id# --stdin
      /bin/vim-cmd vimsvc/auth/entity_permission_add vim.Folder:ha-folder-root #second_user_id# false Admin true

    7. Add the custom macro for specifying the second user's password by placing the cursor at the location where you want to add the password, and then clicking second_user_password. In the example file, replace <password> with the custom macro.

      For example:

      #Create second user
      /usr/lib/vmware/auth/bin/adduser -D -h /tmp #second_user_id#
      echo #second_user_password# | /usr/lib/vmware/auth/bin/passwd #second_user_id# --stdin
      /bin/vim-cmd vimsvc/auth/entity_permission_add vim.Folder:ha-folder-root #second_user_id# false Admin true

    8. Click Associate 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, Virtualization).

    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 ESXi using custom locale and second user credentials).

      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 Unattend Files tab, select the unattend file (for example, ESXi_locale_customUnattend.cfg), and click Next.

      The associated configuration-settings file is automatically selected.

    6. On the Summary tab, review the settings.

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

  6. Deploy the custom OS-image profile to the target server. 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.

        • The network settings that you specify on the Network Settings dialog are added to the unattend file at runtime using the #predefined.hostPlatforms.networkConfig# macro.

      3. Select the custom OS-image profile (for example, <base_OS>|<timestamp>_Custom ESXi using custom locale and second user credentials) from the drop-down list in the Image to Deploy column

        Note
        Ensure that all target servers use the same custom profile.
      4. (Optional) Click the License Key icon (License key icon) and specify the license key to use to activate the operating system after it is installed.

      5. 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.

        • The storage settings that you specify on the Storage Settings dialog are added to the unattend file at runtime using the #predefined.hostPlatforms.storageConfig# macro.

      6. 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, ESXi_locale_customConfig).

      Note
      The associated custom unattend file is selected automatically.

      Graphic showing initial setup screen for VMware ESXi
    5. On the Server-Specific Settings subtab, select the keyboard locale and credentials for the second ESXi user.

    6. On the Summary tab, review the settings.

    7. Click Deploy to deploy the operating system.