Bug 2222677 - cloud-init network configuration is failing with error "Unknown network config version: 1"
Summary: cloud-init network configuration is failing with error "Unknown network confi...
Keywords:
Status: CLOSED DUPLICATE of bug 2213073
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.13.2
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: Tal Nisan
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-13 12:46 UTC by nijin ashok
Modified: 2023-07-17 07:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-17 07:24:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-30906 0 None None None 2023-07-13 12:49:48 UTC

Description nijin ashok 2023-07-13 12:46:22 UTC
Description of problem:

While using the OpenShift console to configure the network using cloud-init (Add network data in scripts),  cloud-init network configuration is failing with the error below:

~~~
2023-07-13 12:26:57,206 - util.py[DEBUG]: failed stage init-local
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 767, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 433, in main_init
    init.apply_network_config(bring_up=bring_up_interfaces)
  File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 926, in apply_network_config
    self.distro.networking.wait_for_physdevs(netcfg)
  File "/usr/lib/python3.6/site-packages/cloudinit/distros/networking.py", line 142, in wait_for_physdevs
    physdevs = self.extract_physdevs(netcfg)
  File "/usr/lib/python3.6/site-packages/cloudinit/distros/networking.py", line 46, in extract_physdevs
    return net.extract_physdevs(netcfg)
  File "/usr/lib/python3.6/site-packages/cloudinit/net/__init__.py", line 660, in extract_physdevs
    raise RuntimeError("Unknown network config version: %s" % version)
RuntimeError: Unknown network config version: 1
~~~

The issue looks to be because it is passing the version as a string:

~~~
 oc get vm centos-stream8-qmcxprlgjecesuj4 -o yaml|yq '.spec.template.spec.volumes[1]'
cloudInitNoCloud:
  networkData: |
    network:
      version: '1'           <===
      config:
        - type: physical
          name: eth0
          subnets:
            - type: static
              address:
                - 192.168.0.1
              gateway: 192.168.0.10
~~~

And cloud-init is expecting an integer https://github.com/canonical/cloud-init/blob/e2adc9725d204486e02d3098e2a95dc63ee4af7a/cloudinit/net/__init__.py#L623.

Editing the VM yaml and changing it to version : 1 fixes the problem.



Version-Release number of selected component (if applicable):

OpenShift Virtualization   4.13.2

How reproducible:

100 %

Steps to Reproduce:

Try to configure the network using `Add network data` from OpenShift console. Check the cloud-init logs in the VM.

Actual results:

cloud-init network configuration is failing with error "Unknown network config version: 1"

Expected results:

Configuring network should work.

Additional info:

Comment 1 Guohua Ouyang 2023-07-17 07:24:04 UTC

*** This bug has been marked as a duplicate of bug 2213073 ***


Note You need to log in before you can comment on or make changes to this bug.