$ echo "network: {config: disabled}" | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}
$ sudo rm /etc/network/interfaces/50-cloud-init.cfg
rm: cannot remove '/etc/network/interfaces/50-cloud-init.cfg': Not a directory
And again after a reboot:
$ cat /etc/network/interfaces.d/50-cloud-init.cfg
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
Trying another time. Again, clean instance. This time using a very minimal cloud.cfg:
$ cat /etc/cloud/ cloud.cfg
users:
- default
datasource_list: ['OpenStack'] 169.254. 169.254']
datasource:
OpenStack:
metadata_urls: ['http://
timeout: 10
max_wait: 20
cloud_init_modules:
- users-groups
system_info: _dir: /etc/cloud/ templates/
distro: ubuntu
default_user:
name: opc
lock_passwd: true
gecos: Oracle Public Cloud User
groups: [wheel, adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
paths:
cloud_dir: /var/lib/cloud/
templates
upstart_dir: /etc/init/
ssh_svcname: ssh
$ echo "network: {config: disabled}" | sudo tee /etc/cloud/ cloud.cfg. d/99-disable- network- config. cfg interfaces/ 50-cloud- init.cfg interfaces/ 50-cloud- init.cfg' : Not a directory
network: {config: disabled}
$ sudo rm /etc/network/
rm: cannot remove '/etc/network/
And again after a reboot:
$ cat /etc/network/ interfaces. d/50-cloud- init.cfg cloud.cfg. d/99-disable- network- config. cfg with the following:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
auto lo
iface lo inet loopback
# control-manual ens2f0
iface ens2f0 inet dhcp
broadcast 10.0.0.255
dns-nameservers 169.254.169.254
gateway 10.0.0.1
netmask 255.255.255.0
$ grep "INFO.*disabled" /var/log/ cloud-init. log
$
I've attached a cloud-init log from this run as well. Hopefully should be more succinct.