1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-18 06:18:08 +00:00

Check that vcpus value for GNS3 VM is an integer. Fixes #1636

This commit is contained in:
grossmj 2019-08-27 18:01:46 +07:00
parent 647dde1bb4
commit e64ed839f5

View File

@ -70,6 +70,8 @@ class VMwareGNS3VM(BaseGNS3VM):
raise GNS3VMError("Allocated memory {} for the GNS3 VM must be a multiple of 4".format(ram))
available_vcpus = psutil.cpu_count(logical=True)
if not float(vcpus).is_integer():
raise GNS3VMError("The allocated vCPUs value is not an integer: {}".format(vcpus))
if vcpus > available_vcpus:
raise GNS3VMError("You have allocated too many vCPUs for the GNS3 VM! (max available is {} vCPUs)".format(available_vcpus))