sureshanaparti commented on a change in pull request #5339:
URL: https://github.com/apache/cloudstack/pull/5339#discussion_r693912315



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5988,6 +5996,18 @@ public VirtualMachine migrateVirtualMachine(Long vmId, 
Host destinationHost) thr
         return findMigratedVm(vm.getId(), vm.getType());
     }
 
+    private void checkVmDestinationServerCapacity(VMInstanceVO vm, Host 
destinationHost) {
+        // check server capacity
+        ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), 
vm.getServiceOfferingId());
+        boolean hostHasCapacity = 
_capacityMgr.checkIfHostHasCpuCapability(destinationHost.getId(), 
offering.getCpu(), offering.getSpeed())
+                && 
_capacityMgr.checkIfHostHasCapacity(destinationHost.getId(), offering.getCpu() 
* offering.getSpeed(), offering.getRamSize() * 1024L * 1024L, false,
+                
_capacityMgr.getClusterOverProvisioningFactor(destinationHost.getClusterId(), 
Capacity.CAPACITY_TYPE_CPU),
+                
_capacityMgr.getClusterOverProvisioningFactor(destinationHost.getClusterId(), 
Capacity.CAPACITY_TYPE_MEMORY), false);
+        if (! hostHasCapacity) {

Review comment:
       ```suggestion
           if (!hostHasCapacity) {
   ```




-- 
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