Using the Openstack Debian image
(https://cloud.debian.org/cdimage/openstack/current-10/debian-10-openstack-amd64.qcow2)
with the following cloud-config:
---- network-config ----
version: 1
config:
- type: physical
name: eth0
mac_address: '4e:3c:c1:69:fe:cc'
subnets:
- type: static
address: '10.110.10.45'
netmask: '255.255.255.0'
gateway: '10.110.10.1'
- type: dhcp6
- type: nameserver
address:
- '213.133.100.100'
- '213.133.99.99'
- '213.133.98.98'
-----------------------
---- /etc/network/interfaces ----
results in duplicate configurations for eth0:
root@foo2:/home/debian# cat $(find /etc/network/interfaces* -type f)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The normal eth0
allow-hotplug eth0
iface eth0 inet dhcp
# Additional interfaces, just in case we're using
# multiple networks
allow-hotplug eth1
iface eth1 inet dhcp
allow-hotplug eth2
iface eth2 inet dhcp
# Set this one last, so that cloud-init or user can
# override defaults.
source /etc/network/interfaces.d/*
--------
---- /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
dns-nameservers 213.133.100.100 213.133.99.99 213.133.98.98
auto eth0
iface eth0 inet static
address 10.110.10.45/24
gateway 10.110.10.1
# control-alias eth0
iface eth0 inet6 dhcp
--------
If I pass a dhcp configuration to cloud-config, the image fails to boot.
--