mtu gets lost in translation from netplan (v2) yaml
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cloud-init |
Fix Released
|
Undecided
|
Unassigned | ||
| cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
MTU values get lost in translation when input is netplan (v2 yaml).
I'm attaching a recreate script, but basically the mtu setting gets lost when writing ENI or sysconfig if the input is v2 yaml.
input of:
version: 2
vlans:
bond0.1000:
addresses: ["192.6.1.9/24"]
id: 1000
link: bond0
mtu: 1496
bond0.1001:
id: 1001
link: bond0
bonds:
bond0:
interfaces: ["enp0s0", "enp0s1"]
parameters: {}
mtu: 1496
Renders output files like etc/sysconfig/
# Created by cloud-init on instance boot automatically, do not edit.
#
BONDING_
BONDING_
BONDING_
BOOTPROTO=none
DEVICE=bond0
NM_CONTROLLED=no
ONBOOT=yes
STARTMODE=auto
TYPE=Bond
USERCTL=no
Where the same config from v1 would have the 'MTU=1496'
ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: cloud-init 19.1-1-
ProcVersionSign
Uname: Linux 4.15.0-54-generic x86_64
ApportVersion: 2.20.11-0ubuntu5
Architecture: amd64
CloudName: LXD
Date: Wed Jul 17 18:37:04 2019
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
user_data.txt:
#cloud-config
{}
Related branches
- Ryan Harper: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 123 lines (+95/-0) 2 files modifiedapicloudinit/net/network_state.py (+4/-0)
tests/unittests/test_net.py (+91/-0)
- NonfreeKernelModules.txt Edit (1.9 KiB, text/plain; charset="utf-8")
- Dependencies.txt Edit (5.6 KiB, text/plain; charset="utf-8")
- ProcCpuinfoMinimal.txt Edit (1.3 KiB, text/plain; charset="utf-8")
- cloud-init-output.log.txt.txt Edit (5.6 KiB, text/plain; charset="utf-8")
- logs.tgz.gz Edit (52.9 KiB, application/x-gzip)
- lshw.txt.txt Edit (20.4 KiB, text/plain; charset="utf-8")
- recreate script Edit (1.0 KiB, text/x-sh)
output of recreate:
$ sh /tmp/recreate.sh
Read input format 'yaml' from 'bond-mtu-v1.yaml'.
Wrote output format 'sysconfig' to 'centos/
Read input format 'yaml' from 'bond-mtu-v2.yaml'.
Wrote output format 'sysconfig' to 'centos/
--- centos/sysconfig ----
diff -Naur centos/
--- centos/
+++ centos/
@@ -5,7 +5,6 @@
BONDING_
BOOTPROTO=none
DEVICE=bond0
-MTU=1496
NM_CONTROLLED=no
ONBOOT=yes
STARTMODE=auto
diff -Naur centos/
--- centos/
+++ centos/
@@ -3,7 +3,6 @@
BOOTPROTO=none
DEVICE=bond0.1000
IPADDR=192.6.1.9
-MTU=1496
NETMASK=
NM_CONTROLLED=no
ONBOOT=yes
Read input format 'yaml' from 'bond-mtu-v1.yaml'.
Wrote output format 'eni' to 'ubuntu/
Read input format 'yaml' from 'bond-mtu-v2.yaml'.
Wrote output format 'eni' to 'ubuntu/
--- ubuntu/eni ----
diff -Naur ubuntu/
--- ubuntu/
+++ ubuntu/
@@ -9,7 +9,6 @@
auto bond0
iface bond0 inet manual
bond-slaves none
- mtu 1496
auto enp0s0
iface enp0s0 inet manual
@@ -22,7 +21,6 @@
auto bond0.1000
iface bond0.1000 inet static
address 192.6.1.9/24
- mtu 1496
vlan-
vlan_id 1000
Read input format 'yaml' from 'bond-mtu-v1.yaml'.
Wrote output format 'netplan' to 'ubuntu/
Read input format 'yaml' from 'bond-mtu-v2.yaml'.
Wrote output format 'netplan' to 'ubuntu/
--- ubuntu/netplan ----
diff -Naur ubuntu/
--- ubuntu/
+++ ubuntu/
@@ -4,15 +4,14 @@
# /etc/cloud/
# network: {config: disabled}
network:
- version: 2
bonds:
bond0:
- enp0s0
- enp0s1
mtu: 1496
- enp0s0: {}
- enp0s1: {}
+ parameters: {}
+ version: 2
vlans:
This bug is fixed with commit 5498107d to cloud-init on branch master.
To view that commit see the following URL:
https:/
This bug was fixed in the package cloud-init - 19.2-5-
---------------
cloud-init (19.2-5-
* New upstream snapshot.
- net/cmdline: split interfaces_by_mac and init network config
determination
- stages: allow data sources to override network config source order
- cloud_tests: updates and fixes
- Fix bug rendering MTU on bond or vlan when input was netplan.
[Scott Moser] (LP: #1836949)
- net: update net sequence, include wait on netdevs, opensuse netrules
path (LP: #1817368)
-- Chad Smith <email address hidden> 2019年8月06日 13:56:18 -0600
This bug is believed to be fixed in cloud-init in version 19.2-2. If this is still a problem for you, please make a comment and set the state back to New
Thank you.
Tracked in Github Issues as https:/