weizhouapache commented on code in PR #7887:
URL: https://github.com/apache/cloudstack/pull/7887#discussion_r1302788363


##########
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/XenServerGuru.java:
##########
@@ -96,14 +95,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
         if (userVmVO != null) {
             HostVO host = hostDao.findById(userVmVO.getHostId());
             if (host != null) {
-                List<HostVO> clusterHosts = 
hostDao.listByClusterAndHypervisorType(host.getClusterId(), 
host.getHypervisorType());
-                HostVO hostWithMinSocket = 
clusterHosts.stream().min(Comparator.comparing(HostVO::getCpuSockets)).orElse(null);
-                Integer vCpus = 
MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId());
-                if (hostWithMinSocket != null && 
hostWithMinSocket.getCpuSockets() != null &&
-                        hostWithMinSocket.getCpuSockets() < vCpus) {
-                    vCpus = hostWithMinSocket.getCpuSockets();
-                }

Review Comment:
   @DaanHoogland 
   you should add comment to #4672 , not this PR :-D
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to