canonical / cloud-init

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

cloud-init fails with "Unknown network_data link type: dvs" #2836

Closed ubuntu-server-builder closed 1 year ago

ubuntu-server-builder commented 1 year ago

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

Launchpad details
affected_projects = ['cloud-init (Ubuntu)', 'cloud-init (Ubuntu Xenial)', 'cloud-init (Ubuntu Yakkety)']
assignee = None
assignee_name = None
date_closed = 2017-09-23T02:30:19.930377+00:00
date_created = 2017-03-22T10:24:12.052320+00:00
date_fix_committed = 2017-04-03T14:41:47.638436+00:00
date_fix_released = 2017-09-23T02:30:19.930377+00:00
id = 1674946
importance = wishlist
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1674946
milestone = None
owner = rgerganov
owner_name = Radoslav Gerganov
private = False
status = fix_released
submitter = rgerganov
submitter_name = Radoslav Gerganov
tags = ['verification-done-xenial', 'verification-done-yakkety']
duplicates = [1677846]

Launchpad user Radoslav Gerganov(rgerganov) wrote on 2017-03-22T10:24:12.052320+00:00

=== Begin SRU Template === [Impact] When a config drive provides network_data.json on Openstack running on ESXi cloud-init will fail to configure networking.

Console log and /var/log/cloud-init.log will show: ValueError: Unknown network_data link type: hyperv

This woudl also occur when the type of the network device as declared to cloud-init was 'hw_veb', 'hyperv', or 'vhostuser'.

[Test Case] Launch an instance with config drive on hyperv cloud.

[Regression Potential] Low to none. cloud-init is relaxing requirements and will accept things now that it previously complained were invalid.

This is very similar to change in bug 1642679. Upstream Openstack Merge proposal to stop this from continually happening at https://review.openstack.org/#/c/400883/ === End SRU Template ===

When booting an OpenStack instance, cloud-init fails with:

[ 33.307325] cloud-init[445]: Cloud-init v. 0.7.9 running 'init-local' at Mon, 20 Mar 2017 14:42:58 +0000. Up 31.06 seconds. [ 33.368434] cloud-init[445]: 2017-03-20 14:43:00,779 - util.py[WARNING]: failed stage init-local [ 33.449886] cloud-init[445]: failed run of stage init-local

[ 33.542214] cloud-init[445]: Traceback (most recent call last): [ 33.585204] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 513, in status_wrapper [ 33.654579] cloud-init[445]: ret = functor(name, args) [ 33.696372] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 269, in main_init [ 33.755593] cloud-init[445]: init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL)) [ 33.809124] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 622, in apply_network_config [ 33.847161] cloud-init[445]: netcfg, src = self._find_networking_config() [ 33.876562] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 609, in _find_networking_config [ 33.916335] cloud-init[445]: if self.datasource and hasattr(self.datasource, 'network_config'): [ 33.956207] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceConfigDrive.py", line 147, in network_config [ 34.008213] cloud-init[445]: self.network_json, known_macs=self.known_macs) [ 34.049714] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/sources/helpers/openstack.py", line 627, in convert_net_json [ 34.104226] cloud-init[445]: 'Unknown network_data link type: %s' % link['type']) [ 34.144219] cloud-init[445]: ValueError: Unknown network_data link type: dvs

I am using Neutron with the Simple DVS plugin.

Related bugs:   bug 1674946: cloud-init fails with "Unknown network_data link type: dvs   bug 1642679: OpenStack network_config.json implementation fails on Hyper-V compute nodes

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-03-29T19:57:08.978663+00:00

I've marked nova as an 'affects'. This is really nova's bug. I've submitted a merge proposal to stop this behavior from continuing at

https://review.openstack.org/#/c/400883/2

ubuntu-server-builder commented 1 year ago

Launchpad user Lars Kellogg-Stedman(larsks) wrote on 2017-03-31T20:51:16.869174+00:00

The nova changes seem like a good idea.

In order for cloud-init to work with existing openstack deployments, does it make sense to modify sources/helpers/openstack.py to simply default to 'phy' rather than raising a ValueError for unknown link types?

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-04-03T14:02:29.604062+00:00

Lars, yes. I'd considered that, but as it is cloud-init is raising a ValueError saying "I dont know what this type is". And then basically not going on. If we change it to assume 'phy', then it will silently leave that block of code and fail somewhere else less obvious when it tries to configure this unknown link type as if it were a 'phy'.

I'll throw up a merge proposal for the DVS type and if you can ack that i'll merge it. Also, thank you for the ACK on the openstack.

ubuntu-server-builder commented 1 year ago

Launchpad user Alain Swanson(alain-swanson) wrote on 2017-04-03T14:37:36+00:00

Scott,

Would you be willing to consider adding the “dvs” type to the list of physical types in openstack.py? This is the change I made and it appears to have fixed the issue. It will also allow us to more quickly get a fix via an official channel (download newer version of cloud-init) rather than waiting for our OpenStack vendor to provide a new release of their distribution (which would take some time).

Best regards,

Alain Swanson | Lead Engineer, Cloud Networking & Security | Private Cloud Enablement 1801 Park View Drive | Shoreview, MN 55126 | 612/760-5889 | alain.swanson@wellsfargo.commailto:alain.swanson@wellsfargo.com

On Apr 3, 2017, at 9:02 AM, Scott Moser smoser@ubuntu.com<mailto:smoser@ubuntu.com> wrote:

Lars, yes. I'd considered that, but as it is cloud-init is raising a ValueError saying "I dont know what this type is". And then basically not going on. If we change it to assume 'phy', then it will silently leave that block of code and fail somewhere else less obvious when it tries to configure this unknown link type as if it were a 'phy'.

I'll throw up a merge proposal for the DVS type and if you can ack that i'll merge it. Also, thank you for the ACK on the openstack.

-- You received this bug notification because you are subscribed to a duplicate bug report (1677846). https://bugs.launchpad.net/bugs/1674946

Title: cloud-init fails with "Unknown network_data link type: dvs"

Status in cloud-init: Incomplete Status in OpenStack Compute (nova): New

Bug description: When booting an OpenStack instance, cloud-init fails with:

[ 33.307325] cloud-init[445]: Cloud-init v. 0.7.9 running 'init-local' at Mon, 20 Mar 2017 14:42:58 +0000. Up 31.06 seconds. [ 33.368434] cloud-init[445]: 2017-03-20 14:43:00,779 - util.py[WARNING]: failed stage init-local [ 33.449886] cloud-init[445]: failed run of stage init-local

[ 33.542214] cloud-init[445]: Traceback (most recent call last): [ 33.585204] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 513, in status_wrapper [ 33.654579] cloud-init[445]: ret = functor(name, args) [ 33.696372] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 269, in main_init [ 33.755593] cloud-init[445]: init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL)) [ 33.809124] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 622, in apply_network_config [ 33.847161] cloud-init[445]: netcfg, src = self._find_networking_config() [ 33.876562] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 609, in _find_networking_config [ 33.916335] cloud-init[445]: if self.datasource and hasattr(self.datasource, 'network_config'): [ 33.956207] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceConfigDrive.py", line 147, in network_config [ 34.008213] cloud-init[445]: self.network_json, known_macs=self.known_macs) [ 34.049714] cloud-init[445]: File "/usr/lib/python3/dist-packages/cloudinit/sources/helpers/openstack.py", line 627, in convert_net_json [ 34.104226] cloud-init[445]: 'Unknown network_data link type: %s' % link['type']) [ 34.144219] cloud-init[445]: ValueError: Unknown network_data link type: dvs

I am using Neutron with the Simple DVS plugin.

Related bugs:

To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1674946/+subscriptions

ubuntu-server-builder commented 1 year ago

Launchpad user Chris J Arges(arges) wrote on 2017-04-05T12:55:44.397985+00:00

Is this fixed in Zesty?

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-04-06T05:45:13.539076+00:00

This bug was fixed in the package cloud-init - 0.7.9-90-g61eb03fe-0ubuntu1


cloud-init (0.7.9-90-g61eb03fe-0ubuntu1) zesty; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-04-06T14:24:05.544212+00:00

I've dropped the nova task. This will be fixed in nova hopefully under bug 1642679. My merge proposal is at https://review.openstack.org/#/c/400883

ubuntu-server-builder commented 1 year ago

Launchpad user Brian Murray(brian-murray) wrote on 2017-04-10T22:26:01.158535+00:00

Hello Radoslav, or anyone else affected,

Accepted cloud-init into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-90-g61eb03fe-0ubuntu1~16.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Brian Murray(brian-murray) wrote on 2017-04-10T22:48:10.644061+00:00

Hello Radoslav, or anyone else affected,

Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Ashish Kumar Gupta(ashish-kumar-gupta) wrote on 2017-04-13T08:28:46.154589+00:00

After upgrading the cloud-init I have verified in my setup with xenial image . Now i don't see " cloud-init[445]: ValueError: Unknown network_data link type: dvs" Error in the VM. user@xenial-vm2:~$ dpkg -l | grep cloud-init ii cloud-init 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 all Init

Thanks for the fix.

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-13T20:46:34.066852+00:00

Also verified it with xenial and a config-drive that had "type": "dvs" in openstack/latest/network_data.json using the proposed package:

root@x1-fixed:~# apt-cache policy cloud-init cloud-init: Installed: 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 Candidate: 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 Version table: *** 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 500 500 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages

$ lxc file pull x1-fixed/run/cloud-init/result.json { "v1": { "datasource": "DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]", "errors": [] } }

To make sure my config-drive was being used, I injected a failure by setting an unknown link type of "dvs-andreas-was-here-again": $ lxc file pull x1-fixed/run/cloud-init/result.json - { "v1": { "datasource": null, "errors": [ "Unknown network_data link type: dvs-andreas-was-here-again", "Unknown network_data link type: dvs-andreas-was-here-again" ] } }

and

$ lxc exec x1-fixed -- grep dvs-andreas-was-here-again /var/log/cloud-init.log ValueError: Unknown network_data link type: dvs-andreas-was-here-again

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-13T21:27:05.797294+00:00

Using the package from yakkety-proposed in a yakkety LXD container:

$ lxc exec y1-proposed -- /bin/bash root@y1-proposed:~# apt-cache policy cloud-init cloud-init: Installed: 0.7.9-90-g61eb03fe-0ubuntu1~16.10.1 Candidate: 0.7.9-90-g61eb03fe-0ubuntu1~16.10.1 Version table: *** 0.7.9-90-g61eb03fe-0ubuntu1~16.10.1 500 500 http://archive.ubuntu.com/ubuntu yakkety-proposed/main amd64 Packages

/config-drive with a link of type "dvs": $ lxc exec y1-proposed -- grep dvs /config-drive/openstack/latest/network_data.json "type": "dvs",

No errors: $ lxc file pull y1-proposed/run/cloud-init/result.json - { "v1": { "datasource": "DataSourceConfigDrive [net,ver=2][source=/config-drive]", "errors": [] } }

logs clean too: $ lxc exec y1-proposed -- grep dvs /var/log/cloud-init.log $

To make sure my config-drive was being used, I injected a failure by setting an unknown link type of "dvs-andreas-was-here-again": $ lxc file pull y1-proposed/run/cloud-init/result.json - { "v1": { "datasource": null, "errors": [ "Unknown network_data link type: dvs-andreas-was-here-again", "Unknown network_data link type: dvs-andreas-was-here-again", "('ssh-authkey-fingerprints', KeyError('getpwnam(): name not found: ubuntu',))" ] } }

(the ssh authkey error is irrelevant for this case: the ubuntu user isn't created because of the network_data link type error)

and

$ lxc exec y1-proposed -- grep dvs-andreas-was-here-again /var/log/cloud-init.log ValueError: Unknown network_data link type: dvs-andreas-was-here-again ValueError: Unknown network_data link type: dvs-andreas-was-here-again

ubuntu-server-builder commented 1 year ago

Launchpad user Ashish Kumar Gupta(ashish-kumar-gupta) wrote on 2017-04-15T04:16:10.808257+00:00

Using the clout-init : root@user:/var/lib/cloud# dpkg -l | grep cloud-init ii cloud-init 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1 all Init scripts for cloud instances Rebooting the ubuntu server cloud-init fails to start .

Error in the cloud-init.log 2017-04-14 20:49:56,838 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False) 2017-04-14 20:49:56,838 - util.py[DEBUG]: Read 10 bytes from /proc/uptime 2017-04-14 20:49:56,838 - util.py[DEBUG]: cloud-init mode 'init' took 0.065 seconds (0.06) 2017-04-14 20:49:56,838 - handlers.py[DEBUG]: finish: init-network: SUCCESS: searching for network datasources 2017-04-14 21:03:09,735 - util.py[DEBUG]: Cloud-init v. 0.7.9 running 'init-local' at Sat, 15 Apr 2017 04:03:09 +0000. Up 801.41 seconds. 2017-04-14 21:03:09,735 - main.py[DEBUG]: No kernel command line url found. 2017-04-14 21:03:09,735 - main.py[DEBUG]: Closing stdin. 2017-04-14 21:03:09,737 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [420] 0 bytes 2017-04-14 21:03:09,738 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 104:4 2017-04-14 21:03:09,739 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance/boot-finished 2017-04-14 21:03:09,739 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/data/no-net 2017-04-14 21:03:09,739 - handlers.py[DEBUG]: start: init-local/check-cache: attempting to read from cache [check] 2017-04-14 21:03:09,739 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False) 2017-04-14 21:03:09,739 - stages.py[DEBUG]: no cache found 2017-04-14 21:03:09,739 - handlers.py[DEBUG]: finish: init-local/check-cache: SUCCESS: no cache found 2017-04-14 21:03:09,739 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance 2017-04-14 21:03:09,739 - util.py[WARNING]: failed stage init-local 2017-04-14 21:03:09,740 - util.py[DEBUG]: failed stage init-local Traceback (most recent call last): File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 647, in status_wrapper ret = functor(name, args) File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 332, in main_init init.fetch(existing=existing) File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 349, in fetch return self._get_data_source(existing=existing) File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 250, in _get_data_source util.del_file(self.paths.instance_link) File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1627, in del_file raise e File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1624, in del_file os.unlink(path) IsADirectoryError: [Errno 21] Is a directory: '/var/lib/cloud/instance'

root@user:/var/lib/cloud# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial

What went wrong and how to fix this ?

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-20T16:40:01.696814+00:00

I'll try rebooting a xenial node that has the updated cloud-init package and see what happens.

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-20T17:02:00.634324+00:00

@ashish-kumar-gupta can you please attach your /var/log/cloud-init*.log from this attempt?

Also please the output of: sudo ls -lah /var/lib/cloud/instance/ /var/lib/cloud/data/ /run/cloud-init/

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-20T17:42:41.680551+00:00

@ashish-kumar-gupta you seem to be hitting this bug: https://launchpad.net/bugs/1531880

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-04-20T19:08:12.173079+00:00

I'm adding back the 'verification-done-xenial'. the broken state of having a /var/lib/cloud/instance as a directory (rather than a symlink) is not a result of any changes for this bug. bug 1531880 covers that, and we will pursue a fix there.

ubuntu-server-builder commented 1 year ago

Launchpad user Andreas Hasenack(ahasenack) wrote on 2017-04-20T19:28:44.402488+00:00

For the record, I did reboot a maas node that had the config-drive network configuration to use "dvs" and it didn't fail.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-04-20T19:33:34.017361+00:00

This bug was fixed in the package cloud-init - 0.7.9-90-g61eb03fe-0ubuntu1~16.10.1


cloud-init (0.7.9-90-g61eb03fe-0ubuntu1~16.10.1) yakkety; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Steve Langasek(vorlon) wrote on 2017-04-20T19:35:09.421451+00:00

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-04-20T19:35:54.384643+00:00

This bug was fixed in the package cloud-init - 0.7.9-90-g61eb03fe-0ubuntu1~16.04.1


cloud-init (0.7.9-90-g61eb03fe-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:30:22.255222+00:00

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.