To initialize a Windows machine, create infrastructure and blueprints in vRealize Automation Cloud Assembly so that the initializable Windows image runs the commands that you want.

The example shown here is based on vSphere, but other cloud vendors should be similar.

Prerequisites

  • Create infrastructure. In vRealize Automation Cloud Assembly, add your vSphere cloud account and an associated cloud zone.
  • Add flavor and image mappings, and add network and storage profiles.

    In your infrastructure, an image mapping must point to the Windows template you created to support Cloudbase-Init. See How to create an initializable Windows image for vSphere.

    If the template isn't listed, go to Cloud Accounts, and synchronize images. Otherwise, automatic synchronization runs every 24 hours.

  • Add a project, add users, and make sure the users can provision to your cloud zone.

For more about creating infrastructure and projects, see the examples in the WordPress use case.

Procedure

  1. In vRealize Automation Cloud Assembly, go to the Design tab, and create a new blueprint.
  2. Add a cloudConfig section with the Cloudbase-init commands that you want.

    The following command examples create a new file at the Windows C: drive and set the host name.

    resources:
      Cloud_Machine_1:
        type: Cloud.Machine
        properties:
          image: cloudbase-init-win-2016
          flavor: small
          remoteAccess:
            authentication: usernamePassword
            username: Administrator
            password: Password1234@$
          cloudConfig: |
            #cloud-config
            write_files:
              content: Cloudbase-Init test
              path: C:\test.txt
            set_hostname: testname

    For more information, see the Cloudbase-init documentation.

  3. Add remoteAccess properties so that you configure the machine for initial login to Windows.

    As mentioned when you created the template, the metadata service picks up the login credentials and exposes them to CreateUserPlugin and SetUserPasswordPlugin. Note that the password must meet Windows password requirements.

  4. From vRealize Automation Cloud Assembly, test and deploy the blueprint.
  5. After deploying, use Windows RDP and the credentials in the blueprint to log in to the new Windows machine and verify the customization.

    In the example above, you would look for the C:\test.txt file, and check the system properties for the host name.