I have an issue while creating an AMI based on the standard AWS Ubuntu 18.04 server image. This issue did not occur with Ubuntu 16.04.
When I boot a standard AWS Ubuntu 18.04 image and create a new AMI without touching anything on the image, I have no issue when using this new AMI to boot another instance.
However, if I simply run the following commands:
sudo apt update
sudo apt install ubuntu-desktopthen create a new AMI and use it to boot a new instance, bang, no network interface, whatever the type of instance I try to launch. Usually an 'ens3' or 'eth0' network interface should appear.
I narrowed down the problem to be perhaps related to the new netplan network handler which is may be disturbed by the sudden installation of ubuntu-desktop and may be bad interaction with NetworkManager.
Any idea on the possible cause of this behavior?
UPDATE
ubuntu@ip-172-31-13-58:~$ ls -al /etc/netplan/
total 12
drwxr-xr-x 2 root root 4096 Jun 19 04:10 .
drwxr-xr-x 88 root root 4096 Jun 19 04:10 ..
-rw-r--r-- 1 root root 473 Jun 19 04:10 50-cloud-init.yaml
ubuntu@ip-172-31-13-58:~$ cat /etc/netplan/50-cloud-init.yaml
# 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}
network: version: 2 ethernets: ens3: dhcp4: true match: macaddress: 02:7a:e7:bc:e8:c8 set-name: ens3
ubuntu@ip-172-31-13-58:~$ ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 172.31.13.58 netmask 255.255.240.0 broadcast 172.31.15.255 inet6 fe80::7a:e7ff:febc:e8c8 prefixlen 64 scopeid 0x20<link> ether 02:7a:e7:bc:e8:c8 txqueuelen 1000 (Ethernet) RX packets 692 bytes 665816 (665.8 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 366 bytes 41639 (41.6 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 184 bytes 14306 (14.3 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 184 bytes 14306 (14.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 9 1 Answer
I hit the same problem. It turns the ifupdown pkg is up to blame. Simply removing it (apt purge ifupdown) should solve the problem.