Packer and LXD integration

Hi All,
I tried to creare a golden image on a LXD instance using packer and a official image qcow2 provided from Red Hat. I tried do use config.cloud-init.network-config and config.cloud-init.user-data to provide the IP address and hostname to the VM started up by packer, but the vm didn’t find the information from cloud-init. On this VM the lxd-agent wasn’t installed and I use virt-customize to apply pass a tarball with the agent configuration and installation

virt-customize  \
-a rhel-10-fixed.qcow2 \
--root-password password:xxxxx \
--edit '/etc/selinux/config:s/^SELINUX=.*/SELINUX=disabled/g' \
--upload ./agent.tgz:/tmp/agent.tgz \
--run-command 'mkdir -p /run/systemd/system/' \
--run-command 'tar xfz /tmp/agent.tgz -C /tmp/' \
--run-command 'chmod +x /tmp/mnt/iso/install.sh' \
--run-command 'chmod +x /tmp/mnt/iso/lxd-agent' \
--run-command 'cd /tmp/mnt/iso/ && sh ./install.sh' \
--run-command 'rm -rf /tmp/mnn/iso' \
--run-command 'cat > /etc/cloud/cloud.cfg.d/90_lxd.cfg << "EOF"
datasource_list: [ LXD ]
datasource:
  LXD:
    apply_network_config: true
EOF' \
--run-command 'systemctl enable lxd-agent' \
--run-command 'cloud-init clean --logs --seed' \
--run-command 'rm -rf /var/lib/cloud/instances/* /var/lib/cloud/instance'

I use the new image with packer but when the lxd-agent has been started it rebooted the VM and packer fails the boostratp of the source object.

Is it possible this problem with lxd-agent and cloud-init data?

Thanks,
Marcello