I just checked the code and found that only vmware and xenserver have related cpu socket settings.
This is xenserver: String coresPerSocket = details.get(" cpu.corespersocket"); This is vmware: String coresPerSocket = vmSpec.getDetails().get("cpu.corespersocket"); 发件人: Nii Apleh Lartey <niiap...@live.com> 发送时间: 2019年11月25日 22:07 收件人: li jerry <div...@hotmail.com>; dev@cloudstack.apache.org 主题: Re: vcpu socket configuration Sorry, Try using "cpuid.coresPerSocket" instead -- Nii ________________________________ From: li jerry <div...@hotmail.com<mailto:div...@hotmail.com>> Sent: Monday, November 25, 2019 2:02 PM To: dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org> <dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>> Subject: 回复: vcpu socket configuration After deploying the VM with the following command, the cpu socket is still invalid, but I saw cpu.corespersocket = 2 in the "Settings" of vm Ps :this is KVM Host cmk deploy virtualmachine zoneid=2bc73a3d-4c92-49da-b323-1142a45dca8c templateid=6802f4cb-2529-48f4-bba9-ff7d82db3ab9 serviceofferingid=b8850bca-88b4-4378-ba70-e87546db58fd name=test-cpu-socket-02 networkids=e28d44cf-9179-4526-81b6-990ef31ec9be details[0].cpu.corespersocket=2 cmk list vm "virtualmachine": [... { "account": "admin", "affinitygroup": [], "cpunumber": 20, "cpuspeed": 2000, "cpuused": "0.05%", "created": "2019-11-25T21:53:39+0800", "details": { "Message.ReservedCapacityFreed.Flag": "false", "cpu.corespersocket": "2", "cpuOvercommitRatio": "4.0", "keyboard": "us", "memoryOvercommitRatio": "2.0" }, "diskioread": 1, "diskiowrite": 213, "diskkbsread": 16, "diskkbswrite": 4610, "displayname": "test-cpu-socket-02", "displayvm": true, "domain": "ROOT", "domainid": "602d9221-e184-11e8-9d95-4ab2a88c1305", "guestosid": "c7a858b6-e184-11e8-9d95-4ab2a88c1305", "haenable": true, "hostid": "f0613074-9b79-4858-9dda-2453bca9c3e6", "hostname": "hcicn03", "hypervisor": "KVM", "id": "f9e32a8c-1d27-4cff-b835-305b11c93fa5", "instancename": "i-2-1133-VM", "isdynamicallyscalable": false, "memory": 4096, "memoryintfreekbs": 755744, "memorykbs": 4194304, "memorytargetkbs": 4194304, "name": "test-cpu-socket-02", "networkkbsread": 0, "networkkbswrite": 0, "nic": [ { "broadcasturi": "vlan://835", "extradhcpoption": [], "gateway": "10.1.1.1", "id": "d756de24-ac07-4ad4-8238-40f6d6f9b10c", "ipaddress": "10.1.1.30", "isdefault": true, "isolationuri": "vlan://835", "macaddress": "02:00:52:aa:00:08", "netmask": "255.255.255.0", "networkid": "e28d44cf-9179-4526-81b6-990ef31ec9be", "networkname": "test-assistanz-mon", "secondaryip": [], "traffictype": "Guest", "type": "Isolated" } ], "ostypeid": "c7a858b6-e184-11e8-9d95-4ab2a88c1305", "passwordenabled": true, "rootdeviceid": 0, "rootdevicetype": "ROOT", "securitygroup": [], "serviceofferingid": "b8850bca-88b4-4378-ba70-e87546db58fd", "serviceofferingname": "SP01-20C4G", "state": "Running", "tags": [], "templatedisplaytext": "Include zabbix agent", "templateid": "6802f4cb-2529-48f4-bba9-ff7d82db3ab9", "templatename": "Centos 7 EN Zabbix", "userid": "d608a7ba-e184-11e8-9d95-4ab2a88c1305", "username": "admin", "zoneid": "2bc73a3d-4c92-49da-b323-1142a45dca8c", "zonename": "zone1" } ] } -----邮件原件----- 发件人: Nii Apleh Lartey <niiap...@live.com<mailto:niiap...@live.com>> 发送时间: 2019年11月25日 21:55 收件人: dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org> 主题: Re: vcpu socket configuration You have a "p" and the end of "details" ________________________________ From: li jerry <div...@hotmail.com<mailto:div...@hotmail.com>> Sent: Monday, November 25, 2019 1:52 PM To: dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org> <dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org>> Subject: 回复: vcpu socket configuration Thank you, Socket doesn't work after I deploy VM with the following command cmk deploy virtualmachine zoneid=2bc73a3d-4c92-49da-b323-1142a45dca8c templateid=6802f4cb-2529-48f4-bba9-ff7d82db3ab9 serviceofferingid=b8850bca-88b4-4378-ba70-e87546db58fd name=test-cpu-socket-02 networkids=e28d44cf-9179-4526-81b6-990ef31ec9be detailsp[0].cpu.corespersocket=2 ps: serviceoffering (localcloud) > list serviceofferings id=b8850bca-88b4-4378-ba70-e87546db58fd { "Count": 1, "serviceoffering": [ { "cpunumber": 20, "cpuspeed": 2000, "created": "2019-08-09T11:11:20+0800", "defaultuse": false, "deploymentplanner": "FirstFitPlanner", "displaytext": "SP01-20C4G", "domain": "ROOT", "domainid": "602d9221-e184-11e8-9d95-4ab2a88c1305", "hosttags": "ha", "id": "b8850bca-88b4-4378-ba70-e87546db58fd", "iscustomized": false, "issystem": false, "isvolatile": false, "limitcpuuse": false, "memory": 4096, "name": "SP01-20C4G", "offerha": true, "provisioningtype": "thin", "serviceofferingdetails": { "domainid": "1" } "storagetype": "shared", "tags": "rbd01" } ] } -----邮件原件----- 发件人: Pierre-Luc Dion <pdion...@apache.org<mailto:pdion...@apache.org>> 发送时间: 2019年11月25日 21:36 收件人: dev@cloudstack.apache.org<mailto:dev@cloudstack.apache.org> 主题: Re: vcpu socket configuration Using cloudmonkey or cmk, you can specify the number of socket at the vm create using : "details[0].cpu.corespersocket=6" so if you define 8 vcpu with details[0].cpu.corespersocket=4 the vm will have 4 sockets @2cores. On Sun, Nov 24, 2019 at 8:41 AM li jerry <div...@hotmail.com<mailto:div...@hotmail.com>> wrote: > Hello All > > We found in the process of use, when the vcpu in service_offering is a > multiple of 6, vm cpu socket =vcpu/6, when vcpu is a multiple of 4, vm > cpu > socket=vcpu/4 > > > Excuse me, why do we design this way? > > In my application scenario, there are restrictions on cpu socket, so I > want to lock the socket to cpu socket=vcpu/2, what are the drawbacks? > (Of course, I will exclude the singular vcpu) > > > > > -Jerry >