CloudImg VM won't boot, stuck at "starting serial terminal on interface serial0"

Jan 19, 2021
34
5
13
124
I'm trying to automate the creation of VMs using cloudimg's and I've got a template and a clone created, but the clone VM won't start it just says "starting serial terminal on interface serial0". This is my script:

Code:
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
zfs create -V 1M nvme-virt/vm-8000-disk-0

qm create 8000 --memory 2048 --balloon 0 --core 2 --bios ovmf --machine q35 --cpu host --numa 1 --sockets 2 --name Ubuntu-Template --net0 virtio,bridge=vmbr0 --serial0 socket --vga serial0 --scsihw virtio-scsi-pci --efidisk0 nvme-virt:vm-8000-disk-0,efitype=4m,pre-enrolled-keys=0,size=1M

qm importdisk 8000 jammy-server-cloudimg-amd64.img nvme-virt
qm set 8000 --scsihw virtio-scsi-pci --scsi0 nvme-virt:vm-8000-disk-1,discard=on,ssd=true,size=16000M
qm set 8000 --ide2 nvme-virt:cloudinit
qm set 8000 --boot c --bootdisk scsi0
qm template 8000

qm clone 8000 8005 --name CI-test --full
qm set 8005 --sshkey ~/.ssh/authorized_keys --ipconfig0 ip=dhcp --ciuser UntouchedWagons --cipassword RipeTallRiverBrighten

Is there something I'm missing?
 
I suspect your are being tripped by EFI somewhere. First I would try without it.
Second, while you can create disks directly - why? You create a disk directly, then use the syntax of QM that actually creates the disk, You have not provided any outputs for the commands you are running, are you sure there are no errors?
Here is your command with just storage changed:
Code:
qm create 8000 --memory 2048 --balloon 0 --core 2 --bios ovmf --machine q35 --cpu host --numa 1 --sockets 2 --name Ubuntu-Template --net0 virtio,bridge=vmbr0 --serial0 socket --vga serial0 --scsihw virtio-scsi-pci --efidisk0 local-lvm:0,efitype=4m,pre-enrolled-keys=0,size=1M
  Rounding up size to full physical extent 4.00 MiB
  Logical volume "vm-8000-disk-0" created.
transferred 0.0 B of 528.0 KiB (0.00%)
transferred 528.0 KiB of 528.0 KiB (100.00%)
transferred 528.0 KiB of 528.0 KiB (100.00%)
efidisk0: successfully created disk 'local-lvm:vm-8000-disk-0,efitype=4m,pre-enrolled-keys=0,size=4M'

As you see disk-0 is created automatically.

Here is what happens with your steps:
Code:
root@proxmox7-nvme1:~# pvesm alloc local-lvm 8000 vm-8000-disk-0 1M
  Rounding up size to full physical extent 4.00 MiB
  Logical volume "vm-8000-disk-0" created.
successfully created 'local-lvm:vm-8000-disk-0'
root@proxmox7-nvme1:~# qm create 8000 --memory 2048 --balloon 0 --core 2 --bios ovmf --machine q35 --cpu host --numa 1 --sockets 2 --name Ubuntu-Template --net0 virtio,bridge=vmbr0 --serial0 socket --vga serial0 --scsihw virtio-scsi-pci --efidisk0 local-lvm:0,efitype=4m,pre-enrolled-keys=0,size=1M
  Rounding up size to full physical extent 4.00 MiB
  Logical volume "vm-8000-disk-1" created.
transferred 0.0 B of 528.0 KiB (0.00%)
transferred 528.0 KiB of 528.0 KiB (100.00%)
transferred 528.0 KiB of 528.0 KiB (100.00%)
efidisk0: successfully created disk 'local-lvm:vm-8000-disk-1,efitype=4m,pre-enrolled-keys=0,size=4M'

notice how the new disk is disk-1?
Your next import likely created disk-2, yet you set disk-1 as boot disk.
Take a look at your steps again and the output each command provides. If you think its all working well - post the entire command/output sequence here, perhaps someone else will spot anything.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
Okay I don't know what exactly it was from your initial command that got it working for me but it's working now:

Code:
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img

qm create 8000 --memory 2048 --balloon 0 --core 2 --bios ovmf --machine q35 --cpu host --numa 1 --sockets 2 --name Ubuntu-Template --net0 virtio,bridge=vmbr0 --serial0 socket --vga serial0 --agent 1,fstrim_cloned_disks=1 --scsihw virtio-scsi-pci --efidisk0 nvme-virt:0,efitype=4m,pre-enrolled-keys=0,size=1M

qm importdisk 8000 jammy-server-cloudimg-amd64.img nvme-virt
qm set 8000 --scsihw virtio-scsi-pci --scsi0 nvme-virt:vm-8000-disk-1,discard=on,ssd=true,size=16000M
qm set 8000 --ide2 nvme-virt:cloudinit
qm set 8000 --boot c --bootdisk scsi0
qm template 8000

qm clone 8000 8005 --name CI-test --full
qm set 8005 --sshkey ~/.ssh/authorized_keys --ipconfig0 ip=dhcp --ciuser UntouchedWagons --cipassword RipeTallRiverBrighten

When I tried to create the efidisk within the qm create it would just hang.

Now to figure out custom cloud-init configs.

Do you know how to set the disk size? The size=16000M does nothing
 
Last edited:
Okay I don't know what exactly it was from your initial command that got it working for me but it's working now:
you appear to have removed the unnecessary command that was shifting your disks by 1, as I explained previously.

Do you know how to set the disk size? The size=16000M does nothing
set size of what disk? size= does nothing in what command? It's always better to provide more information than less.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
The actual boot disk (scsi0) is about 2.2GB in size but I want to make it bigger so that I can store stuff on it like kubernetes.
 
As "man qm" indicates, you do not have size control when doing "qm importdisk":
Code:
qm importdisk <vmid> <source> <storage> [OPTIONS]

       Import an external disk image as an unused disk in a VM. The image format has to be supported by qemu-img(1).

       <vmid>: <integer> (1 - N)
           The (unique) ID of the VM.

       <source>: <string>
           Path to the disk image to import

       <storage>: <string>
           Target storage ID

       --format <qcow2 | raw | vmdk>
           Target format

The disk will be created automatically based on the image size (virtual not physical).
If you need to make it larger, then you need to expand it: man qm \ resize
And then make sure that your cloud-init contains appropriate steps to grow the root file system.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:

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!