[SOLVED] VMs wiped after shutdown

Saru

New Member
Mar 31, 2023
3
1
3
Hi,

I am trying Proxmox for the first time. I set it up, access the web console, and begin to create my VMs.

The next day, after opening Proxmox and launching a VM, it boots on the Boot Menu (Install, Graphical Install, etc...) but not on the system I used the day before.
I installed it again, made a snapshot, the next day it was the same thing but restoring the snapshot did the trick.

I am guessing my VM are not randomly wiped out and it's an issue on my side, what could it be ?

proxmox1.PNG
proxmox2.PNG
 
Hi,

Thank you for the screenshots!

The first screen shows that the Disks are Unused, which causes the issue I guess, then the VM boot from the ISO installation? I would remove the ISO attached after the installation complete.

Regarding the "Unused disks" you can select on one of them [or double click] then on top do `Edit` then add, after that make sure that you boot from the disk by going to Options -> Boot Order.
 
Hi,

Thank you for the screenshots!

The first screen shows that the Disks are Unused, which causes the issue I guess, then the VM boot from the ISO installation? I would remove the ISO attached after the installation complete.

Regarding the "Unused disks" you can select on one of them [or double click] then on top do `Edit` then add, after that make sure that you boot from the disk by going to Options -> Boot Order.
If I remove the ISO from media and delete Unused Disks (they are unused in the working snapshot from yesterday), here what happens :
proxmox3.PNG

After deleting unused Disks and creating an EFI Disk (system had none), I have this screen :
proxmox4.PNG

I next restored the Snapshot and it works, but if I shut down the VM (from the Kali GUI), the boot issue happens again.
If I restart the VM from the Kali GUI, the system boot normally and no settings have changed :
proxmox5.PNG

The issue seems to be that the system can't boot after a shutdown. I only noticed the issue a day after because I hadn't shut them down before. Snapshots are working as it was created before the first shutdown of the VM. I will try to create the EFI disk from the start and see what happens.

I will try a new VM today with the steps I take and maybe you or someone else can understand the issue, if anything is unclear don't hesitate to ask me.

EDIT : Running some tests. I shutdown the VM (broken state). I boot from the ISO installation media and enter rescue mode. Here I have sda1, sda2, sda3. Grub is on sda2, I enter Repair Grub, then Reboot, and it works ! But if I shutdown it again the issue reappears. It seems like the issue is coming from the LVM disks. The unused disks in my first screenshot are linked to the VM but can't be assigned again to their respective number and I think it's causing the issue.
 
Last edited:
VM Creation Process, I am just writing what I am changing :

Right Click on Proxomox node -> Create VM
VM General : Name -> debian11
VM OS : ISO image -> debian-11.6.0-amd64-DVD-1.iso
VM System : Default
VM Disks : Disk Size -> 50 GiB
VM CPU : Cores -> 2
VM Memory : Memory 4096 MiB
VM Network : Default
Confirm
proxmox7.PNG

I then Start the VM and begin the installation process.
Partition Disks : Guided - use entire disk
Disk to Partition -> SCSI3
All files in one partition
Install the GRUB boot loader : Yes -> /dev/sda (scsi-0QEMU)

Installation is in progress, I'll keep you updated after it's done

UPDATE : Everything seems in order. I think the issue I had was I tried to create VM with UEFI and made too much weird stuff on my disks/EFI Disks and it broke the boot of my VM. I now left default BIOS option and it seems to work fine.

I will let you know if anything new comes up, thanks for the help !
 
Last edited:
  • Like
Reactions: Moayad
Just in case someone wants to wipe a VM after shutdown, use this hookscript:
Bash:
#!/bin/bash
if [ "$2" == "pre-start" ]
then
    echo "VM $1 will self-destruct after shutdown!"
elif [ "$2" == "post-stop" ]
then
    nohup /usr/sbin/qm destroy "$1" &>/dev/null &
fi
 

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!