Renaming `lxdbr0` to `incusbr0` after migration

The migration with lxd-to-incus was very smooth and quick. It did not rename the default network from lxdbr0 to incusbr0, which is fine (it is just a name, it does not matter).

However I wondered whether it is possible to rename it anyway. The command incus network rename lxdbr0 incusbr0 fails because the network is being used. I tried to edit the default profile, changing lxdbr0 to incusbr0, but it refused to accept this change, because the network incusbr0 does not exist.

So, I did it like this:

  1. Stop all the containers:

    incus stop name1 name2 ...
    
  2. Create an auxiliary temporary network:

    incus network create auxbr0
    
  3. Edit the default profile and change lxdbr0 to auxbr0:

    incus profile edit default
    incus profile show default
    
  4. Rename lxdbr0 to incusbr0:

    incus network rename lxdbr0 incusbr0
    
  5. Edit the default profile again and change auxbr0 to incusbr0:

    incus profile edit default
    incus profile show default
    
  6. Remove the network auxbr0:

    incus network rm auxbr0
    
  7. Start all the containers:

    incus start name1 name2 ...
    

I also have firewalld installed on my server, so it is important to add incusbr0 to the trusted zone of the firewall:

firewall-cmd --permanent --zone=trusted \
    --add-interface=incusbr0
firewall-cmd --permanent --zone=trusted \
    --remove-interface=lxdbr0

firewall-cmd --reload
firewall-cmd --zone=trusted --list-all
2 Likes

My guess is that the name of the default private bridge is not updated to incusbr0, if there are containers running while you perform the migration.

In my case I think I just incus stopped all the instances and then renamed to incusbr0, without requiring to use a temporary name. Did you get an error when you tried to rename directly (while the instances were all stopped)?

Also, once you perform such a task, I think it’s cool to use this address 10.10.10.x.

Yes, because the network is still in the configuration of the containers (through the default profile), even when they are stopped.

Renaming the existing network (instead of creating and using a new one) was done precisely to keep the old configuration of the network unchanged. For example some containers have a fixed IP and there are some port forwarding to these containers. If I changed the address of the network, I would have to change the network configuration of the containers, port forwarding rules, etc.

Yeah, we’re not changing the network name during the migration as we don’t know if you have anything external to Incus interacting with it. Whether it’s the host firewall, some custom sysctls, …

As it’s really just a name, we’re playing it safe and don’t touch it.