Post

Avoiding Network Configuration Issues During Proxmox Upgrades

Today, I was painfully reminded to RTFM before upgrading. With the upgrade from Proxmox 8.1 to 8.2, there were some breaking changes:

Kernel: Change in Network Interface Names

Upgrading kernels always carries the risk of network interface names changing, which can lead to invalid network configurations after a reboot. In this case, you must either update the network configuration to reflect the name changes, or pin the network interface to its name beforehand.

See the reference documentation on how to pin the interface names based on MAC Addresses.

Currently, the following models are known to be affected at higher rates:

  • Models using i40e. Their names can get an additional port suffix like p0 added.

Since I didn’t read the release notes, my interface and SR-IOV configuration was completely messed up.

How Could I Have Avoided This?

As stated in the release notes, it is a good idea to set fixed interface names for physical devices. Following the official documentation, I came up with the following Ansible playbook:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
- name: Set fixed interface names in Proxmox
  hosts: "proxmox"
  tasks:
    - name: Set fixed interface names for physical devices
      when: ansible_facts[item].pciid is defined and ansible_facts[item].type == "ether"
      copy:
        dest: "/etc/systemd/network/10-{{ item }}.link"
        content: |
          [Match]
          MACAddress={{ ansible_facts[item]['macaddress'] | default(None) }}

          [Link]
          Name={{ item }}
        mode: "0664"
        owner: root
        group: root
      loop: "{{ ansible_interfaces }}"
      become: true
      notify: Reboot

  handlers:
    - name: Reboot
      reboot:

This playbook sets fixed interface names for all physical devices on the Proxmox host and reboots afterwards. This way, we won’t have this problem again when upgrading.

Show comments

Gist-Source: avoiding_network_configuration_issues_during_proxmox_upgrades.md

This post is licensed under CC BY 4.0 by the author.

Trending Tags