New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigDrive: cloud-init fails to configure network from network_data.json #2666
Comments
Launchpad user Mathieu Gagné(mgagne) wrote on 2016-05-03T23:26:49.816769+00:00 Launchpad attachments: cloud-init configs, logs and configdrive |
Launchpad user Michal Adamczyk(vanditboy) wrote on 2016-05-18T08:41:46.701806+00:00 Hi, My cloud platform is OpenStack Mitaka on RDO (CentOS 7.2) with XEN hypervisor and config_drive option. On my guest system is CentOS 6.7. Cloud-init agent can pickup meta_data.json (as I can login via ssh when bring up the network manually) but it cannot setup network: Starting cloud-init: Cloud-init v. 0.7.5 running 'init-local' at Wed, 18 May 2016 08:19:18 +0000. Up 22.67 seconds. cloud-init configuration file (beside original) /etc/cloud/cloud.cfg.d/10_file.cfg: datasource_list: [ ConfigDrive, None ]
Config drive content: /media/ec2/2009-04-04/meta-data.json Here is the network_data.json content: host:root:/media> cat openstack/latest/network_data.json | python -m json.tool My cloud-init version: Installed Packages Anyone has this issue? |
Launchpad user Dan Watkins(oddbloke) wrote on 2016-05-18T09:43:19.639792+00:00 Hi Michal, Consumption of network_data.json was introduced in trunk at some point before revision 1212; you'll need to update to use a more recent version of cloud-init to get it working. Thanks, Dan |
Launchpad user Scott Moser(smoser) wrote on 2016-06-03T03:19:06.308702+00:00 Hi, anyone listening I'd like test of my ppa at https://launchpad.net/~smoser/+archive/ubuntu/cloud-init-dev . You should be able to test by:
If this does not work for you, please attach the config drive that was used for me to look at (you can just 'dd if=/dev/sr0 | gzip -c > my.iso.gz' And if you see any WARN in logs, please attach them. |
Launchpad user Scott Moser(smoser) wrote on 2016-06-10T16:44:50.151050+00:00 This was fixed in yakkety at 0.7.7~bzr1227-0ubuntu1 . It will be sru'd sometime soon. |
Launchpad user Scott Moser(smoser) wrote on 2016-06-10T16:45:44.327649+00:00 This was fixed in trunk at revno 1225 |
Launchpad user Scott Moser(smoser) wrote on 2016-07-26T16:43:20.469949+00:00 Hi, So anything newer than 0.7.7 |
Launchpad user long(long-cheung) wrote on 2016-08-08T06:03:56.374651+00:00 Hello scott, i using cloud-init Nocloud have same problem, |
Launchpad user Scott Moser(smoser) wrote on 2016-08-10T14:42:26.650812+00:00 This is fixed in cloud-init 0.7.7 |
Launchpad user long(long-cheung) wrote on 2016-08-11T02:17:23.962832+00:00 Dear scott, Thank for your reply, |
Launchpad user long(long-cheung) wrote on 2016-08-11T08:12:29.288944+00:00 Dear scott, Follow is my meta-data and user-date,i using nocloud instance-id: 1470899540 #cloud-config packages:
package_upgrade: true runcmd:
vim: syntax=yaml listThen i run the cloud-init,Hostname and password can setup,But network is fail. i check in obj.pkl ip format is wrong, Launchpad attachments: obj.pkl |
Launchpad user Scott Moser(smoser) wrote on 2016-08-11T12:30:37.473660+00:00 Hi Long, This bug specifically handled 'config-drive' (the openstack disk format rather than 'NoCloud'). I have reproduced your issue. |
Launchpad user Scott Moser(smoser) wrote on 2016-08-11T12:43:01.733569+00:00 Hi Long, |
Launchpad user long(long-cheung) wrote on 2016-08-11T14:16:49+00:00 Dear Scott, I update some comment in bugs, Can you please help, Thank for your help. Long -----Original Message----- Hi Long, -- Title: Status in cloud-init: Bug description: When instance boots, network is configured fine until next reboot The /etc/network/interfaces.d/50-cloud-init.cfg file has the following
When debugging, if this line in stages.py [1] is commented, we can see I also found that within self._find_networking_config(), it looks like Manually forcing "net" dsmode makes cloud-init configure At that point, I'm not sure what's going on and how I can debug Notes:
[1] http://bazaar.launchpad.net/~cloud-init-dev/cloud- To manage notifications about this bug go to: |
Launchpad user Peter(pry) wrote on 2016-11-22T14:08:08.374310+00:00 Hello, Scott! Looks like the problem that Long stated in the post #8 persists and it wasn't fixed in 0.7.7. I perform cloud image configuration using the 'network-interfaces' key in meta-data file. First boot goes smooth, I detach the iso file and reboot and the VM falls back to DHCP. I already have net.ifnames=0 in my kernel parameters. I'm using version 0.7.8 and it doesn't seem to be fixed there. P.S. You've opened the bug in #13, but it looks like it's a different bug so i decided to write here. I'll open a separate bug if it is needed. Some info: $ cloud-init -v $ cat /proc/cmdline Running Ubuntu 16.10 x86_64 |
Launchpad user Deepa(dpaclt) wrote on 2017-06-14T13:41:23.192498+00:00 I do have the same issue . #cloud-init -v Distributor ID: Ubuntu |
Launchpad user Marc Siegrist(dev-marc) wrote on 2017-08-17T11:13:54.589381+00:00 This still affects me with cloud-init version 0.7.9 and Ubuntu 16.04.03 Lts. |
Launchpad user David Britton(dpb) wrote on 2017-09-01T04:40:07.652525+00:00 Hi Marc, Deepa, Peter -- It's probably best to open a new bug on this. If you wouldn't mind doing so with a clear reproduction in the form of "what happened, what I expected, observations made" that would be very helpful! Thanks. |
This bug was originally filed in Launchpad as LP: #1577982
Launchpad details
Launchpad user Mathieu Gagné(mgagne) wrote on 2016-05-03T23:26:49.816769+00:00
When running Ubuntu 16.04 on OpenStack, cloud-init fails to properly configure the network from network_data.json found in ConfigDrive.
When instance boots, network is configured fine until next reboot where it falls back to dhcp.
The /etc/network/interfaces.d/50-cloud-init.cfg file has the following content when instance is initially booted, this could explain why dhcp is used on second boot:
When debugging, if this line in stages.py [1] is commented, we can see that cloud-init initially copy the /etc/network/interfaces file found in the configdrive (the network template injected by Nova) and isn't using the network config found in network_data.json. But later it falls back to "dhcp" and rewrites yet again the network config.
I also found that within self._find_networking_config(), it looks like no datasource is found at this point. This could be because cloud-init is still in "local" dsmode and then refuses to use the network config found in the ConfigDrive. (triggering the "dhcp" fallback logic)
Manually forcing "net" dsmode makes cloud-init configure /etc/network/interfaces.d/50-cloud-init.cfg properly with network config found in the ConfigDrive. However no gateway is configured and so, instance doesn't respond to ping or SSH.
At that point, I'm not sure what's going on and how I can debug further.
Notes:
[1] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/stages.py#L604
The text was updated successfully, but these errors were encountered: