1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-03 01:17:56 +03:00

merged proxmox fix from 3.6

This commit is contained in:
Adolfo Gómez García 2023-06-09 15:00:11 +02:00
parent 1a7e7b9cd3
commit 70c8a296ca
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -350,11 +350,17 @@ class ProxmoxClient:
if toStorage and self.getStorage(toStorage, vmInfo.node).shared: if toStorage and self.getStorage(toStorage, vmInfo.node).shared:
node = self.getBestNodeForVm(minMemory=-1, mustHaveVGPUS=mustHaveVGPUS) node = self.getBestNodeForVm(minMemory=-1, mustHaveVGPUS=mustHaveVGPUS)
if node is None: if node is None:
raise ProxmoxError(f'No switable node available for new vm {name} on Proxmox') raise ProxmoxError(
f'No switable node available for new vm {name} on Proxmox (check memory and VGPUS, space...)'
)
toNode = node.name toNode = node.name
else: else:
toNode = fromNode toNode = fromNode
# Check if mustHaveVGPUS is compatible with the node
if mustHaveVGPUS is not None and mustHaveVGPUS != self.nodeHasGpu(toNode):
raise ProxmoxNoGPUError(f'Node "{toNode}" does not have VGPUS and they are required')
# From normal vm, disable "linked cloning" # From normal vm, disable "linked cloning"
if linkedClone and not vmInfo.template: if linkedClone and not vmInfo.template:
linkedClone = False linkedClone = False