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.
    • JoeyDee518J Offline
      JoeyDee518 @Forza
      last edited by JoeyDee518

      @s-pam said in Rename Networks on XO Hosts:

      @olivierlambert said in Rename Networks on XO Hosts:

      If you use a pool, it's for sharing a network and/or a storage.

      If you don't want to share a network across PIFs between hosts, then don't use a pool 🙂

      I get it. Though I would prefer not having to buy another server when I can run a VM. And in fact it works fine, just naming networks is a little odd at the moment.

      What I would like to see is that networks can be connected to different physical nics on different hosts.

      I.e. something like this:

      Network Management:
      Host 1: eth0
      Host 2: eth1
      Host 3: eth0
      Host 4: eth4

      Network Someother:
      Host 1: eth1
      Host 2: n/a
      Host 3: eth1
      Host 4: eth1

      Network Another:
      Host 1: eth2
      Host 2: eth2
      Host 3: eth2
      Host 4: eth2

      Then in the VM you can assign the "Network" as normal. If the VM is migrated to another host, then XCP-ng would choose the correct PIF/NIC. This can be an advantage where one or several hosts have extra NICs, maybe with higher speeds. But during migration (rolling upgrades, service, or whatnot), the VMs still work but with reduced performance when moved to another host.

      Another example would be if we have a spare host off-site/another building where the network layout cannot be fully replicated as in the datacenter.

      eda84dcd-ba54-419f-83a1-3b37bc62ae94-image.png

      Did you ever find a solution to this? I'm literally trying to do the same thing because I have hosts with uneven numbers of NICs...

      ForzaF 1 Reply Last reply Reply Quote 0
      • ForzaF Online
        Forza @JoeyDee518
        last edited by

        @joeydee518 no.

        JoeyDee518J 1 Reply Last reply Reply Quote 0
        • JoeyDee518J Offline
          JoeyDee518 @Forza
          last edited by

          @s-pam Yikes, thanks for the reply!

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

            Any idea @fohdeesha ?

            fohdeeshaF 1 Reply Last reply Reply Quote 0
            • fohdeeshaF Offline
              fohdeesha Vates 🪐 Pro Support Team @olivierlambert
              last edited by

              @olivierlambert like I said in my previous reply I believe this would take quite a bit of rewriting in XAPI to accommodate pools with mismatched hardware. The interface rename tool might work in the meantime? https://xcp-ng.org/docs/networking.html#renaming-nics

              1 Reply Last reply Reply Quote 0
              • ben20benB Offline
                ben20ben
                last edited by

                I came across this and the solution I upvoted i.e. renaming in pool view, works for me. However, I would like to +1 the idea @Forza put in his post. Cause organizing it all can get quite confusing. XOA being the excellent tool that it is, has this lacking.

                For those who come across this and feel discouraged? Do please mention your needs to the team here! They are VERY good at putting these kinds of things on the roadmap if there is a need/want for it!

                For myself, I use a spreadsheet to keep track of networks, hosts and pools. I do not rely on XOA alone. Which tbh is probably best practice anyway, in case a backup fails or the world blows up.

                👽

                1 Reply Last reply Reply Quote 0
                • 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