fenceAgents.add(fenceAgent); host.setFenceAgents(fenceAgents); hostModel.getFenceAgentListModel().setItems(hostModel.getFenceAgentModelList(host)); }), getSelectedItem().getId());
@Override public Host update(Host incoming) { QueryIdResolver<Guid> hostResolver = new QueryIdResolver<>(QueryType.GetVdsByVdsId, IdQueryParameters.class); VDS entity = getEntity(hostResolver, true); BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations(this, incoming.getExternalNetworkProviderConfigurations()); // if fence agents list is null set it to null in entity if(incoming.getAgents() == null) { entity.setFenceAgents(null); } if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if (!clusterId.equals(entity.getClusterId())) { performAction(ActionType.ChangeVDSCluster, new ChangeVDSClusterParameters(clusterId, guid)); // After changing the cluster with the specialized command we need to reload the entity, so that it // contains the new cluster id. If we don't do this the next command will think that we are trying // to change the cluster, and it will explicitly refuse to perform the update. entity = getEntity(hostResolver, true); } } Host host = performUpdate(incoming, entity, map(entity), hostResolver, ActionType.UpdateVds, new UpdateParametersProvider()); return host; }
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; }
vds.setNumaNodeList(getNumaNodeList()); vds.setAutoNumaBalancing(getAutoNumaBalancing()); vds.setFenceAgents(getFenceAgents()); vds.setClusterCompatibilityVersion(getClusterCompatibilityVersion()); vds.setUpdateAvailable(isUpdateAvailable());