VMware vSphere ESXi 7.0.3
cloud-init ver
< 23.1)or Datasource VMware(cloud-init ver
>= 23.1)is included in cloud-init Datasource search list.
{
"instance-id": "cloud-vm",
"local-hostname": "cloud-vm",
"network": {
"version":2,
"ethernets": {
"nics": {
"match": {
"name": "ens*"
},
"dhcp4": "yes"
}
}
}
}
instance-id: cloud-vm
local-hostname: cloud-vm
network:
version: 2
ethernets:
nics:
match:
name: ens*
dhcp4: yes
Please find the article "Guest Customization Using cloud-init" on how to customize a virtual machine using cloud-init metadata and user data using the vSphere web service API. The article is using Ubuntu 20.04 as an example.
network:
config: disabled
cloud-init
will generate a fallback network which is DHCP usually.