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.
- 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
- 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
- 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. AddOVF
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 ]
- 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 flagdisable_vmware_customization
totrue
and set the flagallow_raw_data
totrue
. If customization time-out is an issue, you can set the value ofvmware_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
- Run the cloud-init clean step to remove
any artifacts from previous configuration failures.
$ sudo cloud-init clean
- Power off the virtual machine
template.
$ sudo poweroff