lp:~gpiccoli/cloud-init

Get this repository:
git clone https://git.launchpad.net/~gpiccoli/cloud-init
Only Guilherme G. Piccoli can upload to this repository. If you are Guilherme G. Piccoli please log in for upload directions.

Branches

Name Last Modified Last Commit
lp1802073 2019-02-13 19:36:23 UTC
EC2: Rewrite network config on AWS Classic instances every boot

Author: Guilherme G. Piccoli
Author Date: 2019-02-11 13:43:37 UTC

EC2: Rewrite network config on AWS Classic instances every boot

AWS EC2 instances' network come in 2 basic flavors: Classic and VPC
(Virtual Private Cloud). The former has an interesting behavior of having
its MAC address changed whenever the instance is stopped/restarted. This
behavior is not observed in VPC instances.

In Ubuntu 18.04 (Bionic) the network "management" changed from ENI-style
(etc/network/interfaces) to netplan, and when using netplan we observe
the following block present in /etc/netplan/50-cloud-init.yaml:

match:
  macaddress: aa:bb:cc:dd:ee:ff

Jani Ollikainen noticed in Launchpad bug #1802073 that the EC2 Classic
instances were booting without network access in Bionic after a stop/restart
procedure, due to their MAC address change behavior. It was narrowed down to
the netplan MAC match block, that kept the old MAC address after stopping
and restarting an instance, since the network configuration writing happens
by default only once in EC2 instances, in the first boot.

This patch changes the network configuration write to every boot in EC2
Classic instances, by checking against the "vpc-id" metadata information
provided only in the VPC instances - if we don't have this metadata value,
cloud-init will rewrite the network configuration file in every boot.

This was tested in an EC2 Classic instance and proved to fix the issue;
unit tests were also added for the new method is_classic_instance().

LP: #1802073

Reported-by: Jani Ollikainen <jani.ollikainen@ik.fi>
Suggested-by: Ryan Harper <ryan.harper@canonical.com>
Co-developed-by: Chad Smith <chad.smith@canonical.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>

lp1802073_2b 2019-02-13 18:58:42 UTC
EC2: Rewrite network config on AWS Classic instances every boot

Author: Guilherme G. Piccoli
Author Date: 2019-02-11 13:43:37 UTC

EC2: Rewrite network config on AWS Classic instances every boot

AWS EC2 instances' network come in 2 basic flavors: Classic and VPC
(Virtual Private Cloud). The former has an interesting behavior of having
its MAC address changed whenever the instance is stopped/restarted. This
behavior is not observed in VPC instances.

In Ubuntu 18.04 (Bionic) the network "management" changed from ENI-style
(etc/network/interfaces) to netplan, and when using netplan we observe
the following block present in /etc/netplan/50-cloud-init.yaml:

match:
  macaddress: aa:bb:cc:dd:ee:ff

Jani Ollikainen noticed in Launchpad bug #1802073 that the EC2 Classic
instances were booting without network access in Bionic after a stop/restart
procedure, due to their MAC address change behavior. It was narrowed down to
the netplan MAC match block, that kept the old MAC address after stopping
and restarting an instance, since the network configuration writing happens
by default only once in EC2 instances, in the first boot.

This patch changes the network configuration write to every boot in EC2
Classic instances, by checking against the "vpc-id" metadata information
provided only in the VPC instances - if we don't have this metadata value,
cloud-init will rewrite the network configuration file in every boot.

This was tested in an EC2 Classic instance and proved to fix the issue;
unit tests were also added for the new method is_classic_instance().

LP: #1802073

Reported-by: Jani Ollikainen <jani.ollikainen@ik.fi>
Suggested-by: Ryan Harper <ryan.harper@canonical.com>
Co-developed-by: Chad Smith <chad.smith@canonical.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>

master 2019-01-30 15:38:56 UTC
Resolve flake8 comparison and pycodestyle over-ident issues

Author: Paride Legovini
Author Date: 2019-01-30 15:38:56 UTC

Resolve flake8 comparison and pycodestyle over-ident issues

Fixes:
 - flake8: use ==/!= to compare str, bytes, and int literals
 - pycodestyle: E117 over-indented

13 of 3 results
This repository contains Public information 
Everyone can see this information.