Public bug reported:

This is a follow on from https://bugs.launchpad.net/ubuntu/+source
/cloud-init/+bug/1802073 + its fix in: https://git.launchpad.net/cloud-
init/commit/?id=0bb4c74e

After a clean launch of Ubuntu 18.04.2 on a t3.small AWS EC2 instance,
in a VPC in the eu-west-1 region, we can see the following:

---snip---
root@ip-172-31-23-210:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/";
SUPPORT_URL="https://help.ubuntu.com/";
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/";
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy";
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic


root@ip-172-31-23-210:~# dpkg -l | grep '\(cloud-init.*\|netplan.*\|ifupdown\)'
ii  cloud-init                     18.4-0ubuntu1~18.04.1             all        
  Init scripts for cloud instances
ii  cloud-initramfs-copymods       0.40ubuntu1.1                     all        
  copy initramfs modules into root filesystem for later use
ii  cloud-initramfs-dyn-netconf    0.40ubuntu1.1                     all        
  write a network interface file in /run for BOOTIF
ii  netplan.io                     0.40.1~18.04.4                    amd64      
  YAML network configuration abstraction for various backends


root@ip-172-31-23-210:~# 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:
        ens5:
            dhcp4: true
            match:
                macaddress: 06:bd:10:32:ce:7e
            set-name: ens5
root@ip-172-31-23-210:~#


root@ip-172-31-23-210:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group 
default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group 
default qlen 1000
    link/ether 06:bd:10:32:ce:7e brd ff:ff:ff:ff:ff:ff
    inet 172.31.23.210/20 brd 172.31.31.255 scope global dynamic ens5
       valid_lft 3510sec preferred_lft 3510sec
    inet6 fe80::4bd:10ff:fe32:ce7e/64 scope link
       valid_lft forever preferred_lft forever
root@ip-172-31-23-210:~#
---snip---


At this point, I installed all OS updates via: apt-get clean;apt-get 
update;apt-get dist-upgrade;

I rebooted the machine and checked the version of packages now
installed:

---snip---
root@ip-172-31-23-210:~# dpkg -l | grep '\(cloud-init.*\|netplan.*\|ifupdown\)'
ii  cloud-init                     18.5-45-g3554ffe8-0ubuntu1~18.04.1 all       
   Init scripts for cloud instances
ii  cloud-initramfs-copymods       0.40ubuntu1.1                      all       
   copy initramfs modules into root filesystem for later use
ii  cloud-initramfs-dyn-netconf    0.40ubuntu1.1                      all       
   write a network interface file in /run for BOOTIF
ii  netplan.io                     0.96-0ubuntu0.18.04.4              amd64     
   YAML network configuration abstraction for various backends
---snip---


1. The contents of the /etc/netplan/50-cloud-init.yaml file remained the
same as above after OS updates.

2. This means that if this machine is powered off and an AMI taken of
it, any new EC2 instances launched from that AMI will not have a working
network since the mac address of the new EC2 instances will not match
the "macaddress" line in the /etc/netplan/50-cloud-init.yaml file.

3. This happens because the mac address of a VPC EC2 instance is tied to
the ENI associated to the EC2 instance.

4. When a new instance is launched from the capture AMI, it will get a
new ENI and hence a new MAC address. So although the network
configuration file should be regenerated at first boot in the newly
launched instance, this currently doesn't happen. I do not know why.

** Affects: cloud-init (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1828622

Title:
  No network in AWS (VPC EC2 instance) after launching an instance from
  an AMI captured earlier

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1828622/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to