cloud-init Error performing rename network interface

Asked by Ancheng Liu on 2021-04-07

I'm deploying charm openstack with Maas+juju.

When ran command
    juju deploy ./config/bundle.yaml

I got error of cloud-init which saying snippet content as below
```
2021-04-02 01:34:09,772 - stages.py[WARNING]: Failed to rename devices: [unknown] Error performing rename('ens3f0', 'enp216s0f0') for 40:a6:b7:18:c1:10, enp216s0f0: Unexpected error while running command.
Command: ['ip', 'link', 'set', 'ens3f0', 'name', 'enp216s0f0']
Exit code: 2
Reason: -
Stdout:
Stderr: RTNETLINK answers: File exists
[unknown] Error performing rename('ens3f1', 'enp216s0f1') for 40:a6:b7:18:c1:11, enp216s0f1: Unexpected error while running command.
Command: ['ip', 'link', 'set', 'ens3f1', 'name', 'enp216s0f1']
Exit code: 2
Reason: -
Stdout:
Stderr: RTNETLINK answers: File exists
[unknown] Error performing rename('ens2f0', 'enp94s0f0') for 40:a6:b7:19:9d:40, enp94s0f0: Unexpected error while running command.
Command: ['ip', 'link', 'set', 'ens2f0', 'name', 'enp94s0f0']
Exit code: 2
Reason: -
Stdout:
Stderr: RTNETLINK answers: File exists
[unknown] Error performing rename('ens2f1', 'enp94s0f1') for 40:a6:b7:19:9d:41, enp94s0f1: Unexpected error while running command.
Command: ['ip', 'link', 'set', 'ens2f1', 'name', 'enp94s0f1']
Exit code: 2
Reason: -
Stdout:
Stderr: RTNETLINK answers: File exists
```

failed to change network interface with *altname* identifier like
```
$ sudo ip a
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 34:48:ed:f3:df:74 brd ff:ff:ff:ff:ff:ff
    altname enp24s0f0
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 34:48:ed:f3:df:75 brd ff:ff:ff:ff:ff:ff
    altname enp24s0f1
4: ens2f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 52:54:45:22:6e:73 brd ff:ff:ff:ff:ff:ff
    altname enp94s0f0
5: ens2f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc mq state DOWN group default qlen 1000
    link/ether 40:a6:b7:19:9e:d1 brd ff:ff:ff:ff:ff:ff
    altname enp94s0f1
6: eno3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bondm state UP group default qlen 1000
    link/ether 52:54:45:38:88:3e brd ff:ff:ff:ff:ff:ff
    altname enp25s0f0
7: ens3f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 52:54:45:22:6e:73 brd ff:ff:ff:ff:ff:ff
    altname enp216s0f0
8: eno4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bondm state UP group default qlen 1000
    link/ether 52:54:45:38:88:3e brd ff:ff:ff:ff:ff:ff
    altname enp25s0f1
9: ens3f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc mq state DOWN group default qlen 1000
    link/ether 40:a6:b7:19:9e:f1 brd ff:ff:ff:ff:ff:ff
    altname enp216s0f1
```
Is this a cloud-init bug??
How to fix this issue??

OS version: 20.04.2

cloud-init version: 20.4.1-0ubuntu1~20.04.1

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2021-04-07
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask Ancheng Liu for more information if necessary.

To post a message you must log in.