Public bug reported:

[ Impact ]

Cloud-init recently added policy based routing for multi-nic setups in
EC2. The added code assumed that "subnet-ipv4-cidr-block" would be
present in the metadata obtained from EC2's IMDS. However, on ipv6-only
instances, this is not true. The assumption leads to a traceback when
attempting to access the key, resulting in cloud-init failing to
properly render the network configuration and leaving the instance
unaccessable.

The fix is to check for required keys before configuring policy based
routing, and if the keys do not exist, skip configuration.

[ Test Plan ]

Launch an EC2 instance with at least two NICs in an ipv6-only subnet.
Verify that the instance can be accessed via SSH.
Verify that there are no warnings of tracebacks in the logs related to network 
configuration.
Verify that /etc/netplan/50-cloud-init.yaml contains the relevant routing 
information and that `ip route` shows the routes as active.

[ Where problems could occur ]

Since we've added a guard to the policy-based routing rendering, any
error in this code would result in the same functionality as now, or
result in rendering all of the network except for the policy based
routing for secondary NICs.


[ Other Info ]
Upstream bug: https://github.com/canonical/cloud-init/issues/5283
Upstream fix: https://github.com/canonical/cloud-init/pull/5287
Upstream change causing issue: 
https://github.com/canonical/cloud-init/pull/4799/files#diff-66c4d0c34e626a49273eda62819c3068f5501520b86f28e89e0f998cf4cf2027R1058

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

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

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

** Also affects: cloud-init (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: cloud-init (Ubuntu Oracular)
   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/2066979

Title:
  cloud-init network fails in ipv6-only subnet with multi-NICs

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


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

Reply via email to