← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1836733] [NEW] seed ISO network changes fails to function

 

Public bug reported:

Ubuntu 19.04 with cloud-init 19

This is a local system while building an Ubuntu VM to eventually port to AWS, so internal systems.
[Eventually meta-data will be provided from the network as they do, but initially the seed.iso is the first layer to begin learning and developing for cloud-init.]

I tried many things for many days and could easily get the meta-data local-hostname to work.
This proves the system was correctly building and reading the cloud-init ISO mounting in VirtualBox as a seed.iso with files meta-data, user-data, and included network-config as the spec says should work.
Obviously the meta-data worked to change the local hostname. The 'user-data' file also worked as I will describe but network-config and the various methods of setting network info in meta-data, etc. failed to make any network changes to the booting system.

The first mystery I sold in this overly complected design in the end led to a hacky solution.
This is how the file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg gets written to netplan's /etc/netplan/50-cloud-init.yaml so that 'netplan apply' can work it's magic.

It would seem the file in /etc/netplan/50-cloud-init.yaml would need to get written to.
In case that is to be overrideen by seed.iso I tried disabling as recommended 99-disable-network-config.cfg in hopes the seed.iso would take over instead but that now seems wrong attempt to understand what is needed. seeting dsmode to 'local' in tyhe meta-data also did nothing (again this is with multiple methods for setting  networking version 2 in either meta-data or the network-config with mac matches, direct references to enp0s3 the network device name etc.

I learned the only and best cloud-init way to get it to actually write
those changes is reflected in the hacky solution I now depend on to be
able to set this via a seed.iso.

Over write the file 50-curtin-networking.cfg then run the cloud-init
commands to clean the logs and restart the init-local service and
ultimately apply the netplan networking changes.

This only works in the user-data file in the seed.iso mounted by
VirtualBox during startup if it already has run cloud-init clean --logs
so it does qualify as first run for these settings.


write_files:
  - path: /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
    permissions: 0644
    owner: root
    content: |
      network:
          ethernets:
              enp0s3:
                  addresses: [192.168.1.11/24]
                  gateway4: 192.168.1.1
                  dhcp4: false
          version: 2

runcmd:
  - echo "Restarting cloud-init Local (networking)"
  - cloud-init clean --logs
  - cloud-init init --local
  - netplan apply


I would expect the seed.iso to over ride all other settings and become
permanent and not need to be told to 'clean' so it should allow you to
change it's IP and other settings at boot (regardless of first-boot), it
is acceptable that the image has been issued a clean before shutdown
prior to subsequent repeated  scaling launches.


Note: it will be important to enable IPv4 and IPv6 addresses for each CPU on the Virtual device.


Anyway instead of going over the days of toil (path of discovery) I can assure many comprehensive attempts where tried before arrive at this only hacky solution.
It needs looking into. I will attempt to explain what was tried and report back to any suggestions of how this is suppose to be done if I misunderstood and so if that's not already documented there is at minimum a problem on that level.

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: network seed.iso

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1836733

Title:
  seed ISO network changes fails to function

Status in cloud-init:
  New

Bug description:
  Ubuntu 19.04 with cloud-init 19

  This is a local system while building an Ubuntu VM to eventually port to AWS, so internal systems.
  [Eventually meta-data will be provided from the network as they do, but initially the seed.iso is the first layer to begin learning and developing for cloud-init.]

  I tried many things for many days and could easily get the meta-data local-hostname to work.
  This proves the system was correctly building and reading the cloud-init ISO mounting in VirtualBox as a seed.iso with files meta-data, user-data, and included network-config as the spec says should work.
  Obviously the meta-data worked to change the local hostname. The 'user-data' file also worked as I will describe but network-config and the various methods of setting network info in meta-data, etc. failed to make any network changes to the booting system.

  The first mystery I sold in this overly complected design in the end led to a hacky solution.
  This is how the file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg gets written to netplan's /etc/netplan/50-cloud-init.yaml so that 'netplan apply' can work it's magic.

  It would seem the file in /etc/netplan/50-cloud-init.yaml would need to get written to.
  In case that is to be overrideen by seed.iso I tried disabling as recommended 99-disable-network-config.cfg in hopes the seed.iso would take over instead but that now seems wrong attempt to understand what is needed. seeting dsmode to 'local' in tyhe meta-data also did nothing (again this is with multiple methods for setting  networking version 2 in either meta-data or the network-config with mac matches, direct references to enp0s3 the network device name etc.

  I learned the only and best cloud-init way to get it to actually write
  those changes is reflected in the hacky solution I now depend on to be
  able to set this via a seed.iso.

  Over write the file 50-curtin-networking.cfg then run the cloud-init
  commands to clean the logs and restart the init-local service and
  ultimately apply the netplan networking changes.

  This only works in the user-data file in the seed.iso mounted by
  VirtualBox during startup if it already has run cloud-init clean
  --logs so it does qualify as first run for these settings.


  write_files:
    - path: /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
      permissions: 0644
      owner: root
      content: |
        network:
            ethernets:
                enp0s3:
                    addresses: [192.168.1.11/24]
                    gateway4: 192.168.1.1
                    dhcp4: false
            version: 2

  runcmd:
    - echo "Restarting cloud-init Local (networking)"
    - cloud-init clean --logs
    - cloud-init init --local
    - netplan apply


  I would expect the seed.iso to over ride all other settings and become
  permanent and not need to be told to 'clean' so it should allow you to
  change it's IP and other settings at boot (regardless of first-boot),
  it is acceptable that the image has been issued a clean before
  shutdown prior to subsequent repeated  scaling launches.

  
  Note: it will be important to enable IPv4 and IPv6 addresses for each CPU on the Virtual device.

  
  Anyway instead of going over the days of toil (path of discovery) I can assure many comprehensive attempts where tried before arrive at this only hacky solution.
  It needs looking into. I will attempt to explain what was tried and report back to any suggestions of how this is suppose to be done if I misunderstood and so if that's not already documented there is at minimum a problem on that level.

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


Follow ups