For Automation Assembler to initialize a Windows machine deployed to vSphere, the image needs to be based on a vSphere template with Cloudbase-Init installed and configured.

Creating the image

  1. Use vSphere to make and power on a Windows virtual machine.
  2. On the virtual machine, log in to Windows.
  3. Download Cloudbase-Init.

    https://cloudbase.it/cloudbase-init/#download

  4. Start the Cloudbase-Init setup .msi file.

    During installation, enter Administrator as the username, and select the option to run as LocalSystem.

    Cloudbase-Init installation wizard account page

    Other setup selections can remain as default values.

  5. Allow the installation to run, but do not close the final Completed page of the setup wizard.
    Important: Do not close the final page of the setup wizard.
  6. With the Completed page of the setup wizard still open, use Windows to navigate to the Cloudbase-Init installation path, and open the following file in a text editor.

    conf\cloudbase-init-unattend.conf

  7. Set metadata_services to OvfService as shown. Add the setting if it doesn't already exist.

    metadata_services=cloudbaseinit.metadata.services.ovfservice.OvfService

  8. Save and close cloudbase-init-unattend.conf.
  9. In the same folder, open the following file in a text editor.

    conf\cloudbase-init.conf

  10. Set first_logon_behaviour, metadata_services, and plugins as shown. Add the settings if they don't already exist.
    first_logon_behaviour=always
    . . .
    metadata_services=cloudbaseinit.metadata.services.ovfservice.OvfService
    . . . 
    plugins=cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin
    . . .
  11. Save and close cloudbase-init.conf.
  12. On the Completed page of the setup wizard, select the options to run Sysprep and to shut down after Sysprep, then click Finish.
    Note: VMware has seen cases where running Sysprep prevents deployments of the image from working.

    When deploying, Automation Assembler applies a dynamically generated customization specification, which disconnects the network interface. The pending Sysprep state in the image might cause the customization specification to fail and leave the deployment disconnected.

    If you suspect that this is happening in your environment, try leaving the Sysprep options deactivated when creating the image.
    Cloudbase-Init installation wizard final page
  13. After the virtual machine shuts down, use vSphere to turn it into a template.

Additional details

The following table expands upon the configuration entries made during setup.

Configuration Setting Purpose
Username, CreateUserPlugin, and SetUserPasswordPlugin After Sysprep, first boot uses CreateUserPlugin to create the username Administrator account with a blank password. SetUserPasswordPlugin allows Cloudbase-Init to change the blank password to the remote access password that will be included in the cloud template.
First Logon Behavior This setting prompts the user to change the password upon first login.
Metadata services By listing only OvfService, Cloudbase-Init won’t try to find other metadata services that aren't supported in vCenter. This results in cleaner log files, because the logs would otherwise fill with entries about failing to find those other services.
Plugins By listing only plugins with capabilities supported by OvfService, logs are again cleaner. Cloudbase-Init runs plugins in the order specified.
Run as LocalSystem This setting supports any advanced initialization commands that might require Cloudbase-Init to run under a dedicated administrator account.