Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mietzen/8ab21d5c2c4078d5df0c6d597d632a4c to your computer and use it in GitHub Desktop.
Save mietzen/8ab21d5c2c4078d5df0c6d597d632a4c to your computer and use it in GitHub Desktop.

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:

---
- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment