diff options
author | Chris Patterson <cpatterson@microsoft.com> | 2023-05-10 12:05:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 14:05:15 -0500 |
commit | 0c4d53f2b756c8ecc3c17e3403ba66ebb5ce1560 (patch) | |
tree | bb6e0786c6e7018bbb9df9511a19659698434a13 /cloudinit/sources/DataSourceAzure.py | |
parent | 642276120355b99d2c0e6ebdcdb090b18faa4c66 (diff) | |
download | cloud-init-git-0c4d53f2b756c8ecc3c17e3403ba66ebb5ce1560.tar.gz |
net: purge blacklist_drivers across net and azure (#2160)
It was only used by Hyper-V which now has a filtering
mechanism that does not require the use of a denylist.
This exposed some issues with tests misspelling "hv_netvsc"
and using unmatched mac addresses. This fixes those to work
with the current filter that does not rely on the driver name.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
Diffstat (limited to 'cloudinit/sources/DataSourceAzure.py')
-rw-r--r-- | cloudinit/sources/DataSourceAzure.py | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index 863a06b5..77b53aaa 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -79,25 +79,6 @@ UBUNTU_EXTENDED_NETWORK_SCRIPTS = [ "/run/network/interfaces.ephemeral.d", ] -# This list is used to blacklist devices that will be considered -# for renaming or fallback interfaces. -# -# On Azure network devices using these drivers are automatically -# configured by the platform and should not be configured by -# cloud-init's network configuration. -# -# Note: -# Azure Dv4 and Ev4 series VMs always have mlx5 hardware. -# https://docs.microsoft.com/en-us/azure/virtual-machines/dv4-dsv4-series -# https://docs.microsoft.com/en-us/azure/virtual-machines/ev4-esv4-series -# Earlier D and E series VMs (such as Dv2, Dv3, and Ev3 series VMs) -# can have either mlx4 or mlx5 hardware, with the older series VMs -# having a higher chance of coming with mlx4 hardware. -# https://docs.microsoft.com/en-us/azure/virtual-machines/dv2-dsv2-series -# https://docs.microsoft.com/en-us/azure/virtual-machines/dv3-dsv3-series -# https://docs.microsoft.com/en-us/azure/virtual-machines/ev3-esv3-series -BLACKLIST_DRIVERS = ["mlx4_core", "mlx5_core"] - def find_storvscid_from_sysctl_pnpinfo(sysctl_out, deviceid): # extract the 'X' from dev.storvsc.X. if deviceid matches @@ -182,7 +163,7 @@ def determine_device_driver_for_mac(mac: str) -> Optional[str]: """Determine the device driver to match on, if any.""" drivers = [ i[2] - for i in net.get_interfaces(blacklist_drivers=BLACKLIST_DRIVERS) + for i in net.get_interfaces() if mac == normalize_mac_address(i[1]) ] if "hv_netvsc" in drivers: @@ -723,8 +704,6 @@ class DataSourceAzure(sources.DataSource): except Exception as e: LOG.warning("Failed to get system information: %s", e) - self.distro.networking.blacklist_drivers = BLACKLIST_DRIVERS - try: crawled_data = util.log_time( logfunc=LOG.debug, @@ -1888,13 +1867,11 @@ def generate_network_config_from_instance_network_metadata( @azure_ds_telemetry_reporter def _generate_network_config_from_fallback_config() -> dict: - """Generate fallback network config excluding blacklisted devices. + """Generate fallback network config. @return: Dictionary containing network version 2 standard configuration. """ - cfg = net.generate_fallback_config( - blacklist_drivers=BLACKLIST_DRIVERS, config_driver=True - ) + cfg = net.generate_fallback_config(config_driver=True) if cfg is None: return {} return cfg |