canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization

Home Page:https://cloud-init.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cloud-init schema --system warnings in Hetzner cloud datasource vendor-data

blackboxsw opened this issue · comments

Bug report

cloud-init v 24.1 raises warnings in logs based on invalid schema keys in vendor-data

$ cloud-init schema --system
...
2. vendor-data at /var/lib/cloud/instances/45734314/vendor-cloud-config.txt:
  Invalid vendor-data /var/lib/cloud/instances/45734314/vendor-cloud-config.txt
  Error: Cloud config schema errors: system_info: Additional properties are not allowed ('system_info' was unexpected)

When looking at vendor-data.txt we see this snippet

system_info:
    default_user:
        lock_passwd: true
        name: root
        shell: /bin/bash

The correct way to provide system_info changes would be via a file in /etc/cloud/cloud.cfg.d instead of in vendor-data. It seems hetzner also does this as well as Hetzner images already provide this same config, and more, in /etc/cloud/cloud.cfg.d/90-hetznercloud.cfg

$ grep -A 8 system_info /etc/cloud/cloud.cfg.d/90-hetznercloud.cfg 
system_info:
   # This will affect which distro class gets used
   distro: ubuntu
   # Default user name + that default users groups (if added/used)
   default_user:
     name: root
     lock_passwd: True
     shell: /bin/bash
   network:
```

To avoid this warning, vendor-data provided by Hetzner should remove the `system_info` key from that particular config dictionary under gttp://169.254.169.254/hetzner/v1/metadata under it's `vendor_data` key.


## Environment details
- Cloud-init version: 24.1
- Operating System Distribution: Ubuntu and others 
- Cloud provider, platform or installer type: Hetzner

Is there something for cloud-init to change here?

This seems to be the same issue that was discussed in the IRC channel yesterday.

I don't think that there is anything for cloud-init to change here. If Hetzner has a bug tracker, we should file it there. Closing.