Skip to content

ctr run --cni get failed #6604

@ericsong86

Description

@ericsong86

Description

I exec ctr run -d --cni --cpu-quota 20000 docker.io/library/redis:6.0 redis-2 command, this ok. but after I delete redis-2 container, When I want to run the above command I get an error. this is bug?

➜  cni ctr run -d --cni --cpu-quota 20000 docker.io/library/redis:6.0 redis-2
ctr: failed to allocate for range 0: 10.88.0.3 has been allocated to default-redis-2, duplicate allocation is not allowed

You will see a container with CREATED state, may be RUNNING?

➜  cni ctr c ls
CONTAINER    IMAGE                          RUNTIME
redis-2      docker.io/library/redis:6.0    io.containerd.runc.v2
➜  cni ctr t ls
TASK       PID      STATUS
redis-2    17810    CREATED

Steps to reproduce the issue

➜  cni ctr run -d --cni --cpu-quota 20000 docker.io/library/redis:6.0 redis-2
➜  cni ctr t ls
TASK       PID      STATUS
redis-2    17460    RUNNING
redis-1    17313    CREATED
➜  cni ctr t kill redis-2
➜  cni ctr c rm redis-2
➜  cni ctr c ls
CONTAINER    IMAGE    RUNTIME
➜  cni ctr run -d --cni --cpu-quota 20000 docker.io/library/redis:6.0 redis-2
ctr: failed to allocate for range 0: 10.88.0.3 has been allocated to default-redis-2, duplicate allocation is not allowed
➜  cni

Describe the results you received and expected

I think a container will be RUNNING.

What version of containerd are you using?

v1.5.8

Any other relevant information

➜  cni runc -version
runc version 1.0.2
commit: v1.0.2-0-g52b36a2d
spec: 1.0.2-dev
go: go1.16.10
libseccomp: 2.4.3
➜  cni uname -a
Linux localhost 4.15.0-128-generic #131-Ubuntu SMP Wed Dec 9 06:57:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
➜  cni

Show configuration if it is related to CRI plugin.

subreaper = true
oom_score = -999

[debug]
level = "debug"

[metrics]
address = "127.0.0.1:1338"

[proxy_plugins]
[proxy_plugins.customsnapshot]
type = "snapshot"
address = "/var/run/mysnapshotter.sock"

[plugins.linux]
runtime = "runc"
shim_debug = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions