Cloud-init for Fedora based distros doesn't work

SebDanielsson

New Member
Jul 14, 2022
5
0
1
Hi! :)

I successfully ran this script to create a template for a Ubuntu 22.04 template. I then proceeded to to create a CentOS Stream 9 and Alma Linux 9 template.

After making a full clone of the template. Adding a password, ssh-keyand setting IPV4 and IPV6 networking to use DHCP and then booting the VM the CPU basically stays at 50% and I'm unable to open the console to view the output.

Here's the script I ran to create my template. Shouldn't be anything weird in it as far as I can tell..

Bash:
# Set script variables
IMAGE_FILE='AlmaLinux-9-GenericCloud-latest.x86_64.qcow2'
TEMPLATE_ID='3000'
TEMPLATE_NAME='almalinux-template'

# Create VM
qm create $TEMPLATE_ID --name $TEMPLATE_NAME --net0 virtio,bridge=vmbr0 --memory 2048 --core 2

# Import image
qm importdisk $TEMPLATE_ID $IMAGE_FILE local-lvm

# Attach image as storage device
qm set $TEMPLATE_ID --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-$TEMPLATE_ID-disk-0

# Attach a drive for cloud-init
qm set $TEMPLATE_ID --ide2 local-lvm:cloudinit

# Configure VM to boot from our image
qm set $TEMPLATE_ID --boot c --bootdisk scsi0

# Add a serial console
qm set $TEMPLATE_ID --serial0 socket --vga serial0

# Convert VM to template
qm template $TEMPLATE_ID
 
Try it with the default display instead of `serial`.
If your image doesn't provide a serial device, it won't work and it seems some of the newer cloud images don't do that by default.
 
Try it with the default display instead of `serial`.
If your image doesn't provide a serial device, it won't work and it seems some of the newer cloud images don't do that by default.
Thanks for that! :) I started with the default display and now got access through noVNC. I can't scroll but it seems like a kernel panic. Are there any way to extract the logs from the VM? Not sure why it panics..
 

Attachments

  • Screen Shot 2022-07-15 at 10.49.37.png
    Screen Shot 2022-07-15 at 10.49.37.png
    140.2 KB · Views: 19
Interesting. I changed the processor from default (kvm64) to SandyBridge since my test server is a 2600K system. Now Alma Linux boots up properly. However Ubuntu boots up fine with the proessor set to kvm64. Wonder why this could be.. I also tested to set the CPU to "host" and this is booting fine as well!
 
Did you download an image that requires certain features to be available?
kvm64 is a CPU model that doesn't provide lots of features. It is there for compatibility. So a mismatch between what the kernel expected and what the CPU provided could be the issue.
 
I downloaded AlmaLinux 9 from https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/:
AlmaLinux-9-GenericCloud-9.0-20220527.x86_64.qcow2

I suspect this will be a problem for RockyLinux 9, Oracle Linux 9 and RHEL 9 aswell.

My problem starting Fedora was not due to using kvm64 but because I checked the DHCP option inside Proxmox. If setting a static IP or not touching the option at all I could boot Fedora without the following errors:
Failed Units: 2
cloud-final.service
NetworkManager-wait-online.service

Not sure why checking the DHCP options broke cloud-init. Seems to only be a problem with Fedora.
 
That's a common issue when setting to use DHCP without having a DHCP provider.
The network service will try to get an IP via DHCP and waits until the timeout, which is typically 5 minutes.
 

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!