|
99 | 99 | import com.cloud.exception.InvalidParameterValueException; |
100 | 100 | import com.cloud.exception.PermissionDeniedException; |
101 | 101 | import com.cloud.exception.ResourceInUseException; |
| 102 | +import com.cloud.gpu.GPU; |
102 | 103 | import com.cloud.gpu.HostGpuGroupsVO; |
103 | 104 | import com.cloud.gpu.VGPUTypesVO; |
104 | 105 | import com.cloud.gpu.dao.HostGpuGroupsDao; |
|
125 | 126 | import com.cloud.org.Grouping.AllocationState; |
126 | 127 | import com.cloud.org.Managed; |
127 | 128 | import com.cloud.serializer.GsonHelper; |
| 129 | +import com.cloud.service.dao.ServiceOfferingDetailsDao; |
128 | 130 | import com.cloud.storage.GuestOSCategoryVO; |
129 | 131 | import com.cloud.storage.StorageManager; |
130 | 132 | import com.cloud.storage.StoragePool; |
@@ -223,6 +225,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager, |
223 | 225 | PlannerHostReservationDao _plannerHostReserveDao; |
224 | 226 | @Inject |
225 | 227 | private DedicatedResourceDao _dedicatedDao; |
| 228 | + @Inject |
| 229 | + private ServiceOfferingDetailsDao _serviceOfferingDetailsDao; |
226 | 230 |
|
227 | 231 | private List<? extends Discoverer> _discoverers; |
228 | 232 |
|
@@ -1193,7 +1197,9 @@ private boolean doMaintain(final long hostId) { |
1193 | 1197 |
|
1194 | 1198 | List<HostVO> hosts = listAllUpAndEnabledHosts(Host.Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId()); |
1195 | 1199 | for (final VMInstanceVO vm : vms) { |
1196 | | - if (hosts == null || hosts.isEmpty() || !answer.getMigrate()) { |
| 1200 | + if (hosts == null || hosts.isEmpty() || !answer.getMigrate() |
| 1201 | + || _serviceOfferingDetailsDao.findDetail(vm.getServiceOfferingId(), GPU.Keys.vgpuType.toString()) != null) { |
| 1202 | + // Migration is not supported for VGPU Vms so stop them. |
1197 | 1203 | // for the last host in this cluster, stop all the VMs |
1198 | 1204 | _haMgr.scheduleStop(vm, hostId, WorkType.ForceStop); |
1199 | 1205 | } else if (HypervisorType.LXC.equals(host.getHypervisorType()) && VirtualMachine.Type.User.equals(vm.getType())){ |
|
0 commit comments