k8s-proxmox / cluster-api-provider-proxmox

Cluster API provider implementation for Proxmox VE
Apache License 2.0
94 stars 11 forks source link

Duplicate ProviderIDs #94

Closed simplysoft closed 8 months ago

simplysoft commented 8 months ago

/kind bug

What steps did you take and what happened: When increasing replicas count of a machine set to bigger number (e.g. 0 -> 3), causing it to create many many machines within a short amount of time, we end up with multiple ProxmoxMachine instances that have all the same provider ID. In this instance where we did scale from 0 -> 3, only one single proxmox vm got created and we had 3 ProxmoxMachine with different names but same provider id

What did you expect to happen: Individual VMs get created

Anything else you would like to add: Not yet sure where this bug is coming from (cluster-api, proxmox provider or even proxmox REST API)

Environment:

sp-yduck commented 8 months ago

could you share yor proxmoxmachinetemplate to here ?

sp-yduck commented 8 months ago

I am not sure the cause yet but I have fixed one potential cause. you can try this with spyduck/cluster-api-provider-proxmox:9e7ea64 image (pushed to docker.io)

simplysoft commented 8 months ago

Thanks for the hint, I'm not sure if it is related to that. Setting the VM ID once before the VM is being created does not seem to be a problem. It feels like that would be a viable approach as part of reconciliation. But the following reconciliation might not properly take that set VM id into consideration (but not sure how the internals work when a reconcilation fails, but partially updates were performed on that object, does the retrying reconciliation still operate on the old version of that document or the patched one?)

We are currently testing with a develop version that has ranged based vmid assignment (not using proxmox next id), but we have experienced this already before, but not yet re-tested with your latest change. We will see if we can re-test with that version

sp-yduck commented 8 months ago

closing as this cannot be reproduced