XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Rename Networks on XO Hosts

    Scheduled Pinned Locked Moved Xen Orchestra
    27 Posts 8 Posters 5.7k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dsiminiuk
      last edited by

      I have 2 hosts.
      I have enabled the 4 port LOM NIC in the BIOS on my pool master. The interfaces ethN appear correctly but are misnamed in the Name column.

      Name  MAC                PCI              ethN  Phys  SMBios                         Driver  Version  Firmware                 
      eth4  38:ea:a7:12:de:14  0000:04:00.0[0]  eth4  em49  Embedded FlexibleLOM 1 Port 1  ixgbe   5.9.4    0x800009e0, 1.3089.0     
      eth5  38:ea:a7:12:de:15  0000:04:00.1[0]  eth5  em50  Embedded FlexibleLOM 1 Port 2  ixgbe   5.9.4    0x800009e0, 1.3089.0     
      eth6  3c:a8:2a:15:4a:9c  0000:02:00.0[0]  eth0  em1   Embedded LOM 1 Port 1          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
      eth7  3c:a8:2a:15:4a:9d  0000:02:00.1[0]  eth1  em2   Embedded LOM 1 Port 2          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
      eth8  3c:a8:2a:15:4a:9e  0000:02:00.2[0]  eth2  em3   Embedded LOM 1 Port 3          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
      eth9  3c:a8:2a:15:4a:9f  0000:02:00.3[0]  eth3  em4   Embedded LOM 1 Port 4          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
      

      I would like to change the Name in the first column to match the name in the ethN column as they are in my second host (which had the NIC enabled previously).

      Name  MAC                PCI              ethN  Phys  SMBios                         Driver  Version  Firmware                 
      eth0  3c:a8:2a:1e:4e:e8  0000:02:00.0[0]  eth0  em1   Embedded LOM 1 Port 1          tg3     3.137    5719-v1.46 NCSI v1.5.33.0
      eth1  3c:a8:2a:1e:4e:e9  0000:02:00.1[0]  eth1  em2   Embedded LOM 1 Port 2          tg3     3.137    5719-v1.46 NCSI v1.5.33.0
      eth2  3c:a8:2a:1e:4e:ea  0000:02:00.2[0]  eth2  em3   Embedded LOM 1 Port 3          tg3     3.137    5719-v1.46 NCSI v1.5.33.0
      eth3  3c:a8:2a:1e:4e:eb  0000:02:00.3[0]  eth3  em4   Embedded LOM 1 Port 4          tg3     3.137    5719-v1.46 NCSI v1.5.33.0
      eth4  5c:b9:01:8a:c0:e0  0000:04:00.0[0]  eth4  em49  Embedded FlexibleLOM 1 Port 1  ixgbe   5.9.4    0x800009e0, 1.3089.0     
      eth5  5c:b9:01:8a:c0:e1  0000:04:00.1[0]  eth5  em50  Embedded FlexibleLOM 1 Port 2  ixgbe   5.9.4    0x800009e0, 1.3089.0 
      

      eth4 and eth5 match in both hosts and I don't want to break those because I have existing data and NFS on them.

      I just want to rename eth6-9 on the pool master to match eth0-3 on the second host.

      I have tried the interface-rename method but I am not getting what I expect. All the examples I have seen are useful for swapping the existing names for another existing name, not for changing the name to one that does not exist in the list already.

      Any guidance would be most helpful.

      D 1 Reply Last reply Reply Quote 0
      • D Offline
        dsiminiuk @dsiminiuk
        last edited by

        For example, rename eth6 to eth0...

        ~# ifconfig eth6 down
        
        ~]# xe pif-list host-uuid=7cbc09aa-6d32-44a9-b6a2-eb5b30c11e1e device=eth6
        uuid ( RO)                  : ab7303f0-accd-7458-2a1f-e03906a85418
                        device ( RO): eth6
            currently-attached ( RO): false
                          VLAN ( RO): -1
                  network-uuid ( RO): 69435d48-6bf5-c76b-9df9-8e276e2b51fc
        
        ~]# xe pif-forget uuid=ab7303f0-accd-7458-2a1f-e03906a85418
        
        ~]# interface-rename --update eth0=3c:a8:2a:15:4a:9c
        INFO     [2025-11-07 09:56:27] Performing manual update of rules.  Not actually renaming interfaces
        INFO     [2025-11-07 09:56:27] All done
        
        ~]# ifconfig eth0 up
        eth0: ERROR while getting interface flags: No such device
        

        I can remove the NICs but if I rescan then they appear as eth6,7,8,9 again.

        D 1 Reply Last reply Reply Quote 0
        • D Offline
          dsiminiuk @dsiminiuk
          last edited by

          And the secret to this was using the script correctly (--rename instead of --update)

          interface-rename --rename eth0=3c:a8:2a:15:4a:9c
          
          Name  MAC                PCI              ethN  Phys  SMBios                         Driver  Version  Firmware                 
          eth0  3c:a8:2a:15:4a:9c  0000:02:00.0[0]  eth0  em1   Embedded LOM 1 Port 1          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
          eth1  3c:a8:2a:15:4a:9d  0000:02:00.1[0]  eth1  em2   Embedded LOM 1 Port 2          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
          eth2  3c:a8:2a:15:4a:9e  0000:02:00.2[0]  eth2  em3   Embedded LOM 1 Port 3          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
          eth3  3c:a8:2a:15:4a:9f  0000:02:00.3[0]  eth3  em4   Embedded LOM 1 Port 4          tg3     3.137    5719-v1.46 NCSI v1.5.12.0
          eth4  38:ea:a7:12:de:14  0000:04:00.0[0]  eth4  em49  Embedded FlexibleLOM 1 Port 1  ixgbe   5.9.4    0x800009e0, 1.3089.0     
          eth5  38:ea:a7:12:de:15  0000:04:00.1[0]  eth5  em50  Embedded FlexibleLOM 1 Port 2  ixgbe   5.9.4    0x800009e0, 1.3089.0 
          

          All done.

          G 1 Reply Last reply Reply Quote 2
          • G Offline
            guiltykeyboard @dsiminiuk
            last edited by

            @dsiminiuk Great! Glad you got it working!

            G 1 Reply Last reply Reply Quote 0
            • G Offline
              guiltykeyboard @guiltykeyboard
              last edited by guiltykeyboard

              @fohdeesha If this was what was the issue for @dsiminiuk , could you check the documentation?

              It states:

              interface-rename --update eth4=00:24:81:80:19:63 eth8=00:24:81:7f:cf:8b
              

              https://docs.xcp-ng.org/networking/#renaming-nics

              Command help states that --update is correct as well.

              c2ef974d-4727-410c-8732-78175b0dd5d2-image.png

              1 Reply Last reply Reply Quote 0
              • olivierlambertO Online
                olivierlambert Vates 🪐 Co-Founder CEO
                last edited by

                Let me ping @Team-Documentation-Knowledge-Management

                G 1 Reply Last reply Reply Quote 0
                • G Offline
                  guiltykeyboard @olivierlambert
                  last edited by

                  @olivierlambert Thanks.

                  --rename isn't mentioned in the KB.

                  If I don't see something in the next week or two, I might be able to test it in a lab and then propose an update via a github fork.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post