Release of cloud-init 22.2

Cloud-init release 22.2 is now available

The 22.2 release:

  • spanned about 3 months
  • had 28 contributors from 31 domains

Highlights:

  • Add native NetworkManager support
  • Various schema improvements:
    • Implemented userdata schema definitions for all modules
    • moved cloud-init devel schema command to cloud-init schema
  • Add LXD tutorial
  • Shave ~8ms off generator runtime
  • Allow growpart to resize encrypted partitions
  • Add support for dual stack IPv6/IPv4 IMDS to Ec2
  • Drop vestigial support for upstart

== Changelog ==

  • Fix test due to caplog incompatibility (#1461) [Alberto Contreras]
  • Align rhel custom files with upstream (#1431)
    [Emanuele Giuseppe Esposito]
  • cc_write_files: Improve schema. (#1460) [Alberto Contreras]
  • cli: Redact files with permission errors in commands (#1440)
    [Alberto Contreras] (LP: #1953430)
  • Improve cc_set_passwords. (#1456) [Alberto Contreras]
  • testing: make fake cloud-init wait actually wait (#1459)
  • Scaleway: Fix network configuration for netplan 0.102 and later (#1455)
    [Maxime Corbin]
  • Fix ‘ephmeral’ typos in disk names(#1452) [Mike Hucka]
  • schema: version schema-cloud-config-v1.json (#1424)
  • cc_modules: set default meta frequency value when no config available
    (#1457)
  • Log generic warning on non-systemd systems. (#1450) [Alberto Contreras]
  • cc_snap.maybe_install_squashfuse no longer needed in Bionic++. (#1448)
    [Alberto Contreras]
  • Drop support of *-sk keys in cc_ssh (#1451) [Alberto Contreras]
  • testing: Fix console_log tests (#1437)
  • tests: cc_set_passoword update for systemd, non-systemd distros (#1449)
  • Fix bug in url_helper/dual_stack() logging (#1426)
  • schema: render schema paths from _CustomSafeLoaderWithMarks (#1391)
    (GH: SC-929)
  • testing: Make integration tests kinetic friendly (#1441)
  • Handle error if SSH service no present. (#1422)
    [Alberto Contreras] (GH: #1969526)
  • Fix network-manager activator availability and order (#1438)
  • sources/azure: remove reprovisioning marker (#1414) [Chris Patterson]
  • upstart: drop vestigial support for upstart (#1421)
  • testing: Ensure NoCloud detected in test (#1439)
  • Update .github-cla-signers kallioli [Kevin Allioli]
  • Consistently strip top-level network key (#1417) (GH: #1906187)
  • testing: Fix LXD VM metadata test (#1430)
  • testing: Add NoCloud setup for NoCloud test (#1425)
  • Update linters and adapt code for compatibility (#1434) [Paride Legovini]
  • run-container: add support for LXD VMs (#1428) [Paride Legovini]
  • integration-reqs: bump pycloudlib pinned commit (#1427) [Paride Legovini]
  • Fix NoCloud docs (#1423)
  • Docs fixes (#1406)
  • docs: Add docs for module creation (#1415)
  • Remove cheetah from templater (#1416)
  • tests: verify_ordered_items fallback to re.escape if needed (#1420)
  • Misc module cleanup (#1418)
  • docs: Fix doc warnings and enable errors (#1419)
    [Alberto Contreras] (GH: #1876341)
  • Refactor cloudinit.sources.NetworkConfigSource to enum (#1413)
    [Alberto Contreras] (GH: #1874875)
  • Don’t fail if IB and Ethernet devices ‘collide’ (#1411)
  • Use cc_* module meta defintion over hardcoded vars (SC-888) (#1385)
  • Fix cc_rsyslog.py initialization (#1404) [Alberto Contreras]
  • Promote cloud-init schema from devel to top level subcommand (#1402)
  • mypy: disable missing imports warning for httpretty (#1412)
    [Chris Patterson]
  • users: error when home should not be created AND ssh keys provided
    [Jeffrey ‘jf’ Lim]
  • Allow growpart to resize encrypted partitions (#1316)
  • Fix typo in integration_test.rst (#1405) [Alberto Contreras]
  • cloudinit.net refactor: apply_network_config_names (#1388)
    [Alberto Contreras] (GH: #1884602)
  • tests/azure: add fixtures for hardcoded paths (markers and data_dir)
    (#1399) [Chris Patterson]
  • testing: Add responses workaround for focal/impish (#1403)
  • cc_ssh_import_id: fix is_key_in_nested_dict to avoid early False
  • Fix ds-identify not detecting NoCloud seed in config (#1381)
    (GH: #1876375)
  • sources/azure: retry dhcp for failed processes (#1401) [Chris Patterson]
  • Move notes about refactorization out of CONTRIBUTING.rst (#1389)
  • Shave ~8ms off generator runtime (#1387)
  • Fix provisioning dhcp timeout to 20 minutes (#1394) [Chris Patterson]
  • schema: module example strict testing fix seed_random
  • cc_set_hostname: examples small typo (perserve vs preserve)
    [Wouter Schoot]
  • sources/azure: refactor http_with_retries to remove **kwargs (#1392)
    [Chris Patterson]
  • declare dependency on ssh-import-id (#1334)
  • drop references to old dependencies and old centos script
  • sources/azure: only wait for primary nic to be attached during restore
    (#1378) [Anh Vo]
  • cc_ntp: migrated legacy schema to cloud-init-schema.json (#1384)
    (GH: SC-803)
  • Network functions refactor and bugfixes (#1383)
  • schema: add JSON defs for modules cc_users_groups (#1379)
    (GH: SC-928, SC-846, SC-897, #1858930)
  • Fix doc typo (#1382) [Alberto Contreras]
  • Add support for dual stack IPv6/IPv4 IMDS to Ec2 (#1160)
  • Fix KeyError when rendering sysconfig IPv6 routes (#1380) (GH: #1958506)
  • Return a namedtuple from subp() (#1376)
  • Mypy stubs and other tox maintenance (SC-920) (#1374)
  • Distro Compatibility Fixes (#1375)
  • Pull in Gentoo patches (#1372)
  • schema: add json defs for modules U-Z (#1360)
    (GH: #1858928, #1858929, #1858931, #1858932)
  • util: atomically update sym links to avoid Suppress FileNotFoundError
    when reading status (#1298) [Adam Collard] (GH: LP:1962150)
  • schema: add json defs for modules scripts-timezone (SC-801) (#1365)
  • docs: Add first tutorial (SC-900) (#1368)
  • BUG 1473527: module ssh-authkey-fingerprints fails Input/output error…
    (#1340) [Andrew Lee] (GH: #1473527)
  • add arch hosts template (#1371)
  • ds-identify: detect LXD for VMs launched from host with > 5.10 kernel
    (#1370) (GH: #1968085)
  • Support EC2 tags in instance metadata (#1309) [Eduardo Dobay]
  • schema: add json defs for modules e-install (SC-651) (#1366)
  • Improve “(no_create_home|system): true” test (#1367) [Jeffrey ‘jf’ Lim]
  • Expose https_proxy env variable to ssh-import-id cmd (#1333)
    [Michael Rommel]
  • sources/azure: remove bind/unbind logic for hot attached nic (#1332)
    [Chris Patterson]
  • tox: add types-* packages to check_format env (#1362)
  • tests: python 3.10 is showing up in cloudimages (#1364)
  • testing: add additional mocks to test_net tests (#1356) [yangzz-97]
  • schema: add JSON schema for mcollective, migrator and mounts modules
    (#1358)
  • Honor system locale for RHEL (#1355) [Wei Shi]
  • doc: Fix typo in cloud-config-run-cmds.txt example (#1359) [Ali Shirvani]
  • ds-identify: also discover LXD by presence from DMI board_name = LXD
    (#1311)
  • black: bump pinned version to 22.3.0 to avoid click dependency issues
    (#1357)
  • Various doc fixes (#1330)
  • testing: Add missing is_FreeBSD mock to networking test (#1353)
  • Add --no-update to add-apt-repostory call (SC-880) (#1337)
  • schema: add json defs for modules K-L (#1321)
    (GH: #1858899, #1858900, #1858901, #1858902)
  • docs: Re-order readthedocs install (#1354)
  • Stop cc_ssh_authkey_fingerprints from ALWAYS creating home (#1343)
    [Jeffrey ‘jf’ Lim]
  • docs: add jinja2 pin (#1352)
  • Vultr: Use find_candidate_nics, use ipv6 dns (#1344) [eb3095]
  • sources/azure: move get_ip_from_lease_value out of shim (#1324)
    [Chris Patterson]
  • Fix cloud-init status --wait when no datasource found (#1349)
    (GH: #1966085)
  • schema: add JSON defs for modules resize-salt (SC-654) (#1341)
  • Add myself as a future contributor (#1345) [Neal Gompa (ニール・ゴンパ)]
  • Update .github-cla-signers (#1342) [Jeffrey ‘jf’ Lim]
  • add Requires=cloud-init-hotplugd.socket in cloud-init-hotplugd.service
    file (#1335) [yangzz-97]
  • Fix sysconfig render when set-name is missing (#1327)
    [Andrew Kutz] (GH: #1855945)
  • Refactoring helper funcs out of NetworkState (#1336) [Andrew Kutz]
  • url_helper: add tuple support for readurl timeout (#1328)
    [Chris Patterson]
  • Make fs labels match for ds-identify and docs (#1329)
  • Work around bug in LXD VM detection (#1325)
  • Remove redundant generator logs (#1318)
  • tox: set verbose flags for integration tests (#1323) [Chris Patterson]
  • net: introduce find_candidate_nics() (#1313) [Chris Patterson]
  • Revert “Ensure system_cfg read before ds net config on Oracle (#1174)”
    (#1326)
  • Add vendor_data2 support for ConfigDrive source (#1307) [cvstealth]
  • Make VMWare data source test host independent and expand testing (#1308)
    [Robert Schweikert]
  • Add json schemas for modules starting with P
  • sources/azure: remove lease file parsing (#1302) [Chris Patterson]
  • remove flaky test from ci (#1322)
  • ci: Switch to python 3.10 in Travis CI (#1320)
  • Better interface handling for Vultr, expect unexpected DHCP servers
    (#1297) [eb3095]
  • Remove unused init local artifact (#1315)
  • Doc cleanups (#1317)
  • docs improvements (#1312)
  • add support for jinja do statements, add unit test (#1314)
    [Paul Bruno] (GH: #1962759)
  • sources/azure: prevent tight loops for DHCP retries (#1285)
    [Chris Patterson]
  • net/dhcp: surface type of DHCP lease failure to caller (#1276)
    [Chris Patterson]
  • Stop hardcoding systemctl location (#1278) [Robert Schweikert]
  • Remove python2 syntax from docs (#1310)
  • [tools/migrate-lp-user-to-github] Rename master branch to main (#1301)
    [Adam Collard]
  • redhat: Depend on “hostname” package (#1288) [Lubomir Rintel]
  • Add native NetworkManager support (#1224) [Lubomir Rintel]
  • Fix link in CLA check to point to contribution guide. (#1299)
    [Adam Collard]
  • check for existing symlink while force creating symlink (#1281)
    [Shreenidhi Shedi]
  • Do not silently ignore integer uid (#1280) (GH: #1875772)
  • tests: create a IPv4/IPv6 VPC in Ec2 integration tests (#1291)
  • Integration test fix ppa (#1296)
  • tests: on official EC2. cloud-id actually startswith aws not ec2 (#1289)
  • test_ppa_source: accept both http and https URLs (#1292)
    [Paride Legovini]
  • Fix apt test on azure
  • add “lkundrak” as contributor [Lubomir Rintel]
  • Holmanb/integration test fix ppa (#1287)
  • Include missing subcommand in manpage (#1279)
  • Clean up artifacts from pytest, packaging, release with make clean
    (#1277)
  • sources/azure: ensure retries on IMDS request failure (#1271)
    [Chris Patterson]
  • sources/azure: removed unused savable PPS paths (#1268) [Chris Patterson]
  • integration tests: fix Azure failures (#1269)
1 Like

hello,

Sorry for asking here in this forum, but I did not find any forums discussing the problem I met with.

I have downloaded and installed Ubuntu 18.04.6 Server

batman@bat-image:~$ lsb_release -r
Release:	18.04
batman@bat-image:~$ 

The problem is, I have got error message when I check the “cloud-init schema --system”, and I think this somehow related to the failure of VM deployment in Openstack, when I use the Ubuntu 18.04.6 image as base.

Could you please help me how to fixed this?

I would like to highlight, below described problem does not in Ubuntu 20.X, but for other reasons, I cannot use newer Ubuntu than 18.04.6.

Below please find some details.

batman@bat-image:~$ sudo cloud-init schema --system
Error:
Cloud config schema errors: users.0: {'gecos': 'batman', 'groups': {'sudo', 'dip', 'lxd', 'cdrom', 'adm', 'plugdev'}, 'lock_passwd': False, 'name': 'batman', 'passwd': '$6$fh5h17OAjISEUjmk$djgw1CD0KzK16hEmEZbkNUhHAYD10NMcS0NkTsYgsoobwCGmneYvjLH8LrO8XEry59jJ7l4TYlB1PF6QaMWqu/', 'shell': '/bin/bash'} is not valid under any of the given schemas
batman@bat-image:~$  

The version of cloud-init:

batman@bat-image:~$ cloud-init -v
/usr/bin/cloud-init 22.2-0ubuntu1~18.04.3
batman@bat-image:~$

The users defined in the /etc/cloud/cloud.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: ubuntu
     lock_passwd: True
     gecos: Ubuntu
     groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]
     sudo: ["ALL=(ALL) NOPASSWD:ALL"]
     shell: /bin/bash

Thanks for your help,
/Robi

Hi Robi,

Thanks for reaching out. FYI typically we hold conversations and discuss bugs on Launchpad, IRC, and the mailing list.

I reconstructed what I think the user-data might look like from the warning message:

#cloud-config
users:
  - name: batman
    gecos: batman
    shell: /bin/bash
    groups: [sudo, dip, lxd, cdrom, adm, plugdev]
    lock_passwd: False
    passwd: $6$fh5h17OAjISEUjmk$djgw1CD0KzK16hEmEZbkNUhHAYD10NMcS0NkTsYgsoobwCGmneYvjLH8LrO8XEry59jJ7l4TYlB1PF6QaMWqu/

Does that look right to you?

And I confirmed that this produces an error on the 22.2.2 tag:

arc~/cloud-init(:905d10891|…) PYTHONPATH=. python3 -m cloudinit.cmd.main schema -c ../user-data.yaml           
Error:
Cloud config schema errors: users.0: {'name': 'batman', 'gecos': 'batman', 'shell': '/bin/bash', 'groups': ['sudo', 'dip', 'lxd', 'cdrom', 'adm', 'plugdev'], 'lock_passwd': False, 'passwd': '$6$fh5h17OAjISEUjmk$djgw1CD0KzK16hEmEZbkNUhHAYD10NMcS0NkTsYgsoobwCGmneYvjLH8LrO8XEry59jJ7l4TYlB1PF6QaMWqu/'} is not valid under any of the given schemas

and from the tip of main this is fixed:

arc~/cloud-init(main|…) PYTHONPATH=. python3 -m cloudinit.cmd.main schema -c ../user-data.yaml
Valid cloud-config: ../user-data.yaml

I think this was already fixed. We’re working on releasing 22.3.3 currently, which should contain the fix. If you want to test it out locally, you can either grab a copy of the repo from Github and run the test I just did, or you could test with the latest package in the -proposed repo (not recommended for production use, yet).

If more questions or that doesn’t work, please run sudo cloud-init collect-logs and open a bug on Launchpad.

Hopefully that helps :slight_smile:

hello Holmanb,

First of all, thanks for your quick reply. I promise, next time I will use your suggested way to report bugs or push questions.

I have checked once the “users” in my /etc/cloud/cloud.cfg file which looks looks this:

batman@bat-image:~$ cat /etc/cloud/cloud.cfg
# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
   - default
   - name: batman
     gecos: batman
     shell: /bin/bash
     groups: [sudo, dip, lxd, cdrom, adm, plugdev]
     lock_passwd: False
     passwd: $6$fh5h17OAjISEUjmk$djgw1CD0KzK16hEmEZbkNUhHAYD10NMcS0NkTsYgsoobwCGmneYvjLH8LrO8XEry59jJ7l4TYlB1PF6QaMWqu/

I have tried collect the logs with the way you have suggested. I got an error message, but a tar.gz log file has been created. Do you think the log file contains all the necessary info for a bug report?

batman@bat-image:~$ sudo cloud-init collect-logs
Failed collecting file(s) due to error:
[('/run/cloud-init/cloud-id', '/tmp/tmpmquln2ez/cloud-init-logs-2022-09-20/run/cloud-init/cloud-id', "[Errno 2] No such file or directory: '/run/cloud-init/cloud-id'")]
Wrote /home/batman/cloud-init.tar.gz
batman@bat-image:~$ ls
cloud-init.tar.gz  image_version.txt
batman@bat-image:~$ ls -la
total 100
drwxr-xr-x 5 batman batman  4096 Sep 20 06:25 .
drwxr-xr-x 3 root   root    4096 Sep 13 11:14 ..
-rw------- 1 batman batman  2264 Sep 20 06:12 .bash_history
-rw-r--r-- 1 batman batman   220 Apr  4  2018 .bash_logout
-rw-r--r-- 1 batman batman  3771 Apr  4  2018 .bashrc
drwx------ 2 batman batman  4096 Sep 13 11:14 .cache
-rw-r--r-- 1 root   root   47571 Sep 20 06:25 cloud-init.tar.gz
drwx------ 3 batman batman  4096 Sep 13 11:14 .gnupg
-rw-rw-r-- 1 batman batman    16 Sep 14 10:12 image_version.txt
-rw-r--r-- 1 batman batman   807 Apr  4  2018 .profile
drwx------ 2 batman batman  4096 Sep 13 11:14 .ssh
-rw-r--r-- 1 batman batman     0 Sep 13 11:17 .sudo_as_admin_successful
-rw------- 1 root   root    9792 Sep 20 06:13 .viminfo
batman@bat-image:~$ 

Or maybe I first should check how 22.3.3 version from Github works for me.

Many thanks for your help,
/Robi

hello again,

I have some progress. Cloned the version 22.3.3 from Github and installed on my system

batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> cloud-init -v
/usr/local/bin/cloud-init 22.3.3
batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> 

At next prepared the cloud.config by adding the “batman” user as I did earlier too

batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> 
batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> cat /etc/cloud/cloud.cfg
# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
   - default
   - name: batman
     gecos: batman
     shell: /bin/bash
     groups: [sudo, dip, lxd, cdrom, adm, plugdev]
     lock_passwd: False
     passwd: $6$cjVJ1iVxqm1.8ZUB$89JgbfEIi5w9W.RHqdqZ6uhKrgOu9TaLVmLOOlNPYn7w3rGhmWHNzUVDK8cWh6eag6GbXclWFjPOuspAX8weh1

But unfortunately I have got the very same error when did “sudo cloud-init schema --system”

batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> sudo cloud-init schema --system
Cloud config schema deprecations: 
Error:
Cloud config schema errors: users.0: {'gecos': 'bat-image', 'groups': {'lxd', 'sudo', 'cdrom', 'dip', 'plugdev', 'adm'}, 'lock_passwd': False, 'name': 'batman', 'passwd': '$6$cjVJ1iVxqm1.8ZUB$89JgbfEIi5w9W.RHqdqZ6uhKrgOu9TaLVmLOOlNPYn7w3rGhmWHNzUVDK8cWh6eag6GbXclWFjPOuspAX8weh1', 'shell': '/bin/bash'} is not valid under any of the given schemas
batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> 

Also when did “sudo cloud-init init”, got this warning

batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> sudo cloud-init init
Cloud-init v. 22.3.3 running 'init' at Tue, 20 Sep 2022 06:57:25 +0000. Up 71803.58 seconds.
ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | Device |  Up  |           Address           |      Mask     | Scope  |     Hw-Address    |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: |  eth0  | True |       192.168.245.132       | 255.255.255.0 | global | 00:0c:29:32:5f:7f |
ci-info: |  eth0  | True | fe80::20c:29ff:fe32:5f7f/64 |       .       |  link  | 00:0c:29:32:5f:7f |
ci-info: |   lo   | True |          127.0.0.1          |   255.0.0.0   |  host  |         .         |
ci-info: |   lo   | True |           ::1/128           |       .       |  host  |         .         |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: ++++++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++++
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: | Route |  Destination  |    Gateway    |     Genmask     | Interface | Flags |
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: |   0   |    0.0.0.0    | 192.168.245.2 |     0.0.0.0     |    eth0   |   UG  |
ci-info: |   1   | 192.168.245.0 |    0.0.0.0    |  255.255.255.0  |    eth0   |   U   |
ci-info: |   2   | 192.168.245.2 |    0.0.0.0    | 255.255.255.255 |    eth0   |   UH  |
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | Route | Destination | Gateway | Interface | Flags |
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: |   1   |  fe80::/64  |    ::   |    eth0   |   U   |
ci-info: |   3   |    local    |    ::   |    eth0   |   U   |
ci-info: |   4   |   ff00::/8  |    ::   |    eth0   |   U   |
ci-info: +-------+-------------+---------+-----------+-------+
2022-09-20 06:57:25,662 - schema.py[WARNING]: Invalid cloud-config provided: Please run 'sudo cloud-init schema --system' to see the schema errors.
batman@bat-image:~/Tools/Github/cloud-init((22.3.3))> 

At next I was searching on where the “wrong” schema might be come, and I found the /etc/cloud/cloud.cfg.d/99-installer.cfg file with this contents

batman@bat-image:~> cat /etc/cloud/cloud.cfg.d/99-installer.cfg 
cat: /etc/cloud/cloud.cfg.d/99-installer.cfg: Permission denied
batman@bat-image:~> sudo cat /etc/cloud/cloud.cfg.d/99-installer.cfg 
datasource:
  None:
    metadata:
      instance-id: ce63caf5-5c5b-46cb-84e8-866b20811e5b
    userdata_raw: "#cloud-config\ngrowpart:\n  mode: 'off'\nlocale: en_US.UTF-8\n\
      preserve_hostname: true\nresize_rootfs: false\nssh_pwauth: true\nusers:\n- gecos:\
      \ bat-image\n  groups: !!set\n    adm: null\n    cdrom: null\n    dip: null\n\
      \    lxd: null\n    plugdev: null\n    sudo: null\n  lock_passwd: false\n  name:\
      \ batman\n  passwd: $6$cjVJ1iVxqm1.8ZUB$89JgbfEIi5w9W.RHqdqZ6uhKrgOu9TaLVmLOOlNPYn7w3rGhmWHNzUVDK8cWh6eag6GbXclWFjPOuspAX8weh1\n\
      \  shell: /bin/bash\n"
datasource_list:
- None
batman@bat-image:~> 

I dont know how/when this file was created, but for example if I change the password of the “batman” user in the /etc/cloud/cloud.cfg file (under the users section) to this for example

#cloud-config

# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
   - default
   - name: batman
     gecos: batman
     shell: /bin/bash
     groups: sudo
     lock_passwd: False
     passwd: $6$rounds=4096$m8uM./UsvKPb/$QOLX9fW.OVy0M8FFub8ZIt054xpyybV8zL2M2OZlLBUtfx/j97XFZiszsG.n7.Kfdwfn/GiKmTx6vETjGQhZ1.

And re-init cloud-init

sudo cloud-init clean
sudo cloud-init init

batman@bat-image:~> 
batman@bat-image:~> sudo cloud-init clean
batman@bat-image:~> 
batman@bat-image:~> sudo cloud-init init
Cloud-init v. 22.3.3 running 'init' at Tue, 20 Sep 2022 07:31:59 +0000. Up 1865.83 seconds.
ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | Device |  Up  |           Address           |      Mask     | Scope  |     Hw-Address    |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: |  eth0  | True |       192.168.245.132       | 255.255.255.0 | global | 00:0c:29:32:5f:7f |
ci-info: |  eth0  | True | fe80::20c:29ff:fe32:5f7f/64 |       .       |  link  | 00:0c:29:32:5f:7f |
ci-info: |   lo   | True |          127.0.0.1          |   255.0.0.0   |  host  |         .         |
ci-info: |   lo   | True |           ::1/128           |       .       |  host  |         .         |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: ++++++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++++
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: | Route |  Destination  |    Gateway    |     Genmask     | Interface | Flags |
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: |   0   |    0.0.0.0    | 192.168.245.2 |     0.0.0.0     |    eth0   |   UG  |
ci-info: |   1   | 192.168.245.0 |    0.0.0.0    |  255.255.255.0  |    eth0   |   U   |
ci-info: |   2   | 192.168.245.2 |    0.0.0.0    | 255.255.255.255 |    eth0   |   UH  |
ci-info: +-------+---------------+---------------+-----------------+-----------+-------+
ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | Route | Destination | Gateway | Interface | Flags |
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: |   1   |  fe80::/64  |    ::   |    eth0   |   U   |
ci-info: |   3   |    local    |    ::   |    eth0   |   U   |
ci-info: |   4   |   ff00::/8  |    ::   |    eth0   |   U   |
ci-info: +-------+-------------+---------+-----------+-------+
2022-09-20 07:31:59,541 - schema.py[WARNING]: Invalid cloud-config provided: Please run 'sudo cloud-init schema --system' to see the schema errors.
Generating public/private rsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
SHA256:h+tyj7Ciyk6q5AAe0ZPHVxoyfAqXKZ7EHQFh3MPLLE4 root@bat-image
The key's randomart image is:
+---[RSA 2048]----+
|  o+B==. .       |
|  o*oXo.+        |
| .o+Bo=o         |
|  .Eo=.  .       |
|..o .   S .      |
|o ..     o       |
|.+    . .        |
|B   . .+..       |
|*=.. ..oo..      |
+----[SHA256]-----+
Generating public/private dsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
SHA256:ZgEvl/f4vl7fy40Uz5l/g9dm9IORpIYk6LOvJAWOCyk root@bat-image
The key's randomart image is:
+---[DSA 1024]----+
|      .          |
|       o .       |
|   .  o = .      |
| .o .. + + o .   |
|E. ...  S o + o  |
|o . .o o . + o ++|
| . . .o   . . *+=|
|    o.     . =.*X|
|     .o.   .+.o=X|
+----[SHA256]-----+
Generating public/private ecdsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key.
Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub.
The key fingerprint is:
SHA256:eiXiEmKaZEuKir+A7hJAsZJtDsqKwA45lamzW3fGKz8 root@bat-image
The key's randomart image is:
+---[ECDSA 256]---+
| ..              |
| +.o             |
|=.*              |
|*B               |
|X*+ . . S .      |
|#B.. + o o       |
|@+. o * .        |
|=+ ..+Eo         |
|*+o. oo.         |
+----[SHA256]-----+
Generating public/private ed25519 key pair.
Your identification has been saved in /etc/ssh/ssh_host_ed25519_key.
Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub.
The key fingerprint is:
SHA256:gs899ZJ3saeKKZVhPopFNmCOXBze9FKVHFsrTOWraGk root@bat-image
The key's randomart image is:
+--[ED25519 256]--+
|     .... .o++o  |
|     .=o o oo+ . |
|   . =..o . + o  |
|    o.. +.o  . . |
|    . .oS+.o  o  |
|     o o..== . o |
|      ooooE.+ o .|
|      . o+ = . o |
|         .o ...  |
+----[SHA256]-----+
batman@bat-image:~> 

I got the " Invalid cloud-config provided: Please run ‘sudo cloud-init schema --system’ to see the schema errors." error, and the password in the /etc/cloud/cloud.cfg.d/99-installer.cfg file does not changed

batman@bat-image:~> sudo cat /etc/cloud/cloud.cfg.d/99-installer.cfg
datasource:
  None:
    metadata:
      instance-id: ce63caf5-5c5b-46cb-84e8-866b20811e5b
    userdata_raw: "#cloud-config\ngrowpart:\n  mode: 'off'\nlocale: en_US.UTF-8\n\
      preserve_hostname: true\nresize_rootfs: false\nssh_pwauth: true\nusers:\n- gecos:\
      \ bat-image\n  groups: !!set\n    adm: null\n    cdrom: null\n    dip: null\n\
      \    lxd: null\n    plugdev: null\n    sudo: null\n  lock_passwd: false\n  name:\
      \ batman\n  passwd: $6$cjVJ1iVxqm1.8ZUB$89JgbfEIi5w9W.RHqdqZ6uhKrgOu9TaLVmLOOlNPYn7w3rGhmWHNzUVDK8cWh6eag6GbXclWFjPOuspAX8weh1\n\
      \  shell: /bin/bash\n"
datasource_list:
- None
batman@bat-image:~> 

Thus, I think I have some fundamental problem, or I missed to configure something in the /et/cloud/cloud.cfg file.

Do you think I did something wrong?

Thanks for your help,
/Robi