private boolean isSelectAsSpmCommandAllowed(List<VDS> selectedItems) { if (selectedItems.size() != 1) { return false; } VDS vds = selectedItems.get(0); if (vds.getStatus() != VDSStatus.Up || !vds.getClusterSupportsVirtService() || vds.getSpmStatus() != VdsSpmStatus.None) { return false; } if (vds.getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return false; } return true; }
/** * Ensures that the VDS instances are returned according to spm priority */ @Test public void testGetListForSpmSelection() { List<VDS> result = dao.getListForSpmSelection(FixturesTool.DATA_CENTER); assertTrue(result.get(0).getVdsSpmPriority() >= result.get(1).getVdsSpmPriority()); }
setIScsiInitiatorName(vds.getIScsiInitiatorName()); setSpmPriorityValue(vds.getVdsSpmPriority()); setActiveVms(vds.getVmActive());
private static Object cloneVDS(VDS instance) { VDS obj = new VDS(); obj.setHostName(instance.getHostName()); obj.setSshKeyFingerprint(instance.getSshKeyFingerprint()); obj.setSshPort(instance.getSshPort()); obj.setSshUsername(instance.getSshUsername()); obj.setFenceAgents(cloneAgents(instance.getFenceAgents())); obj.setDisablePowerManagementPolicy(instance.isDisablePowerManagementPolicy()); obj.setPmKdumpDetection(instance.isPmKdumpDetection()); obj.setPort(instance.getPort()); obj.setServerSslEnabled(instance.isServerSslEnabled()); obj.setClusterId(instance.getClusterId()); obj.setId(instance.getId()); obj.setVdsName(instance.getName()); obj.setVdsStrength(instance.getVdsStrength()); obj.setVdsType(instance.getVdsType()); obj.setUniqueId(instance.getUniqueId()); obj.setVdsSpmPriority(instance.getVdsSpmPriority()); obj.setCurrentKernelCmdline(instance.getCurrentKernelCmdline()); obj.setKernelCmdlineParsable(instance.isKernelCmdlineParsable()); obj.setLastStoredKernelCmdline(instance.getLastStoredKernelCmdline()); obj.setKernelCmdlineBlacklistNouveau(instance.isKernelCmdlineBlacklistNouveau()); obj.setKernelCmdlineIommu(instance.isKernelCmdlineIommu()); obj.setKernelCmdlineKvmNested(instance.isKernelCmdlineKvmNested()); obj.setKernelCmdlinePciRealloc(instance.isKernelCmdlinePciRealloc()); obj.setKernelCmdlineFips(instance.isKernelCmdlineFips()); obj.setKernelCmdlineUnsafeInterrupts(instance.isKernelCmdlineUnsafeInterrupts()); return obj; }
spm.setPriority(entity.getVdsSpmPriority()); if (entity.getSpmStatus() != null) { spm.setStatus(mapSpmStatus(entity.getSpmStatus()));
updateExternalHostModels(vds.getHostProviderId()); getOverrideIpTables().setIsAvailable(showInstallationProperties()); setSpmPriorityValue(vds.getVdsSpmPriority()); setOriginalName(vds.getName()); getName().setEntity(vds.getName());
vds.setConsoleAddress(getConsoleAddress()); vds.setHBAs(getHBAs()); vds.setVdsSpmPriority(getVdsSpmPriority()); vds.setOtpValidity(getOtpValidity()); vds.setKernelVersion(getKernelVersion());