application-research / ehi-proxmaas

Integrates Proxmox, MAAS and Technitium to provide one-touch deployment of many machines
MIT License
1 stars 1 forks source link

Proxmaas can't handle updating VMs after they've been moved to a new host #13

Open PC-Admin opened 1 year ago

PC-Admin commented 1 year ago

Yeah it expects the VM to be on the exact same host it was spawned on, which won't always be the case:

TASK [Create the requested VMs] *******************************************************************************************************************************
failed: [localhost] (item=1) => {"ansible_loop_var": "item", "changed": false, "item": 1, "msg": "Unable to update vm prod-phos-k8s-w01 with vmid 171=500 Internal Server Error: Configuration file 'nodes/apollo/qemu-server/171.conf' does not exist", "vmid": 171}
failed: [localhost] (item=2) => {"ansible_loop_var": "item", "changed": false, "item": 2, "msg": "Unable to update vm prod-phos-k8s-w02 with vmid 172=500 Internal Server Error: Configuration file 'nodes/arcturus/qemu-server/172.conf' does not exist", "vmid": 172}
failed: [localhost] (item=3) => {"ansible_loop_var": "item", "changed": false, "item": 3, "msg": "Unable to update vm prod-phos-k8s-w03 with vmid 173=500 Internal Server Error: Configuration file 'nodes/capella/qemu-server/173.conf' does not exist", "vmid": 173}
changed: [localhost] => (item=4)
changed: [localhost] => (item=5)
changed: [localhost] => (item=6)
changed: [localhost] => (item=7)
changed: [localhost] => (item=8)
failed: [localhost] (item=9) => {"ansible_loop_var": "item", "changed": false, "item": 9, "msg": "Unable to update vm prod-phos-k8s-w09 with vmid 179=500 Internal Server Error: Configuration file 'nodes/apollo/qemu-server/179.conf' does not exist", "vmid": 179}
failed: [localhost] (item=10) => {"ansible_loop_var": "item", "changed": false, "item": 10, "msg": "Unable to update vm prod-phos-k8s-w10 with vmid 180=500 Internal Server Error: Configuration file 'nodes/arcturus/qemu-server/180.conf' does not exist", "vmid": 180}
changed: [localhost] => (item=11)
failed: [localhost] (item=12) => {"ansible_loop_var": "item", "changed": false, "item": 12, "msg": "Unable to update vm prod-phos-k8s-w12 with vmid 182=500 Internal Server Error: Configuration file 'nodes/pioneer/qemu-server/182.conf' does not exist", "vmid": 182}
changed: [localhost] => (item=13)
changed: [localhost] => (item=14)
changed: [localhost] => (item=15)
...
PC-Admin commented 1 year ago

as a temporary fix I'll move these back to their origin after lowering the RAM on the nodes that were successfully altered.

PC-Admin commented 1 year ago

So I've had to distribute VMs away from the hosts that have MooseFS masters. We now have an asymmetry with how the worker nodes are distributed around EHI.

I can't really think of any neater way to do this then to have a dictionary variable in each inventories var file defining which Proxmox node each host is expected to be on. :shrug: (Could also have like a migrate.yml playbook in this repo to automatically migrate any hosts that don't match this dictionary)

Zorlin commented 1 year ago

I can't really think of any neater way to do this then to have a dictionary variable in each inventories var file defining which Proxmox node each host is expected to be on. 🤷 (Could also have like a migrate.yml playbook in this repo to automatically migrate any hosts that don't match this dictionary)

So, let's table it for now as this is so low priority as to be a non-issue and I don't like that as a solution. It's far too static and doesn't reflect our goals.

PC-Admin commented 1 year ago

Good point, it would be nice to not have to manually update VMs however.

A fancy way of searching for where each host is before trying to create/update a VM could be a neater solution.

Zorlin commented 1 year ago

which Proxmox node each host is expected to be on

That's the issue, there should never be a situation where a node is expected to be on one particular host. If there is, we've failed. (Yes, I understand the Proxmox module is stupid and expects this)

Zorlin commented 1 year ago

https://lists.proxmox.com/pipermail/pve-devel/2023-June/057018.html