canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 931 forks source link

Container got no ipv4! #10335

Closed vampireacen closed 2 years ago

vampireacen commented 2 years ago

Required information

Issue description

My container got no ipv4,after I reboot it. And I can not use ssh to connect my container port. HELP!!! lxc_pro

Information to attach

Resources: Processes: 124 Disk usage: root: 449.00GiB CPU usage: CPU usage (in seconds): 7 Memory usage: Memory (current): 314.24MiB Memory (peak): 315.55MiB Network usage: eth0: Type: broadcast State: DOWN Host interface: veth97584cad MAC address: 00:16:3e:e4:31:a8 MTU: 1450 Bytes received: 698B Bytes sent: 1.35kB Packets received: 2 Packets sent: 10 IP addresses: lo: Type: loopback State: UP MTU: 65536 Bytes received: 1.58kB Bytes sent: 1.58kB Packets received: 10 Packets sent: 10 IP addresses: inet: 127.0.0.1/8 (local) inet6: ::1/128 (local) docker0: Type: broadcast State: UP MAC address: 02:42:11:62:d3:75 MTU: 1500 Bytes received: 0B Bytes sent: 0B Packets received: 0 Packets sent: 0 IP addresses: inet: 172.17.0.1/16 (global)

Log:

lxc chenfeng 20220428021220.281 WARN conf - conf.c:lxc_map_ids:3592 - newuidmap binary is missing lxc chenfeng 20220428021220.282 WARN conf - conf.c:lxc_map_ids:3598 - newgidmap binary is missing lxc chenfeng 20220428021220.283 WARN conf - conf.c:lxc_map_ids:3592 - newuidmap binary is missing lxc chenfeng 20220428021220.283 WARN conf - conf.c:lxc_map_ids:3598 - newgidmap binary is missing lxc chenfeng 20220428021220.285 WARN cgfsng - cgroups/cgfsng.c:fchowmodat:1252 - No such file or directory - Failed to fchownat(40, memory.oom.group, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW ) lxc chenfeng 20220428021902.566 WARN conf - conf.c:lxc_map_ids:3592 - newuidmap binary is missing lxc chenfeng 20220428021902.566 WARN conf - conf.c:lxc_map_ids:3598 - newgidmap binary is missing

 - [ ] Container configuration (`lxc config show NAME --expanded`)
 ```bash
root@iic-worker-203-gpu:~# lxc config show chenfeng --expanded
architecture: x86_64
config:
  image.architecture: amd64
  image.description: Ubuntu focal amd64 (20210606_07:42)
  image.name: ubuntu-focal-amd64-default-20210606_07:42
  image.os: ubuntu
  image.release: focal
  image.serial: "20210606_07:42"
  image.variant: default
  volatile.base_image: 2b97dfd0c6e5cb8243f67860a75fbdeab3acccde05cd6782cabe65f2c79e6ef4
  volatile.eth0.host_name: veth97584cad
  volatile.eth0.hwaddr: 00:16:3e:e4:31:a8
  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.last_state.power: RUNNING
  volatile.uuid: 3d6c1c00-0292-459b-a623-ed3f8d56748e
devices:
  eth0:
    name: eth0
    network: lxdfan0
    type: nic
  gpu:
    type: gpu
  proxy0:
    bind: host
    connect: tcp:240.203.0.107:22
    listen: tcp:10.102.32.203:60029
    type: proxy
  root:
    path: /
    pool: pool1
    size: 1024GB
    type: disk
ephemeral: false
profiles:
- default1T
stateful: false
tomponline commented 2 years ago

Please can you post support queries over at https://discuss.linuxcontainers.org/

I see you are also running docker, if you are running docker on the host it is likely a firewall issue see https://discuss.linuxcontainers.org/t/lxd-and-docker-firewall-redux-how-to-deal-with-forward-policy-set-to-drop/9953/3?u=tomp

vampireacen commented 2 years ago

One of my previous containers also encountered this situation, but I did not install docker in that container, so I guess it should not be a problem with docker.

tomponline commented 2 years ago

Ok please post on the forum and we can discuss there as is likely to be environmental rather than a bug.

vampireacen commented 2 years ago

I have already posted in the forum with the same topic:Container got no ipv4!