@Mapping(from = StoragePool.class, to = Cluster.class) public static Cluster map(StoragePool pool, Cluster template) { Cluster entity = template != null ? template : new Cluster(); if (pool.getCompatibilityVersion() != null) { entity.setCompatibilityVersion(pool.getCompatibilityVersion()); } return entity; }
@Test public void testDefaultRouteWhenOutOfSyncOnOlderCluster() { cluster.setCompatibilityVersion(Version.v4_1); network.setDnsResolverConfiguration(sampleDnsResolverConfiguration); assertThat(createTestedInstance(true, sampleDnsResolverConfiguration).isNetworkInSync(), is(true)); }
protected UnitVmModel initModel(VmModelBehaviorBase behavior) { final Cluster cluster = new Cluster(); cluster.setCompatibilityVersion(CLUSTER_VERSION); UnitVmModel model = spy(createModel(behavior)); doReturn(cluster).when(model).getSelectedCluster(); doReturn(new EntityModel<>(true)).when(model).getIsSingleQxlEnabled(); model.initialize(); model.getInstanceImages().setItems(new ArrayList<InstanceImageLineModel>()); return model; }
protected Cluster getClusterEntity() { Cluster cluster = new Cluster(); cluster.setStoragePoolId(GUIDS[3]); cluster.setArchitecture(ArchitectureType.x86_64); cluster.setCompatibilityVersion(Version.getLast()); return cluster; }
public void setSelectedCluster(VDS host) { ArrayList<Cluster> clusters; if (getCluster().getItems() == null) { Cluster tempVar = new Cluster(); tempVar.setName(host.getClusterName()); tempVar.setId(host.getClusterId()); tempVar.setCompatibilityVersion(host.getClusterCompatibilityVersion()); getCluster() .setItems(new ArrayList<>(Arrays.asList(new Cluster[]{tempVar}))); } clusters = (ArrayList<Cluster>) getCluster().getItems(); updateModelClusterFromVds(clusters, host); if (getCluster().getSelectedItem() == null) { getCluster().setSelectedItem(Linq.firstOrNull(clusters)); } }
cluster.setId(currentVm.getClusterId()); cluster.setName(currentVm.getClusterName()); cluster.setCompatibilityVersion(currentVm.getClusterCompatibilityVersion()); cluster.setStoragePoolId(currentVm.getStoragePoolId()); DataCenterWithCluster dataCenterWithCluster =
&& Boolean.TRUE.equals(clusterModel.getCountThreadsAsCores().getEntity())); cluster.setTransparentHugepages(true); cluster.setCompatibilityVersion(version); cluster.setMigrateOnError(clusterModel.getMigrateOnErrorOption()); ClusterOperationParameters parameters = new ManagementNetworkOnClusterOperationParameters(cluster);
@BeforeEach public void setUp() { sampleDnsResolverConfiguration = new DnsResolverConfiguration(); sampleDnsResolverConfiguration.setNameServers(Arrays.asList( new NameServer("192.168.1.1"), new NameServer("2001:0db8:85a3:0000:0000:8a2e:0370:7334"))); sampleDnsResolverConfiguration2 = new DnsResolverConfiguration(); sampleDnsResolverConfiguration2.setNameServers(Arrays.asList( new NameServer("192.168.1.2"), new NameServer("2002:0db8:85a3:0000:0000:8a2e:0370:7334"))); sampleDnsResolverConfigurationWithReversedNameServers = reverseNameServersOrder(sampleDnsResolverConfiguration); ifaceQos = new HostNetworkQos(); networkQos = new HostNetworkQos(); iface = new VdsNetworkInterface(); //needed because network is vm network by default iface.setBridged(true); iface.setQos(ifaceQos); iface.setReportedSwitchType(SwitchType.LEGACY); iface.setIpv4DefaultRoute(false); iface.setMtu(getDefaultHostMtu()); network = new Network(); network.setDnsResolverConfiguration(sampleDnsResolverConfiguration); testedNetworkAttachment = new NetworkAttachment(); testedNetworkAttachment.setIpConfiguration(new IpConfiguration()); cluster = new Cluster(); cluster.setCompatibilityVersion(Version.v4_2); cluster.setRequiredSwitchTypeForCluster(SwitchType.LEGACY); }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingCluster = dao.get(FixturesTool.CLUSTER_RHEL6_ISCSI); groupWithNoRunningVms = dao.get(FixturesTool.CLUSTER_NO_RUNNING_VMS); newGroup = new Cluster(); newGroup.setName("New VDS Group"); newGroup.setCompatibilityVersion(Version.getLast()); newGroup.setVirtService(true); newGroup.setGlusterService(false); newGroup.setClusterPolicyId(existingCluster.getClusterPolicyId()); // set cluster policy name to allow equals method to succeed newGroup.setClusterPolicyName(clusterPolicyDao.get(existingCluster.getClusterPolicyId(), Collections.emptyMap()).getName()); newGroup.setClusterPolicyProperties(new LinkedHashMap<>()); newGroup.setDetectEmulatedMachine(true); newGroup.setEmulatedMachine("rhel6.4.0"); newGroup.setArchitecture(ArchitectureType.x86_64); newGroup.setGlusterCliBasedSchedulingOn(true); newGroup.setMigrationBandwidthLimitType(MigrationBandwidthLimitType.CUSTOM); newGroup.setCustomMigrationNetworkBandwidth(1000); newGroup.setMigrationPolicyId(Guid.newGuid()); newGroup.setMacPoolId(FixturesTool.DEFAULT_MAC_POOL_ID); newGroup.setFirewallType(FirewallType.FIREWALLD); newGroup.setLogMaxMemoryUsedThreshold(95); newGroup.setLogMaxMemoryUsedThresholdType(LogMaxMemoryUsedThresholdType.PERCENTAGE); newGroup.setVncEncryptionEnabled(true); }
@BeforeEach @Override public void setUp() { Cluster cluster = new Cluster(); cluster.setName("test-cluster"); cluster.setId(Guid.newGuid()); cluster.setCompatibilityVersion(Version.v4_3); cluster.setArchitecture(ArchitectureType.x86); cluster.setMacPoolId(FixturesTool.DEFAULT_MAC_POOL_ID); cluster.setFirewallType(FirewallType.IPTABLES); cluster.setLogMaxMemoryUsedThreshold(95); cluster.setLogMaxMemoryUsedThresholdType(LogMaxMemoryUsedThresholdType.PERCENTAGE); clusterDao.save(cluster); host = new VdsStatic(); host.setId(Guid.newGuid()); host.setName("test-host"); host.setHostName("host-ip"); host.setClusterId(cluster.getId()); vdsDao.save(host); }
private static Cluster cloneCluster(Cluster instance) { Cluster obj = new Cluster(); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setCpuName(instance.getCpuName()); obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); obj.setMigrateOnError(instance.getMigrateOnError()); obj.setTransparentHugepages(instance.getTransparentHugepages()); obj.setStoragePoolId(instance.getStoragePoolId()); obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit()); obj.setCountThreadsAsCores(instance.getCountThreadsAsCores()); obj.setEmulatedMachine(instance.getEmulatedMachine()); obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine()); obj.setArchitecture(instance.getArchitecture()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy()); obj.setCustomSerialNumber(instance.getCustomSerialNumber()); obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy())); obj.setAutoConverge(instance.getAutoConverge()); obj.setMigrateCompressed(instance.getMigrateCompressed()); return obj; }
cluster.setEnableBallooning(Boolean.TRUE.equals(model.getEnableBallooning().getEntity())); cluster.setTransparentHugepages(true); //$NON-NLS-1$ cluster.setCompatibilityVersion(version); cluster.setRequiredSwitchTypeForCluster(model.getSwitchType().getSelectedItem()); cluster.setFirewallType(model.getFirewallType().getSelectedItem());
entity.setCompatibilityVersion(VersionMapper.map(model.getVersion()));