HA starts VM after proper shutdown

Jul 1, 2022
7
0
6
Italy
Hi all,
i have a 3 node cluster. In my HA section i created a group with all nodes and i added my VMs as resources (in this case VMID 200).
If i shutdown the VMID 200 from console/ssh (using "shutdown -h now" or "poweroff") or using "shutdown" from PVE GUI, the VM goes down but after a second HA starts it again.
The only way is to stop from GUI's STOP button.
Is there a way to fix this behaviour?

Thank you

root@s3kfrmppve01:~# pveversion -v proxmox-ve: 7.3-1 (running kernel: 5.15.74-1-pve) pve-manager: 7.3-3 (running version: 7.3-3/c3928077) pve-kernel-5.15: 7.2-14 pve-kernel-helper: 7.2-14 pve-kernel-5.15.74-1-pve: 5.15.74-1 pve-kernel-5.15.64-1-pve: 5.15.64-1 pve-kernel-5.15.60-2-pve: 5.15.60-2 pve-kernel-5.15.30-2-pve: 5.15.30-3 ceph: 16.2.9-pve1 ceph-fuse: 16.2.9-pve1 corosync: 3.1.7-pve1 criu: 3.15-1+pve-1 glusterfs-client: 9.2-1 ifupdown2: 3.1.0-1+pmx3 ksm-control-daemon: 1.4-1 libjs-extjs: 7.0.0-1 libknet1: 1.24-pve2 libproxmox-acme-perl: 1.4.2 libproxmox-backup-qemu0: 1.3.1-1 libpve-access-control: 7.2-5 libpve-apiclient-perl: 3.2-1 libpve-common-perl: 7.2-8 libpve-guest-common-perl: 4.2-3 libpve-http-server-perl: 4.1-5 libpve-network-perl: 0.7.2 libpve-storage-perl: 7.2-12 libspice-server1: 0.14.3-2.1 lvm2: 2.03.11-2.1 lxc-pve: 5.0.0-3 lxcfs: 4.0.12-pve1 novnc-pve: 1.3.0-3 proxmox-backup-client: 2.2.7-1 proxmox-backup-file-restore: 2.2.7-1 proxmox-mini-journalreader: 1.3-1 proxmox-offline-mirror-helper: 0.5.0-1 proxmox-widget-toolkit: 3.5.3 pve-cluster: 7.3-1 pve-container: 4.4-2 pve-docs: 7.3-1 pve-edk2-firmware: 3.20220526-1 pve-firewall: 4.2-7 pve-firmware: 3.5-6 pve-ha-manager: 3.5.1 pve-i18n: 2.8-1 pve-qemu-kvm: 7.1.0-4 pve-xtermjs: 4.16.0-1 qemu-server: 7.3-1 smartmontools: 7.2-pve3 spiceterm: 3.2-2 swtpm: 0.8.0~bpo11+2 vncterm: 1.7-1 zfsutils-linux: 2.1.6-pve1 root@s3kfrmppve01:~#

root@s3kfrmppve01:/etc/pve/ha# more resources.cfg vm: 101 group HA-MainGroup state started vm: 200 group HA-MainGroup state started vm: 301 group HA-MainGroup state started vm: 302 group HA-MainGroup state started root@s3kfrmppve01:/etc/pve/ha# more groups.cfg group: HA-MainGroup nodes s3kfrmppve03,s3kfrmppve01,s3kfrmppve02 nofailback 1 restricted 0 root@s3kfrmppve01:/etc/pve/ha#

screen.png
 
Is there a way to fix this behaviour?
Not really. It's hard to tell whether a VM crashed or was shut down on purpose from the outside perspective of the HA manager. That's why the HA manager restarts the VM, because as far as it knows, the VM stopped working for an unknown reasen and should therefore be restarted.

or using "shutdown" from PVE GUI
This, however, should update the HA managed state for the vm to request_stop and subsequently do that, the same when pressing the button for stop.
  • Does the HA state update when you press shutdown in the GUI?
  • Do you get an error or another indication that something fails?
  • What happens when you use stop instead?

There is another question here, though: Why exactly do you want to shutdown the VM if it's HA managed in the first place? It might make more sense to just start and stop the VM while in use and when needed. Please, feel free to elaborate on your use-case here.
 
Last edited:
There is another question here, though: Why exactly do you want to shutdown the VM if it's HA managed in the first place? It might make more sense to just start and stop the VM while in use and when needed. Please, feel free to elaborate on your use-case here.
That's a good point of view. Of course you have right, my use-case was something like "i want to shutdown vm properly before shutdown node. I don't need to migrate these vms".

This, however, should update the HA managed state for the vm to request_stop and subsequently do that, the same when pressing the button for stop.
  • Does the HA state update when you press shutdown in the GUI?
  • Do you get an error or another indication that something fails?
  • What happens when you use stop instead?
Regarding these questions, i'll try to answer later because now i'm reinstalling from scratch the cluster due to raid controller change on all nodes.
Thank you
 
Just found this thread in a Google search. My use case is that the Windows VM running on a PVE host has APC Network Shutdown application installed on it and we had a power event this morning. The application is in communication with a networked UPS and if the UPS is on battery for 5 minutes, then the the guest OS is told to shutdown. This triggers PVE HA to restart and then the guest VM shuts down again after 5 minutes at which point the UPS battery is depleted and the PVE host starts its shutdown process via NUT. I have the HA setup as follows. Is there another way I should be configuring HA or is there another way?

1730836378356.png

Thanks,
Roger
 
Thanks for your reply. That's not a bad idea. Just to be sure, if the PVE host is told to shutdown by NUT/APCUPSD, will it gracefully shutdown its guests?
 

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!