cloud-init unable to run on Debian 11 cloud image

jimmymcheung

New Member
Apr 21, 2023
23
1
3
Sorry to bother, I'm not familiar with Proxmox yet, and I can't find the answer in documentations. It is so wired that cloud-init does not execute on VM created with the qcow2 image from Debian (source: debian-11-genericcloud-amd64.qcow2). I have configured cloud-init with user name, ssh key and IP. On start up I can see that cloud init ISO is generated, but on boot up Debian loop by itself for an IP (via DHCP, which succeeded), later in the initialisation, I saw the OpenBSD Secure Shell server failed to start, with additional a notice "See 'systemctl status ssh.service' for details." The Multi-User System and the graphical Interface is reached and UTMP was updated. Afterwards, the VM is stuck at login window.

When I install VM with oracle linux image, I saw cloud-init will log itself in and configure the machine, but with Debian, cloud-init doesn't even try to login the system to make the change. Since I didn't set up anything else, I was also not able to log into the system.

I read this old thread which looking for help also with Debian 11, but his cloud-init would at lease execute. Does anyone knows how it can be fixed? Thanks!
 
Did you ever get Debian 11 working with Cloud Init? I'm having the same issue. It's working with Ubuntu 23.04 for me though.
 
Did you ever get Debian 11 working with Cloud Init? I'm having the same issue. It's working with Ubuntu 23.04 for me though.
Not with the cloud image provided by Debian, I saw some suggest the image provided by Proxmox themselves, but those are LXC images. I also can get Ubuntu working, and it is understandable, since they were first developing cloud-init.
 
Not with the cloud image provided by Debian, I saw some suggest the image provided by Proxmox themselves, but those are LXC images. I also can get Ubuntu working, and it is understandable, since they were first developing cloud-init.
I was able to cloud-init debian-11-genericcloud-amd64.qcow2 without issue last week. Did you try configuring a password to log in?
 
No, I tried to use no password, but ssh-key only to login
Both ways worked for me. Are you still troubleshooting this? At the very least, setting the user and password through the proxmox cloud-init GUI should get you access to check the logs.
 
Both ways worked for me. Are you still troubleshooting this? At the very least, setting the user and password through the proxmox cloud-init GUI should get you access to check the logs.
which image have you downloaded, maybe it was the image of those several days being bad.
 
So I get this image (at https://cloud.debian.org/images/clo...ian-11-genericcloud-amd64-20230601-1398.qcow2) and created a new vm with this image and set the cloud-init with a username and a ssh key, but apparently cloud-init was not run during first boot up. via console I can see it is hanging at login interface. The IP it is using is also one retrieved from DHCP, instead of a static IP passed by cloud-init
How are you setting the username and ssh key? From the proxmox GUI or a custom cloud-init file via command line?
 
@oscar13sd
from proxmox CLI, using
Bash:
qm set <VMID> --ciuser=<username>
and
Bash:
qm set <VMID> --sshkey <sshkey>
, The same command make cloud-init configure Oracle Linux/ Ubuntu image successfully, but not for debian
 
Last edited:
@oscar13sd
from proxmox CLI, using
Bash:
qm set <VMID> --ciuser=<username>
and
Bash:
qm set <VMID> --sshkey <sshkey>
, The same command make cloud-init configure Oracle Linux/ Ubuntu image successfully, but not for debian
Can you try and set the password? Being able to check the logs for openssh should help a lot.
 
Can you try and set the password? Being able to check the logs for openssh should help a lot.
I tried once before I asked on here what are the logs during first start up, and I remember there was one error about starting ssh. I will need to create a new vm to identify / reproduce the error. I will also try to set a password instead, but I think it was not the problem, since cloud-init was never login to the system for running the cloud-init script yet.
 
I tried once before I asked on here what are the logs during first start up, and I remember there was one error about starting ssh. I will need to create a new vm to identify / reproduce the error. I will also try to set a password instead, but I think it was not the problem, since cloud-init was never login to the system for running the cloud-init script yet.
I tried using password, but ssh returns connection refused. Moreover, I just notice one more thing: I forgot I didn’t resize the disk, and it remains 2G as when the qcow image was downloaded. So I thought it may behaving abnormal due to the too small disk size, but resizing the disk before starting the vm cause a kernel panic (not syncing, trying to kill init). Does this happen to you @oscar13sd
 
I tried using password, but ssh returns connection refused. Moreover, I just notice one more thing: I forgot I didn’t resize the disk, and it remains 2G as when the qcow image was downloaded. So I thought it may behaving abnormal due to the too small disk size, but resizing the disk before starting the vm cause a kernel panic (not syncing, trying to kill init). Does this happen to you @oscar13sd

"resizing the disk before starting the vm cause a kernel panic"

My debian 11 VMs are still at their original 2 GB size, and cloud-init ran without issue on them. I did spin up a new instance and resizing the disk before and after cloud-init did not produce any errors.

"I tried using password, but ssh returns connection refused."

I meant try deploying debian 11 again, but setting up your password for cloud-init to configure. I would suggest doing it through the proxmox web interface as I can confirm that worked for me (I have not tried via command-line).
 
"resizing the disk before starting the vm cause a kernel panic"

My debian 11 VMs are still at their original 2 GB size, and cloud-init ran without issue on them. I did spin up a new instance and resizing the disk before and after cloud-init did not produce any errors.

"I tried using password, but ssh returns connection refused."

I meant try deploying debian 11 again, but setting up your password for cloud-init to configure. I would suggest doing it through the proxmox web interface as I can confirm that worked for me (I have not tried via command-line).
Yes I have set a password via web UI, but the vm don’t accept incoming ssh connections
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!