From 7aae682f0a1f20ded160555f4f05f50b45f45aad Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 27 Feb 2019 14:47:45 +0700 Subject: [PATCH] Fix issue when setting cpuid.corespersocket for the GNS3 VM. Fixes https://github.com/GNS3/gns3-gui/issues/2723 --- gns3server/controller/gns3vm/vmware_gns3_vm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/gns3vm/vmware_gns3_vm.py b/gns3server/controller/gns3vm/vmware_gns3_vm.py index cd1915b9..2931de6d 100644 --- a/gns3server/controller/gns3vm/vmware_gns3_vm.py +++ b/gns3server/controller/gns3vm/vmware_gns3_vm.py @@ -76,11 +76,12 @@ class VMwareGNS3VM(BaseGNS3VM): if vcpus > available_vcpus: raise GNS3VMError("You have allocated too many vCPUs for the GNS3 VM! (max available is {} vCPUs)".format(available_vcpus)) - cores_per_sockets = int(available_vcpus / psutil.cpu_count(logical=False)) try: pairs = VMware.parse_vmware_file(self._vmx_path) pairs["numvcpus"] = str(vcpus) - pairs["cpuid.coresPerSocket"] = str(cores_per_sockets) + cores_per_sockets = int(available_vcpus / psutil.cpu_count(logical=False)) + if cores_per_sockets >= 1: + pairs["cpuid.corespersocket"] = str(cores_per_sockets) pairs["memsize"] = str(ram) VMware.write_vmx_file(self._vmx_path, pairs) log.info("GNS3 VM vCPU count set to {} and RAM amount set to {}".format(vcpus, ram))