Is it safe to run the "poweroff" comand? Does it shutdown all VM's safely?

kegham

Member
Aug 23, 2019
6
0
6
I ask because yesterday my pfsense VM got stuck on startup after 3 days powered on, after some digging the folks say that the problem can occur in systems power failures. It was the first time that one of my Vms got corrupted.
I always shutdown my Linux machines with the poweroff command, is this wrong?
 
Using the "poweroff" command is safe, as long as you do not use a "force" option. While also that still syncs filesystems, so also there you normally are good, but some VMs may have trouble nonetheless (and I really would not force poweroff any server anyhow important).

But using the poweroff command ist not "system power failure". The former is a defined command which cleanly tells the init manager (in our case systemd) to power the machine down nicely, before shutting fully down we stop all VMs and CTs cleanly.
The latter is a power outage, or a hardware failure of a power supply - in that case the server just got "killed" in an instant, it has no possibility to do clean shutdowns at all.

To cope with such situations one normally uses one or more UPS, which have a battery backup for either compensate for a temporary outage or give the server enough time to cleanly shutdown on a permanent one.
 
Hello! Thanks for the quick response.

So, my server has a UPS connected to maintain a good power stability, I never had power issues with the server, and as far as i know it didnt had any in that day. I normally sent the "poweroff" command to proxmox and like always the Vms were shutdown, and after, the server. As far as i know everything was clean and normal.

One thing that I notice is that the only VM that hasn't the Quemu-agent Enabled is this VM who got corrupted (pfsense). May this be the problem? If proxmox can't "talk" to pfsense, he forces a shutdown?
 
One thing that I notice is that the only VM that hasn't the Quemu-agent Enabled is this VM who got corrupted (pfsense)

Hmm, but you also do not set that it has the QEMU Guest Agent in the config?

If proxmox can't "talk" to pfsense, he forces a shutdown?

In this case Proxmox VE sends an ACPI command, most operating systems recognize those and start a clean shutdown. It's quite similar to the real world, like when you pressed the power button of a physical server for a quick moment (not long, like when it hangs). Now if the VM ignores that it will in fact be killed after quite some time (>3 minutes no reaction, IIRC).

You could check if that was the case by checking if that VM reacts to a manual triggered "Shutdown" through the Proxmox VE gui (or with qm shutdown VMID CLI command)

You could even replicating what happens to shutdown all VMs and CTs during a node shutdown, without that node shutdown:
pvenode stopall (obvious note: that stops all guests).

What's the storage the VMs use?
 
Hmm, but you also do not set that it has the QEMU Guest Agent in the config?
You mean in the Vm config on the WebGUI? Is set as disabled.

You could check if that was the case by checking if that VM reacts to a manual triggered "Shutdown" through the Proxmox VE gui (or with qm shutdown VMID CLI command)
Oh I see. I tested here, it takes quite some time to shutdown, longer that the other vms.

What's the storage the VMs use?
I have one ssd with two partitions on the server, one is for proxmox and the rest for the VMs.
 

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!