ConvoyPanel / panel

A modern platform tailored for hosting providers and enthusiasts to effortlessly interact with their servers. Seamlessly wrapping around Proxmox, Convoy is easily deployable, affordable at just $6 per node per month for commercial use, and completely free for personal and non-profit endeavors.
https://convoypanel.com
Other
308 stars 51 forks source link

VMIDs could conflict if panel left to choose a random one on it's own #78

Closed AleksaDjordjic closed 3 months ago

AleksaDjordjic commented 4 months ago

Current Behavior

When a server is being provisioned and the VMID wasn't entered in manually, Convoy will generate a new random VMID with the code "random_int(100, 999999999)". There is no code after this line to check if the generated VMID already exists. This will eventually lead to Convoy trying to make a new VM with a VMID that is already in use.

Expected Behavior

Convoy should generate a random VMID, check if it is in use, if it is generate a new one OR have some kind of auto-increment for VMIDs (that would also check if the VMID is in use just in case a manual one was entered that would conflict).

Steps to Reproduce

Provision enough servers to a point where VMIDs could start conflicting. This would be up in the thousands most likely though.

Screenshots

No response

Proxmox OS Version

Any

Operating System

Any

Browser

Any

Additional Context

https://github.com/ConvoyPanel/panel/blob/137f94a89c9a94be4b44bf052ccb6741896fe151/app/Services/Servers/ServerCreationService.php#L43

Panel Version

4.2.0-beta

Error Logs

No response

Is there an existing issue for this?

ericwang401 commented 3 months ago

Patched in https://github.com/ConvoyPanel/panel/releases/tag/v4.2.2-rc.1