Cloud-init doesn't work with images from cloud-images.ubuntu.com

Grettings, I’m not sure if I get this wrong, accroding to official doc

The images from the ubuntu and ubuntu-daily remotes are all cloud-init enabled

I’m using cloud-init to create user at startup, when I use image images:ubuntu/20.04/cloud, the cloud-init works fine, but when I use image ubuntu:20.04, the cloud-init doesn’t work

my profile look something like this

name: raymond_l
description: ""
config:
  cloud-init.user-data: |
    #cloud-config
    users:
      - default
      - name: test-user

Are there any extra steps needed when using images from cloud-images.ubuntu.com?

lxd version: 4.21

Hi Raymond,
Can you test with this profile please? In addition that profile, you can check the status of the cloud-init process with cloud-init status.

config:
  user.user-data: |-
    #cloud-config
    package_update: true
    package_upgrade: true
    hostname: test-ubuntu
    groups:
     - default
    users:
     - name: default
       primary-group: default
       groups: sudo
       shell: /bin/bash
       lock-passwd: false

Regards.

Thanks for replying. I changed the config key cloud-init.user-data back to user.user-data, and now it works on both image sources.