An image mapping groups a set of pre-defined target OS specifications for a specific cloud account/region in Cloud Assembly by using natural language naming.

Cloud vendor accounts such as Microsoft Azure and Amazon Web Services use images to group a set of target deployment conditions together, including OS and related configuration settings. vCenter and NSX-based environments, including VMware Cloud on AWS, use a similar grouping mechanism to define a set of OS deployment conditions. When you build and eventually deploy and iterate a blueprint, you pick an available image that best fits your needs.

Organize image mappings for a project by similar operating system settings, tagging strategy, and functional deployment intent.

To simplify blueprint creation, you can select a pre-configuration option when you add a new cloud account. When you select the pre-configuration option, your organization's most popular flavor mapping and image mapping for the specified region are selected.

For a basic image mapping example, see WordPress use case: add image mappings.

Viewing OVF details

You can include OVF specifications in Cloud Assembly blueprint objects, such as vCenter machine components and image maps. If your image contains an OVF file, you can discover its content without opening the file. Hover over the OVF to display OVF details, including its name and location. For more information about the OVF file format, see vcenter ovf: property.

hover over the View OVF Details symbol and click to see the OVF contents

Using constraints and tags to refine image selection

To further refine image selection you can add one or more constraints to specify tag-based restrictions on the type of image that can be deployed. The supplied constraints example of !license:none:hard illustrates a tag-based restriction where the image can only be used if the license:none tag is not present in the blueprint. If you add tags such as license:88 and license:92, the specified image can be used only if the license:88 and the license:92 tags are present in the blueprint.

When you add image information to a blueprint, you use either the image or imageRef property in the blueprint YAML. You cannot use the image and imageRef properties together. For example, if you want to clone from a snapshot, use the imageRef property.

Using a cloud configuration script to control deployment

You can use a cloud configuration script in an image map, blueprint, or both to define custom OS characteristics to be used in a Cloud Assembly deployment. For example, based on whether you are deploying a blueprint to a public or private cloud, you can apply specific user permissions, OS permissions, or other conditions to the image. A cloud configuration script adheres to a cloud-init format for Linux-based images or a cloudbase-init format for Windows-based images. Cloud Assembly supports the cloud-init tool for Linux systems and the cloudbase-init tool for Windows.

For Windows machines, you can use any cloud configuration script format that is supported by cloudbase-init.

The machine resource in the following sample blueprint YAML uses an image that contains a cloud configuration script, the content of which is seen in the image entry.

resources:
  demo-machine:
    type: Cloud.vSphere.Machine
    properties:
      flavor: small
      image: MyUbuntu16 
        https://cloud-images.ubuntu.com/releases/16.04/release-20170307/ami-ubuntu-16.04-1.10.3-00-15269239.ova
      cloudConfig: |
        ssh_pwauth: yes
        chpasswd:
          list: |
            ${input.username}:${input.password}
          expire: false
        users:
          - default
          - name: ${input.username}
            lock_passwd: false
            sudo: ['ALL=(ALL) NOPASSWD:ALL']
            groups: [wheel, sudo, admin]
            shell: '/bin/bash'
        runcmd:
          - echo "Defaults:${input.username}  !requiretty" >> /etc/sudoers.d/${input.username}

What happens when an image map and a blueprint contain a cloud configuration script

When a blueprint that contains a cloud configuration script uses a mapped image that contains a cloud configuration script, precedence is given to the image mapping script. When the cloud configuration scripts contain a list of commands, all the commands are merged from the image mapping script and the blueprint script to create a list of commands to use. If a command is used in the image mapping script and the blueprint script, the command value from the image mapping script is used.

More information about configuring and using cloud configuration scripts

For more information about using cloud configuration scripts, see How to automatically initialize a machine in a Cloud Assembly blueprint and VMware blogger article Customizing Cloud Assembly Deployments with Cloud-Init.

Also see these Cloud-Init and Cloudbase-Init vendor pages: