Prepare a Virtual Machine Template for Raw Data cloud-init Customization

The following steps prepare a virtual machine template for customization with raw cloud-init data.

  1. In the guest operating system, install open-vm-tools version 11.3.0 or later. Configure the Linux guest to run open-vm-tools services when the guest operating system starts.
    Example for an Ubuntu 20.04 guest operating system:
    $ sudo apt update
    $ sudo apt install open-vm-tools
    $ sudo vmtoolsd -v
    $ sudo systemctl is-enabled open-vm-tools.service
  2. In the guest operating system, install cloud-init version 21.1 or later. Configure the Linux guest to run cloud-init services when the guest operating system starts.
    Example for an Ubuntu 20.04 guest operating system:
    $ sudo apt update
    $ sudo apt install cloud-init
    $ sudo cloud-init -v
    $ sudo systemctl is-enabled cloud-init.service
    $ sudo systemctl is-enabled cloud-init-local.service
  3. Configure cloud-init to accept the OVF data source for VMware raw cloud-init configuration.

    Edit the cloud-init configuration file in /etc/cloud/cloud.cfg or in /etc/cloud/cloud.cfg.d/*, depending on the Linux distribution. Add OVF to the list of datasources accepted by cloud-init.

    Example line for cloud-init version 21.3:
    datasource_list: [ NoCloud, ConfigDrive, Azure, OVF, OpenStack, Ec2 ]
  4. Configure cloud-init to enable VMware customization with raw cloud-init data.

    Edit the cloud-init configuration file in /etc/cloud/cloud.cfg or in /etc/cloud/cloud.cfg.d/*, depending on the Linux distribution. Set the flag disable_vmware_customization to true and set the flag allow_raw_data to true. If customization time-out is an issue, you can set the value of vmware_cust_file_max_wait (default: 15 seconds).

    Example lines for cloud-init version 21.3:
    disable_vmware_customization: true
    datasource:
      OVF:
        allow_raw_data: true
    vmware_cust_file_max_wait: 25
  5. Run the cloud-init clean step to remove any artifacts from previous configuration failures.
    $ sudo cloud-init clean
  6. Power off the virtual machine template.
    $ sudo poweroff