[Feature] Improvement: Do not start VM-migration on nodes that do not need updates
Got an idea? Nice! 💡 We love hearing what features would make PegaProx better for you.
A friendly reminder: PegaProx is built by volunteers in our spare time. We can't promise timelines or guarantee every feature will be implemented — but every suggestion helps shape the roadmap!
Want to help move things faster?
- 💖 Become a Sponsor — sponsored features get prioritized
- ⭐ Star the project — helps with visibility
- 🤝 Even better: submit a PR with your idea!
Describe the feature
Even if there are no outstanding updates on a particular node, the VMs are still migrated to other cluster-members. This is unnessecary in that case.
Use Case
It decreases total time needed for updates and minimizes potential risks of start/stop/migration-problems.
Alternatives considered
Yes, still updating the nodes manually.
How important is this for you?
It's not urgent, but would be nice if that could be considerd in any upcoming releases.
Checklist
- [x] I have searched existing issues and discussions to make sure this hasn't been requested before
- [x] I understand this is a wishlist and not a work order — volunteers decide what gets built, and when
- [x] I'm aware that "this should be easy, it's only a few lines" has never once turned out to be true 🪄
Hey, that should already be the case: the rolling update dialog has "Skip up-to-date nodes", on by default. Before it touches a node it refreshes the package lists and checks for pending updates, and a node without any is skipped, no maintenance mode, no migrations. If the check itself fails it doesn't skip, to be on the safe side, and the log says "Failed to check updates on ...".
If you saw guests moved off a node that had nothing to update, could you paste the log lines of that node from the run? Then I can see which of the two it was.
Marcus
This was in conjunction with the 2nd node not being accessible via SSH (due to the different root passwords). So the rolling update failed, but the first node was already done and had not outstanding updates. When I re-started the update roll-out, the 1st node got drained, even though there were no updates to install.
Which log do you need in particular? The log in cluster-view does not cotain any fruitful information. Or do you mean the logs of the PVE-nodes themselfs? Thanks!
Got it, thanks. The log of the second run is the one, the part for that first node. Right after "Checking for available updates on journalctl -u pegaprox | grep RollingUpdate around that time has the same.
Marcus
This is all I found in journalctl on PegaProx host:
root@localhost:~# journalctl -u pegaprox | grep RollingUpdate
Oct 08 07:05:51 localhost pegaprox[6572]: [RollingUpdate] Error updating <NODE>: Update failed: SSH connection failed to root@<IP>:22 - Check if password auth is enabled on the node or configure an SSH key / SSH Verbindung fehlgeschlagen - Prüfe ob Passwort-Auth auf dem Node aktiviert ist oder konfiguriere einen SSH Key
Oct 08 07:05:54 localhost pegaprox[6572]: [RollingUpdate] Paused after failure on <NODE> - waiting for user
Oct 08 07:44:36 localhost pegaprox[6572]: [RollingUpdate] Error updating <NODE>: Update failed: SSH connection failed to root@<IP>:22 - Check if password auth is enabled on the node or configure an SSH key / SSH Verbindung fehlgeschlagen - Prüfe ob Passwort-Auth auf dem Node aktiviert ist oder konfiguriere einen SSH Key
Oct 08 07:44:40 localhost pegaprox[6572]: [RollingUpdate] Paused after failure on <NODE> - waiting for user
Thanks, that helps a bit. Those are only the warnings: the line that says whether a node was skipped or had updates is an info line and doesn't make it into the journal at the default log level (you can see the "Processing node" lines are missing too), it only shows in the rolling update panel. So this run can't tell us anymore, sorry for the detour.
Now that SSH works on both nodes, just start the next roll-out as usual and have a look at the panel line right after "Checking for available updates" for the node without updates. If it says "Check failed, proceeding with update anyway", paste it here and I'll take it from there.
Marcus
Found one way this can happen, even without the panel line. The up-to-date check started apt update on the node, waited a fixed 3 seconds and then read the package list. On a slower mirror the update was still running at that point, so the read could fail or still give the list from before, and a check that fails goes ahead with the update, migrations included. It now waits for the apt update task to finish (up to 3 minutes) before it reads the list, and the panel says so if the refresh failed and it had to use the cached list.
On Testing now, comes with the next release. If a roll-out there still migrates a node that had nothing to do, the line after "Checking for available updates" will tell us why.
If PegaProx saves you a maintenance window now and then, it runs on donations: https://opencollective.com/pegaprox
MK
Now that SSH worked on both nodes, the update ran through quite fine. Only thing I noticed is that the PegaProx-VM I'm currently running for testing was powered down for some reason while being migrated, so the update paused. After starting it again manually, I was able to resume the update-process. I assume this is not how it should be? Or is that expected and PP always needs to run outside of the cluster that is updated?
No, a VM shouldn't go down there. The update moves running VMs with a live migration, so a PegaProx on a VM should ride through it. Only containers are moved with a restart (stop, move, start), and a PegaProx in a container goes down with it, which would explain the pause.
If yours is a VM, could you paste the log of its migrate task from the source node's task list, and say whether it's an HA resource? If its cpu: is host and the two nodes have different CPUs, that's a common reason a guest dies right after the move.
MK
Unfortunately it's already out of the log rotation on the nodes. The migration went fine for all other VMs. The nodes are the same hardware and all hosts have cpu-type:host defined. The PegaProx host is not in HA currently. I thought this might intefere with it's own HA logic. Should I put it into the PVE's native HA?
Thanks for checking. The update only asks Proxmox for a live migration, so on the PegaProx side there's nothing left to look at. Whether to run that VM under Proxmox HA is a Proxmox setup question, best asked in their forum or their support, or with one of the support partners on https://pegaprox.com/sponsors.html#support. PegaProx copes with either, its evacuation skips guests HA already moved.
MK
I just saw that the qemu-agent is not installed on the prebuilt PegaProx image. I now added it by apt. Let's see if that changes things when next rolling updates are run.
1.5.0 is out and has the fix: the up-to-date check now waits for the node's apt update to finish (up to 3 minutes) before it reads the package list, so a node with nothing to install is skipped without maintenance mode or migrations. If the refresh fails, the rolling update panel says it is using the cached list. And the VM image has shipped qemu-guest-agent since 1.4.1, so an older image is the likely reason it was missing for you.
Nico
Thanks for the fix and the explanation!
Thanks for the fix and the explanation!
This was me apparently logged in with my private account. ;)