Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-30906

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

XMLWordPrintable

    • High

      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:

            tnisan@redhat.com Tal Nisan
            rhn-support-nashok Nijin Ashok
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: