EphemeralIPv4Network: when device has requested existing network config, but link is down, network setup does not bring link up

Bug #1802598 reported by Chad Smith
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Medium
Unassigned

Bug Description

EphemeralIPv4Network exists in success too early on network devices with link down.

When run against a network interfaces which already has the requested ip configuration and routes but hapeens to be "link down", EphemeralIPv4Network.bringup_device exits immediately after determining that the device has the expected ip address.

EphemeralIPv4Network should instead ensure that all configured aspects of a network interface are properly setup before returning the context.

Steps to reproduce:

echo > ephemeral_test.py <<EOF
#!/usr/bin/python3
from cloudinit import log
from cloudinit.net.dhcp import EphemeralDHCPv4
from cloudinit.cmd.devel import addLogHandlerCLI

LOG = log.getLogger('ephemeraldhcp')
addLogHandlerCLI(LOG, log.DEBUG)
with EphemeralDHCPv4() as lease:
      print('LEASE: %s' % lease)
EOF
chmod 755 ephemeral_test.py

lxc launch ubuntu-daily:bionic b1
lxc file push ephemeral_test.py b1/

# lxc has already completed configured the device, so we expect to only see the following ip commands

# 'ip', '-family', 'inet', 'addr', 'add' ...
# 'ip', 'route', 'show', '0.0.0.0/0'
lxc exec b1 /ephemeral_test.py | grep Running

# bringing down the link, I'd want to see EphemeralIPv4Network performing a call to [ip link set eth0 up ]

lxc exec b1 ip link eth0 down

lxc exec b1 /ephemeral_test.py | grep Running

Chad Smith (chad.smith)
Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.