HA Configuration

Daniel Vos

New Member
Sep 28, 2018
4
0
1
33
Hello,

I am migrating from OpenNebula to Proxmox.

I have added my virtual machines to HA groups so that they are evenly spread out over my hosts, and in case of a host failure, will be moved to another host :)

I have 5 groups, each with one host with a value of 2, and the other 4 hosts a value of 1.


But there is one issue. Both me and my users are very confused that if they shutdown a server (shutdown -h now) they find it will start itself automagically again.

I don't want proxmox to manage the Started or Stopped state for any virtual machines.

But I DO want proxmox to move them to a new host if one of my hosts goes down. Their state should then be their last state on the previous host.


What option do I need to configure to get that kind of behaviour?
 
Try to shutdown the VM via `qm shutdown VMID` (on the PVE host) - otherwise the HA-Stack doesn't see that it's supposed to be shut off?
 
Thank you for your reply.

What other options are there?

I don't need the HA-Stack to monitor the Started or Stopped state of a machine.


I do want the HA-Stack to restart a VM on another node if a node has failed and the VM was in a Started state on that node..
 
Not sure whether I understand your question - but if the VM X was in a Started state on node A, and node A fails - VM X will be started on node B.
If VM X is in a Stopped state on node A, and node A fails - VM X will be relocated to node B, but remain in a stopped state.

The reference documentation explains this quite nicely: https://pve.proxmox.com/pve-docs/chapter-ha-manager.html
 
Thank you for your quick reply. I have read the documentation several times, but I can't find my answer.

Is it possible for proxmox to make a VM high-available without monitoring whether or not the state is Started or Stopped?


If node A goes down, node B, C D and F should take over these VMs, but it requires you configure the state in Started or Stopped.


Where is the option to make VMs High-Available without proxmox enforcing the Started or Stopped state?

This is the standard behaviour of VMWare and Hyper-V. If a node goes down (ex. power or network failure) all VMs that were running on that node will be started on a different node. All VMs that were turned off, will be migrated but not started.


I don't want to have to login to a proxmox host to be able to shut down a VM. This shouldn't be necessary.
 
Currently this behavior is not implemented - you could probably create a script that uses the REST API of Proxmox and changes the HA State of the VM upon shutdown, but if you want a HA-managed VM to be stopped you need to do this via Proxmox
 
Thank you for your reply. I'll write down the possibilities and make a decision.

Is it possible to request this behavior to be added to the HA manager? I think there will be more people interested in this.
 
If we shutdown the VM from Guest-OS, Proxmox HA will automatically bring up the VM again.
I know we can shutdown/stop the VM from Web UI or using CLI (qm shutdown VMID), but I really want to find a way to shut it down from Guest OS.
I also aware about qemu-guest-agent, acpi stuff, but seems it's only for communication from host to guest not other way.

Best Regards,
 
If the VM shuts itself down and the virtualization process for it stops, Proxmox VE has no way to know if it was intentional or if it crashed.
Therefore, if you want to change its state from started to stopped, you either need to change it in the HA settings or by issuing the shutdown from Proxmox VE. There is no other way.

If you don't want to give access to the Proxmox VE GUI to other people, you can build your own tooling to expose the power mgmt for a VM via the API.

A quick guide on how to access the API: https://pve.proxmox.com/wiki/Proxmox_VE_API
The shutdown API endpoint for VMs in the Proxmox VE API viewer: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/status/shutdown
 
Thanks a lot for quick response @aaron . I know there is Rest API to shutdown/stop the VM, however if you think about other cloud providers such as AWS, Azure, Digital Ocean... they do support to shutdown from Guest OS. I was just wondering if Proxmox ever have any kind of communication from guest agent to Host or any hook that tells Proxmox about the intention so that Proxmox HA will not interfere would be very helpful.
Let me dig further on this.
Thanks again for confirming,
hainh