canonical / canonical/cloud-init

`cloud-init devel net-convert' broken on SLES, no route is written, missing ifroute-X file

Open
#5,635 2 comments 0 reactions 0 assignees View on GitHub
incomplete
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report

`cloud-init devel net-convert` is broken on SLES, no route is written, missing ifroute-X file

## Steps to reproduce the problem

Have metadata file and try to convert it to SLES sysconfig, see below.

## Environment details
- Cloud-init version: cloud-init-23.3-150100.8.82.3.x86_64
- Operating System Distribution: SLES 15 SP5
- Cloud provider, platform or installer type: esxi/vmware

## details

```shell
$ cat ~/metadata.yaml
instance-id: cloud-vm
local-hostname: cloud-vm
network:
version: 2
ethernets:
eth0:
match:
macaddress: '00:0c:29:21:f1:61'
dhcp4: false
addresses:
- 172.16.171.139/24
nameservers:
addresses: [172.16.171.254]
routes:
- to: 0.0.0.0/0
via: 172.16.171.254

$ cloud-init devel net-convert \
-m eth0,00:0c:29:21:f1:61 \
--network-data ~/metadata.yaml \
--kind yaml \
--output-kind sysconfig \
-D sles -d ./
Read input format 'yaml' from '/root/metadata.yaml'.
Wrote output format 'sysconfig' to './'

$ find ./etc/
./etc/
./etc/resolv.conf
./etc/NetworkManager
./etc/NetworkManager/conf.d
./etc/NetworkManager/conf.d/99-cloud-init.conf
./etc/udev
./etc/udev/rules.d
./etc/udev/rules.d/85-persistent-net-cloud-init.rules
./etc/sysconfig
./etc/sysconfig/network
./etc/sysconfig/network/ifcfg-eth0

$ cat ./etc/sysconfig/network/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=static
IPADDR=172.16.171.139
LLADDR=00:0c:29:21:f1:61
NETMASK=255.255.255.0
STARTMODE=auto
```

However, cloud-init itself seems to work fine:

``` shell
$ grep -H '' /etc/sysconfig/network/*eth0*
/etc/sysconfig/network/ifcfg-eth0:# Created by cloud-init on instance boot automatically, do not edit.
/etc/sysconfig/network/ifcfg-eth0:#
/etc/sysconfig/network/ifcfg-eth0:BOOTPROTO=static
/etc/sysconfig/network/ifcfg-eth0:IPADDR=172.16.171.139
/etc/sysconfig/network/ifcfg-eth0:LLADDR=00:0c:29:21:f1:61
/etc/sysconfig/network/ifcfg-eth0:NETMASK=255.255.255.0
/etc/sysconfig/network/ifcfg-eth0:STARTMODE=auto
/etc/sysconfig/network/ifroute-eth0:0.0.0.0/0 172.16.171.254 - -

$ ip r s
default via 172.16.171.254 dev eth0
172.16.171.0/24 dev eth0 proto kernel scope link src 172.16.171.139

$ cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
nameserver 172.16.171.254
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.