canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
3.03k stars 890 forks source link

nocloud-net datasource attempts to read seed url before network is set up #4021

Open ubuntu-server-builder opened 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1990149

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2022-09-19T13:49:19.518010+00:00
date_fix_committed = None
date_fix_released = None
id = 1990149
importance = high
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1990149
milestone = None
owner = ogerlich
owner_name = Oliver Gerlich
private = False
status = triaged
submitter = ogerlich
submitter_name = Oliver Gerlich
tags = []
duplicates = [1990585]

Launchpad user Oliver Gerlich(ogerlich) wrote on 2022-09-19T13:49:19.518010+00:00

I'm using the nocloud-net data source with Ubuntu 22.04 server (ubuntu-22.04.1-live-server-amd64.iso). Apparently the data source attempts to download the meta-data file from the supplied "seedfrom" URL regardless of whether the network configuration has actually finished.

In my particular use case it takes about ten seconds until the network interface is configured (maybe the DHCP server is a bit slow). Meanwhile, the nocloud-net data source will do ten retries to download the meta-data URL (with 1 second delay between retries). So there is a race; and as result the auto-installation will only work in a few cases.

I'm booting the auto-install system with a kernel command line ending like "ds=nocloud-net\;s=http://192.168.1.2:8095/\;local-hostname=somehost". I'll try to save and transfer the cloud-init.log file next time this happens.

ubuntu-server-builder commented 1 year ago

Launchpad user Chad Smith(chad.smith) wrote on 2022-09-22T03:32:39.667999+00:00

it would be nice to somehow support datasource config options in NoCloud for: max_wait, retries and timeout like other datasources ec2/gce/openstack/cloudstack do