I didn’t first think the MAC addresses are a problem but don’t know because it doesn’t seem to change when I don’t use the refresh mode. I got from your previous reply a thought that the issue is with the MAC network - but the containers are configured to use the default private lxdbr0 on both hosts.
I try to repeat the “problem” with another container from my source:
lxc config show web2
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20210415)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: “20210415”
image.type: squashfs
image.version: “18.04”
volatile.apply_template: copy
volatile.base_image: cc14c502ccc1fe07f322649d9610fb240ed95866db72605afa33010cadfe9c22
volatile.eth0.hwaddr: 00:16:3e:e7:f7:20
volatile.idmap.base: “0”
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.power: STOPPED
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: “”
lxc network show lxdbr0
config:
ipv4.address: 10.240.195.1/24
ipv4.nat: “true”
ipv6.address: fd42:12c6:7039:90f0::1/64
ipv6.nat: “true”
description: “”
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/web1
- /1.0/instances/web2
- /1.0/profiles/default
- /1.0/profiles/haprofile
managed: true
status: Created
locations:
- none
lxc start web2
lxc info web2
Name: web2
Status: RUNNING
Type: container
Architecture: x86_64
PID: 16098
Created: 2021/05/06 08:13 UTC
Last Used: 2021/08/17 17:54 UTC
Resources:
Processes: 24
Disk usage:
root: 989.07MiB
CPU usage:
CPU usage (in seconds): 10
Memory usage:
Memory (current): 102.95MiB
Memory (peak): 159.90MiB
Network usage:
eth0:
Type: broadcast
State: UP
Host interface: veth044515d1
MAC address: 00:16:3e:e7:f7:20
MTU: 1500
Bytes received: 900.62kB
Bytes sent: 44.22kB
Packets received: 717
Packets sent: 601
IP addresses:
inet: 10.240.195.188/24 (global)
inet6: fd42:12c6:7039:90f0:216:3eff:fee7:f720/64 (global)
inet6: fe80::216:3eff:fee7:f720/64 (link)
lo:
Type: loopback
State: UP
MTU: 65536
Bytes received: 1.46kB
Bytes sent: 1.46kB
Packets received: 16
Packets sent: 16
IP addresses:
inet: 127.0.0.1/8 (local)
inet6: ::1/128 (local)
lxc stop web2
lxc copy web2 server2:web2 --verbose --mode=push
lxc config show server2:web2
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20210415)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: “20210415”
image.type: squashfs
image.version: “18.04”
volatile.apply_template: copy
volatile.base_image: cc14c502ccc1fe07f322649d9610fb240ed95866db72605afa33010cadfe9c22
volatile.eth0.hwaddr: 00:16:3e:70:17:3d
volatile.idmap.base: “0”
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: “”
lxc network show server2:lxdbr0
config:
ipv4.address: 10.94.250.1/24
ipv4.nat: “true”
ipv6.address: fd42:3bd5:1f49:ee2e::1/64
ipv6.nat: “true”
description: “”
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/haproxy
- /1.0/instances/web1
- /1.0/instances/web2
- /1.0/profiles/default
- /1.0/profiles/haprofile
managed: true
status: Created
locations:
- none
lxc start server2:web2
lxc exec server2:haproxy – bash
root@haproxy:~# ping web2.lxd
PING web2.lxd(web2.lxd (fd42:3bd5:1f49:ee2e:216:3eff:fe70:173d)) 56 data bytes
64 bytes from web2.lxd (fd42:3bd5:1f49:ee2e:216:3eff:fe70:173d): icmp_seq=1 ttl=64 time=0.117 ms
64 bytes from web2.lxd (fd42:3bd5:1f49:ee2e:216:3eff:fe70:173d): icmp_seq=2 ttl=64 time=0.079 ms
^C
— web2.lxd ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.079/0.098/0.117/0.019 ms
This is what we do now clearly works but let’s try again the same lxc copy in refresh mode:
exit
exit
lxc stop server2:web2
lxc start web2
lxc stop web2
lxc copy web2 server2web2 --verbose --refresh --mode=push
lxc config show server2:web2
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20210415)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: “20210415”
image.type: squashfs
image.version: “18.04”
volatile.base_image: cc14c502ccc1fe07f322649d9610fb240ed95866db72605afa33010cadfe9c22
volatile.eth0.hwaddr: 00:16:3e:e7:f7:20
volatile.idmap.base: “0”
volatile.idmap.current: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.uuid: 8ed67416-02c2-4ce0-b2c8-23e40ece7f8d
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: “”
lxc network show server2:lxdbr0
config:
ipv4.address: 10.94.250.1/24
ipv4.nat: “true”
ipv6.address: fd42:3bd5:1f49:ee2e::1/64
ipv6.nat: “true”
description: “”
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/haproxy
- /1.0/instances/web1
- /1.0/instances/web2
- /1.0/profiles/default
- /1.0/profiles/haprofile
managed: true
status: Created
locations:
- none
lxc start server2:web2
lxc exec server2:haproxy – bash
root@haproxy:~# ping web2.lxd
PING web2.lxd (10.94.250.225) 56(84) bytes of data.
From haproxy.lxd (10.94.250.219) icmp_seq=1 Destination Host Unreachable
From haproxy.lxd (10.94.250.219) icmp_seq=2 Destination Host Unreachable
From haproxy.lxd (10.94.250.219) icmp_seq=3 Destination Host Unreachable
^C
— web2.lxd ping statistics —
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4079ms
pipe 4
root@haproxy:~#
I did not check the ipv4 address for server2:web2 after the first time run (after copying first without refresh mode)
lxc info server2:web2
Name: web2
Status: RUNNING
Type: container
Architecture: x86_64
PID: 1620536
Created: 2021/08/17 18:12 UTC
Last Used: 2021/08/17 18:35 UTC
Resources:
Processes: 24
Disk usage:
root: 914.71MiB
CPU usage:
CPU usage (in seconds): 4
Memory usage:
Memory (current): 130.04MiB
Memory (peak): 176.66MiB
Network usage:
eth0:
Type: broadcast
State: UP
Host interface: vethfc0beeb0
MAC address: 00:16:3e:e7:f7:20
MTU: 1500
Bytes received: 1.77kB
Bytes sent: 2.12kB
Packets received: 17
Packets sent: 20
IP addresses:
inet: 10.94.250.188/24 (global)
inet6: fd42:3bd5:1f49:ee2e:216:3eff:fee7:f720/64 (global)
inet6: fe80::216:3eff:fee7:f720/64 (link)
lo:
Type: loopback
State: UP
MTU: 65536
Bytes received: 276B
Bytes sent: 276B
Packets received: 4
Packets sent: 4
IP addresses:
inet: 127.0.0.1/8 (local)
inet6: ::1/128 (local)
One more detail from the server2:haproxy it is running now all the time, and it is configured with the server2:haprofile to use static ipv4.address. (forwarding from a host device haproxy related incoming http traffic):
lxc profile show server2:default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: lxd-pool
type: disk
name: default
used_by:
- /1.0/instances/haproxy
- /1.0/instances/web1
- /1.0/instances/web2
lxc profile show server2:haprofile
config: {}
description: Bridged networking LXD profile
devices:
eth0:
ipv4.address: 10.94.250.219
nictype: bridged
parent: lxdbr0
type: nic
name: haprofile
used_by: