Amazon linux 2 on-prem in vmware network doesn't configure it self.

0

I want to test amazon linux 2 in our on-premise vmware environment. I was able to deploy the ovf with the seed iso mounted, it did read the files in the iso, as it changed the password of the ec2-user, and applied some other configs. But network config isn't applied.

I added a network-config file also, and it's beeing read, as per the logs, but not applied.

I see this in the could-init.log :

Mar 12 14:08:18 cloud-init[4512]: stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'subnets': [{'netmask': '255.255.255.240', 'address': '192.168.128.6', 'type': 'static', 'dns_nameservers': ['192.168.126.3', '192.168.126.4'], 'gateway': '192.168.128.1', 'dns_search': ['domain.com']}], 'type': 'physical', 'name': 'eth0'}]}
Mar 12 14:08:18 cloud-init[4512]: __init__.py[DEBUG]: no interfaces to rename
Mar 12 14:08:18 cloud-init[4512]: stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 1, 'config': [{'subnets': [{'netmask': '255.255.255.240', 'address': '192.168.128.6', 'type': 'static', 'dns_nameservers': ['192.168.126.3', '192.168.126.4'], 'gateway': '192.168.128.1', 'dns_search': ['domain.com']}], 'type': 'physical', 'name': 'eth0'}]}
Mar 12 14:08:18 cloud-init[4512]: util.py[DEBUG]: Reading from /etc/os-release (quiet=False)
Mar 12 14:08:18 cloud-init[4512]: util.py[DEBUG]: Read 212 bytes from /etc/os-release
Mar 12 14:08:18 cloud-init[4512]: stages.py[ERROR]: Unable to render networking. Network config is likely broken: No available network renderers found. Searched through list: ['eni', 'sysconfig', 'netplan']
Mar 12 14:08:18 cloud-init[4512]: main.py[DEBUG]: [local] Exiting. datasource DataSourceNoCloud [seed=/dev/sr0][dsmode=net] not in local mode.

My meta-data file :

local-hostname: amzlinux-test

network-interfaces: |
  auto eth0
  iface eth0 inet static
  address 192.168.128.6
  network 192.168.128.0
  netmask 255.255.255.240
  broadcast 192.168.128.15
  gateway 192.168.128.1

my network-config file :

version: 1
config:
  - type: physical
    name: eth0
    subnets:
      - type: static
        address: 192.168.128.6
        netmask: 255.255.255.240
        gateway: 192.168.128.1
        dns_nameservers:
          - 192.168.126.3
          - 192.168.126.4
        dns_search:
          - domain.com

I was able to manually configure the network and get into the machine, but still I'd like to be able to seed the config at first boot.

Edited by: rossnick on Mar 12, 2020 8:18 AM

Edited by: rossnick on Mar 12, 2020 8:19 AM

  • Has there been any updates yet?

asked 4 years ago1154 views
6 Answers
0

This used to work for me fine, but is broken now using the
https://cdn.amazonlinux.com/os-images/2.0.20200304.0/hyperv/amzn2-hyperv-2.0.20200304.0-x86_64.xfs.gpt.vhdx.zip

image. Seems like a regression somewhere. Just following the instructions here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

results in a network interface that is not configured and tries to use dhcp. I get the same error messages in /var/log/messages.

Edited by: wynnw on Mar 16, 2020 11:39 AM

Edited by: wynnw on Mar 16, 2020 12:07 PM

wynnw
answered 4 years ago
0

Thanks, that was the instructions I followed. The meta-data is followed, at least a little bit, since the hostname is set, and the user-data also, since the password is set for the ec2-user.
Let's hope it'll resolve in a future release

answered 4 years ago
0

I was having the same problem with amzn2-vmware_esx-2.0.20200722.0-x86_64.xfs.gpt.ova, but when I used the same seed iso with amzn2-vmware_esx-2.0.20190612-x86_64.xfs.gpt.ova it worked perfectly.

Failed attempt with 20200722
cloud-init.log:Sep 04 21:45:03 cloud-init[6391]: stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 1, 'config': [{'subnets': [{'control': 'auto', 'dns_nameservers': ['10.2.5.21', '9.9.9.9'], '_orig_eni_name': 'eth0', 'broadcast': '10.2.5.255', 'netmask': '255.255.255.0', 'address': '10.2.5.77', 'type': 'static', 'gateway': '10.2.5.21'}], 'type': 'physical', 'name': 'eth0'}]}
cloud-init.log:Sep 04 21:45:03 cloud-init[6391]: stages.py[ERROR]: Unable to render networking. Network config is likely broken: No available network renderers found. Searched through list: ['eni', 'sysconfig', 'netplan']

Successful attempt with 20190612
cloud-init.log:Sep 04 21:55:04 cloud-init[6405]: stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 1, 'config': [{'subnets': [{'control': 'auto', 'dns_nameservers': ['10.2.5.21', '9.9.9.9'], '_orig_eni_name': 'eth0', 'broadcast': '10.2.5.255', 'netmask': '255.255.255.0', 'address': '10.2.5.77', 'type': 'static', 'gateway': '10.2.5.21'}], 'type': 'physical', 'name': 'eth0'}]}
cloud-init.log:Sep 04 21:55:04 cloud-init[6405]: util.py[DEBUG]: Writing to /etc/sysconfig/network-scripts/ifcfg-eth0 - wb: [644] 249 bytes

answered 4 years ago
0

What's mentioned here is a real issue in cloud-init, see below for a possible fix.
https://forums.aws.amazon.com/thread.jspa?threadID=330409&tstart=0

answered 4 years ago
0

This is sadly still broken with the latest 2.0.20210126.0 release.

The documentation in the README.cloud-init is broken, as is the document here:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

The linked reply with a diff to fix cloud-init does look like it would work, but there's no way to patch this at boot time that I can see. I'm really stuck trying to figure out how to work around this, and I'm still stuck loading a two year old image and then upgrading it. Really frustrating - I've tried all sorts of yaml config variants for the seed.iso with no luck.

wynnw
answered 3 years ago
0

And finally it's fixed in 2.0.20210721.2.

Make sure to use dns_nameservers and dns_search, not dns-nameservers/dns-search.

wynnw
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions