You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by we...@apache.org on 2024/02/13 09:40:32 UTC
(cloudstack) branch main updated (3291a62fc12 -> 90526419a3d)
This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
from 3291a62fc12 Allow locking and unlocking users via UI (#8337)
add 27520f83fec packaging: bundle cmk in cloudstack-management package (#8574)
add 2729ee110eb Enable over provisioning for SharedMountPoint primary storages (#8481)
add 393f3d7727a linstor: use relative hostname path (#8633)
add af2e277999a Merge remote-tracking branch 'apache/4.18' into 4.19
add a924a110e18 Veeam: revert unnecessary state change if restore backup and attach to another VM (#8614)
add d7362dd332f Migrating volumes filter (#8631)
add 70b634fff21 Linstor: add HA support and small cleanups (#8407)
add 1955d8f3db0 Add advance settings to fine tune DRS imbalance calculation (#8521)
add d8cd1228496 zone wizard: allow only one untagged physical network with guest traffic type (#8625)
add 672206c3124 kvm: ITCO watchdog added (#8282)
add e47a910019d VR: fix issue between VPC VMs and other Public IPs in the same subnet as additional Public IPs (#8599)
add a8028eecbdb Merge remote-tracking branch 'origin/4.18' into 4.19
add bda49ab08ff Merge remote-tracking branch 'shapeblue/merged-4-18' into 4.19
new 93406f5582b Merge remote-tracking branch 'apache/4.19'
new 90526419a3d fix build error after merge-forward
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
api/src/main/java/com/cloud/storage/Storage.java | 20 ++-
.../cloudstack/cluster/ClusterDrsAlgorithm.java | 192 +++++++++++++++------
.../cloudstack/cluster/ClusterDrsService.java | 23 +++
.../test/java/com/cloud/storage/StorageTest.java | 4 +-
.../cluster/ClusterDrsAlgorithmTest.java | 97 +++++++++++
debian/cloudstack-management.install | 1 +
debian/rules | 4 +
packaging/centos7/cloud.spec | 4 +
packaging/centos8/cloud.spec | 4 +
.../org/apache/cloudstack/cluster/Balanced.java | 76 ++++----
.../apache/cloudstack/cluster/BalancedTest.java | 53 ++----
.../org/apache/cloudstack/cluster/Condensed.java | 79 ++++-----
.../apache/cloudstack/cluster/CondensedTest.java | 46 ++---
.../hypervisor/kvm/resource/LibvirtVMDef.java | 4 +-
.../cloudstack/metrics/MetricsServiceImpl.java | 23 ++-
.../response/ClusterMetricsResponse.java | 12 ++
.../kvm/storage/LinstorStorageAdaptor.java | 73 +-------
.../hypervisor/kvm/storage/LinstorStoragePool.java | 133 +++++++++++++-
.../driver/LinstorPrimaryDataStoreDriverImpl.java | 2 +-
.../datastore/provider/LinstorHostListener.java} | 20 +--
.../LinstorPrimaryDatastoreProviderImpl.java | 2 +-
.../storage/datastore/util/LinstorUtil.java | 27 +--
.../configuration/ConfigurationManagerImpl.java | 1 +
.../VpcVirtualNetworkApplianceManagerImpl.java | 17 +-
.../cloudstack/backup/BackupManagerImpl.java | 4 -
.../cloudstack/cluster/ClusterDrsServiceImpl.java | 28 +--
.../cluster/ClusterDrsServiceImplTest.java | 6 +-
systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 7 +-
systemvm/debian/opt/cloud/bin/cs/CsDatabag.py | 6 +
ui/public/locales/en.json | 8 +-
ui/src/components/view/ListView.vue | 3 +
ui/src/components/view/SearchView.vue | 51 +++---
ui/src/config/section/infra/clusters.js | 4 +-
ui/src/views/infra/ClusterDRSTab.vue | 18 +-
ui/src/views/infra/zone/ZoneWizardLaunchZone.vue | 3 +
.../zone/ZoneWizardPhysicalNetworkSetupStep.vue | 70 ++++++--
36 files changed, 730 insertions(+), 395 deletions(-)
create mode 100644 api/src/test/java/org/apache/cloudstack/cluster/ClusterDrsAlgorithmTest.java
copy plugins/storage/volume/{flasharray/src/main/java/org/apache/cloudstack/storage/datastore/provider/FlashArrayPrimaryDatastoreProviderImpl.java => linstor/src/main/java/org/apache/cloudstack/storage/datastore/provider/LinstorHostListener.java} (64%)
(cloudstack) 02/02: fix build error after merge-forward
Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 90526419a3deeb3db424331eccf7035706560d61
Author: Wei Zhou <we...@apache.org>
AuthorDate: Tue Feb 13 10:40:15 2024 +0100
fix build error after merge-forward
---
.../cloudstack/metrics/MetricsServiceImpl.java | 2 +-
.../hypervisor/kvm/storage/LinstorStoragePool.java | 29 +++++++++++-----------
.../VpcVirtualNetworkApplianceManagerImpl.java | 4 +--
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java b/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
index 320660417dc..0a6e6e8f4fd 100644
--- a/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
+++ b/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
@@ -789,7 +789,7 @@ public class MetricsServiceImpl extends MutualExclusiveIdsManagerBase implements
Double imbalance = ClusterDrsAlgorithm.getClusterImbalance(clusterId, cpuList, memoryList, null);
metricsResponse.setDrsImbalance(imbalance.isNaN() ? null : 100.0 * imbalance);
} catch (ConfigurationException e) {
- LOGGER.warn("Failed to get cluster imbalance for cluster " + clusterId, e);
+ logger.warn("Failed to get cluster imbalance for cluster " + clusterId, e);
}
metricsResponse.setState(clusterResponse.getAllocationState(), clusterResponse.getManagedState());
diff --git a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStoragePool.java b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStoragePool.java
index 4077d5dadfd..2d6801049a3 100644
--- a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStoragePool.java
+++ b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStoragePool.java
@@ -34,11 +34,12 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import org.apache.cloudstack.utils.qemu.QemuImg;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.joda.time.Duration;
public class LinstorStoragePool implements KVMStoragePool {
- private static final Logger s_logger = Logger.getLogger(LinstorStoragePool.class);
+ private static final Logger LOGGER = LogManager.getLogger(LinstorStoragePool.class);
private final String _uuid;
private final String _sourceHost;
private final int _sourcePort;
@@ -226,12 +227,12 @@ public class LinstorStoragePool implements KVMStoragePool {
@Override
public String createHeartBeatCommand(HAStoragePool pool, String hostPrivateIp,
boolean hostValidation) {
- s_logger.trace(String.format("Linstor.createHeartBeatCommand: %s, %s, %b", pool.getPoolIp(), hostPrivateIp, hostValidation));
+ LOGGER.trace(String.format("Linstor.createHeartBeatCommand: %s, %s, %b", pool.getPoolIp(), hostPrivateIp, hostValidation));
boolean isStorageNodeUp = checkingHeartBeat(pool, null);
if (!isStorageNodeUp && !hostValidation) {
//restart the host
- s_logger.debug(String.format("The host [%s] will be restarted because the health check failed for the storage pool [%s]", hostPrivateIp, pool.getPool().getType()));
- Script cmd = new Script(pool.getPool().getHearthBeatPath(), Duration.millis(HeartBeatUpdateTimeout), s_logger);
+ LOGGER.debug(String.format("The host [%s] will be restarted because the health check failed for the storage pool [%s]", hostPrivateIp, pool.getPool().getType()));
+ Script cmd = new Script(pool.getPool().getHearthBeatPath(), Duration.millis(HeartBeatUpdateTimeout), LOGGER);
cmd.add("-c");
cmd.execute();
return "Down";
@@ -247,7 +248,7 @@ public class LinstorStoragePool implements KVMStoragePool {
static String getHostname() {
OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
- Script sc = new Script("hostname", Duration.millis(10000L), s_logger);
+ Script sc = new Script("hostname", Duration.millis(10000L), LOGGER);
String res = sc.execute(parser);
if (res != null) {
throw new CloudRuntimeException(String.format("Unable to run 'hostname' command: %s", res));
@@ -264,7 +265,7 @@ public class LinstorStoragePool implements KVMStoragePool {
} else {
hostName = host.getParent();
if (hostName == null) {
- s_logger.error("No hostname set in host.getParent()");
+ LOGGER.error("No hostname set in host.getParent()");
return false;
}
}
@@ -273,7 +274,7 @@ public class LinstorStoragePool implements KVMStoragePool {
}
private String executeDrbdSetupStatus(OutputInterpreter.AllLinesParser parser) {
- Script sc = new Script("drbdsetup", Duration.millis(HeartBeatUpdateTimeout), s_logger);
+ Script sc = new Script("drbdsetup", Duration.millis(HeartBeatUpdateTimeout), LOGGER);
sc.add("status");
sc.add("--json");
return sc.execute(parser);
@@ -293,12 +294,12 @@ public class LinstorStoragePool implements KVMStoragePool {
}
}
}
- s_logger.warn(String.format("checkDrbdSetupStatusOutput: no resource connected to %s.", otherNodeName));
+ LOGGER.warn(String.format("checkDrbdSetupStatusOutput: no resource connected to %s.", otherNodeName));
return false;
}
private String executeDrbdEventsNow(OutputInterpreter.AllLinesParser parser) {
- Script sc = new Script("drbdsetup", Duration.millis(HeartBeatUpdateTimeout), s_logger);
+ Script sc = new Script("drbdsetup", Duration.millis(HeartBeatUpdateTimeout), LOGGER);
sc.add("events2");
sc.add("--now");
return sc.execute(parser);
@@ -307,13 +308,13 @@ public class LinstorStoragePool implements KVMStoragePool {
private boolean checkDrbdEventsNowOutput(String output) {
boolean healthy = output.lines().noneMatch(line -> line.matches(".*role:Primary .* promotion_score:0.*"));
if (!healthy) {
- s_logger.warn("checkDrbdEventsNowOutput: primary resource with promotion score==0; HA false");
+ LOGGER.warn("checkDrbdEventsNowOutput: primary resource with promotion score==0; HA false");
}
return healthy;
}
private boolean checkHostUpToDateAndConnected(String hostName) {
- s_logger.trace(String.format("checkHostUpToDateAndConnected: %s/%s", localNodeName, hostName));
+ LOGGER.trace(String.format("checkHostUpToDateAndConnected: %s/%s", localNodeName, hostName));
OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser();
if (localNodeName.equalsIgnoreCase(hostName)) {
@@ -331,7 +332,7 @@ public class LinstorStoragePool implements KVMStoragePool {
try {
return checkDrbdSetupStatusOutput(parser.getLines(), hostName);
} catch (JsonIOException | JsonSyntaxException e) {
- s_logger.error("Error parsing drbdsetup status --json", e);
+ LOGGER.error("Error parsing drbdsetup status --json", e);
}
}
return false;
@@ -339,7 +340,7 @@ public class LinstorStoragePool implements KVMStoragePool {
@Override
public Boolean vmActivityCheck(HAStoragePool pool, HostTO host, Duration activityScriptTimeout, String volumeUUIDListString, String vmActivityCheckPath, long duration) {
- s_logger.trace(String.format("Linstor.vmActivityCheck: %s, %s", pool.getPoolIp(), host.getPrivateNetwork().getIp()));
+ LOGGER.trace(String.format("Linstor.vmActivityCheck: %s, %s", pool.getPoolIp(), host.getPrivateNetwork().getIp()));
return checkingHeartBeat(pool, host);
}
}
diff --git a/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index a46c2fd81ea..c09df8d8655 100644
--- a/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -305,9 +305,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
List<IPAddressVO> vpcIps = _ipAddressDao.listByAssociatedVpc(router.getVpcId(), true);
if (CollectionUtils.isNotEmpty(vpcIps)) {
buf.append(String.format(" source_nat_ip=%s", vpcIps.get(0).getAddress().toString()));
- if (s_logger.isDebugEnabled()) {
- s_logger.debug("The final Boot Args for " + profile + ": " + buf);
- }
+ logger.debug("The final Boot Args for " + profile + ": " + buf);
}
}
}
(cloudstack) 01/02: Merge remote-tracking branch 'apache/4.19'
Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 93406f5582bbccfa39b7b2cbe7d38aaef98195da
Merge: 3291a62fc12 bda49ab08ff
Author: Wei Zhou <we...@apache.org>
AuthorDate: Tue Feb 13 10:38:21 2024 +0100
Merge remote-tracking branch 'apache/4.19'
api/src/main/java/com/cloud/storage/Storage.java | 20 ++-
.../cloudstack/cluster/ClusterDrsAlgorithm.java | 192 +++++++++++++++------
.../cloudstack/cluster/ClusterDrsService.java | 23 +++
.../test/java/com/cloud/storage/StorageTest.java | 4 +-
.../cluster/ClusterDrsAlgorithmTest.java | 97 +++++++++++
debian/cloudstack-management.install | 1 +
debian/rules | 4 +
packaging/centos7/cloud.spec | 4 +
packaging/centos8/cloud.spec | 4 +
.../org/apache/cloudstack/cluster/Balanced.java | 76 ++++----
.../apache/cloudstack/cluster/BalancedTest.java | 53 ++----
.../org/apache/cloudstack/cluster/Condensed.java | 79 ++++-----
.../apache/cloudstack/cluster/CondensedTest.java | 46 ++---
.../hypervisor/kvm/resource/LibvirtVMDef.java | 4 +-
.../cloudstack/metrics/MetricsServiceImpl.java | 23 ++-
.../response/ClusterMetricsResponse.java | 12 ++
.../kvm/storage/LinstorStorageAdaptor.java | 73 +-------
.../hypervisor/kvm/storage/LinstorStoragePool.java | 132 +++++++++++++-
.../driver/LinstorPrimaryDataStoreDriverImpl.java | 2 +-
.../datastore/provider/LinstorHostListener.java | 32 ++++
.../LinstorPrimaryDatastoreProviderImpl.java | 2 +-
.../storage/datastore/util/LinstorUtil.java | 27 +--
.../configuration/ConfigurationManagerImpl.java | 1 +
.../VpcVirtualNetworkApplianceManagerImpl.java | 19 +-
.../cloudstack/backup/BackupManagerImpl.java | 4 -
.../cloudstack/cluster/ClusterDrsServiceImpl.java | 28 +--
.../cluster/ClusterDrsServiceImplTest.java | 6 +-
systemvm/debian/opt/cloud/bin/cs/CsAddress.py | 7 +-
systemvm/debian/opt/cloud/bin/cs/CsDatabag.py | 6 +
ui/public/locales/en.json | 8 +-
ui/src/components/view/ListView.vue | 3 +
ui/src/components/view/SearchView.vue | 51 +++---
ui/src/config/section/infra/clusters.js | 4 +-
ui/src/views/infra/ClusterDRSTab.vue | 18 +-
ui/src/views/infra/zone/ZoneWizardLaunchZone.vue | 3 +
.../zone/ZoneWizardPhysicalNetworkSetupStep.vue | 70 ++++++--
36 files changed, 753 insertions(+), 385 deletions(-)
diff --cc api/src/main/java/com/cloud/storage/Storage.java
index 2ef424adcb0,1163fcc892f..c997f5e1dbf
--- a/api/src/main/java/com/cloud/storage/Storage.java
+++ b/api/src/main/java/com/cloud/storage/Storage.java
@@@ -139,72 -135,37 +139,72 @@@ public class Storage
ISODISK /* Template corresponding to a iso (non root disk) present in an OVA */
}
- public static enum StoragePoolType {
- Filesystem(false, true, true), // local directory
- NetworkFilesystem(true, true, true), // NFS
- IscsiLUN(true, false, false), // shared LUN, with a clusterfs overlay
- Iscsi(true, false, false), // for e.g., ZFS Comstar
- ISO(false, false, false), // for iso image
- LVM(false, false, false), // XenServer local LVM SR
- CLVM(true, false, false),
- RBD(true, true, false), // http://libvirt.org/storage.html#StorageBackendRBD
- SharedMountPoint(true, true, true),
- VMFS(true, true, false), // VMware VMFS storage
- PreSetup(true, true, false), // for XenServer, Storage Pool is set up by customers.
- EXT(false, true, false), // XenServer local EXT SR
- OCFS2(true, false, false),
- SMB(true, false, false),
- Gluster(true, false, false),
- PowerFlex(true, true, true), // Dell EMC PowerFlex/ScaleIO (formerly VxFlexOS)
- ManagedNFS(true, false, false),
- Linstor(true, true, false),
- DatastoreCluster(true, true, false), // for VMware, to abstract pool of clusters
- StorPool(true, true, true),
- FiberChannel(true, true, false); // Fiber Channel Pool for KVM hypervisors is used to find the volume by WWN value (/dev/disk/by-id/wwn-<wwnvalue>)
-
+ /**
+ * StoragePoolTypes carry some details about the format and capabilities of a storage pool. While not necessarily a
+ * 1:1 with PrimaryDataStoreDriver (and for KVM agent, KVMStoragePool and StorageAdaptor) implementations, it is
+ * often used to decide which storage plugin or storage command to call, so it may be necessary for new storage
+ * plugins to add a StoragePoolType. This can be done by adding it below, or by creating a new public static final
+ * instance of StoragePoolType in the plugin itself, which registers it with the map.
+ *
+ * Note that if the StoragePoolType is for KVM and defined in plugin code rather than below, care must be taken to
+ * ensure this is available on the agent side as well. This is best done by defining the StoragePoolType in a common
+ * package available on both management server and agent plugin jars.
+ */
+ public static class StoragePoolType {
+ private static final Map<String, StoragePoolType> map = new LinkedHashMap<>();
+
+ public static final StoragePoolType Filesystem = new StoragePoolType("Filesystem", false, true, true);
+ public static final StoragePoolType NetworkFilesystem = new StoragePoolType("NetworkFilesystem", true, true, true);
+ public static final StoragePoolType IscsiLUN = new StoragePoolType("IscsiLUN", true, false, false);
+ public static final StoragePoolType Iscsi = new StoragePoolType("Iscsi", true, false, false);
+ public static final StoragePoolType ISO = new StoragePoolType("ISO", false, false, false);
+ public static final StoragePoolType LVM = new StoragePoolType("LVM", false, false, false);
+ public static final StoragePoolType CLVM = new StoragePoolType("CLVM", true, false, false);
+ public static final StoragePoolType RBD = new StoragePoolType("RBD", true, true, false);
- public static final StoragePoolType SharedMountPoint = new StoragePoolType("SharedMountPoint", true, false, true);
++ public static final StoragePoolType SharedMountPoint = new StoragePoolType("SharedMountPoint", true, true, true);
+ public static final StoragePoolType VMFS = new StoragePoolType("VMFS", true, true, false);
+ public static final StoragePoolType PreSetup = new StoragePoolType("PreSetup", true, true, false);
+ public static final StoragePoolType EXT = new StoragePoolType("EXT", false, true, false);
+ public static final StoragePoolType OCFS2 = new StoragePoolType("OCFS2", true, false, false);
+ public static final StoragePoolType SMB = new StoragePoolType("SMB", true, false, false);
+ public static final StoragePoolType Gluster = new StoragePoolType("Gluster", true, false, false);
+ public static final StoragePoolType PowerFlex = new StoragePoolType("PowerFlex", true, true, true);
+ public static final StoragePoolType ManagedNFS = new StoragePoolType("ManagedNFS", true, false, false);
+ public static final StoragePoolType Linstor = new StoragePoolType("Linstor", true, true, false);
+ public static final StoragePoolType DatastoreCluster = new StoragePoolType("DatastoreCluster", true, true, false);
+ public static final StoragePoolType StorPool = new StoragePoolType("StorPool", true,true,true);
+ public static final StoragePoolType FiberChannel = new StoragePoolType("FiberChannel", true,true,false);
+
+
+ private final String name;
private final boolean shared;
- private final boolean overprovisioning;
+ private final boolean overProvisioning;
private final boolean encryption;
- StoragePoolType(boolean shared, boolean overProvisioning, boolean encryption) {
+ /**
+ * New StoragePoolType, set the name to check with it in Dao (Note: Do not register it into the map of pool types).
+ * @param name name of the StoragePoolType.
+ */
+ public StoragePoolType(String name) {
+ this.name = name;
+ this.shared = false;
- this.overprovisioning = false;
++ this.overProvisioning = false;
+ this.encryption = false;
+ }
+
+ /**
+ * Define a new StoragePoolType, and register it into the map of pool types known to the management server.
+ * @param name Simple unique name of the StoragePoolType.
+ * @param shared Storage pool is shared/accessible to multiple hypervisors
- * @param overprovisioning Storage pool supports overprovisioning
++ * @param overProvisioning Storage pool supports overProvisioning
+ * @param encryption Storage pool supports encrypted volumes
+ */
- public StoragePoolType(String name, boolean shared, boolean overprovisioning, boolean encryption) {
++ public StoragePoolType(String name, boolean shared, boolean overProvisioning, boolean encryption) {
+ this.name = name;
this.shared = shared;
- this.overprovisioning = overprovisioning;
+ this.overProvisioning = overProvisioning;
this.encryption = encryption;
+ addStoragePoolType(this);
}
public boolean isShared() {
@@@ -212,52 -173,12 +212,54 @@@
}
public boolean supportsOverProvisioning() {
- return overprovisioning;
+ return overProvisioning;
}
- public boolean supportsEncryption() { return encryption; }
+ public boolean supportsEncryption() {
+ return encryption;
+ }
+
+ private static void addStoragePoolType(StoragePoolType storagePoolType) {
+ map.putIfAbsent(storagePoolType.name, storagePoolType);
+ }
+
+ public static StoragePoolType[] values() {
+ return map.values().toArray(StoragePoolType[]::new).clone();
+ }
+
+ public static StoragePoolType valueOf(String name) {
+ if (StringUtils.isBlank(name)) {
+ return null;
+ }
+
+ StoragePoolType storage = map.get(name);
+ if (storage == null) {
+ throw new IllegalArgumentException("StoragePoolType '" + name + "' not found");
+ }
+ return storage;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+ public String name() {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ StoragePoolType that = (StoragePoolType) o;
+ return Objects.equals(name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name);
+ }
}
public static List<StoragePoolType> getNonSharedStoragePoolTypes() {
diff --cc plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
index de231f3b594,101e8d3597e..f3a70b079be
--- a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
+++ b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
@@@ -32,12 -30,9 +30,10 @@@ import org.apache.cloudstack.storage.da
import org.apache.cloudstack.utils.qemu.QemuImg;
import org.apache.cloudstack.utils.qemu.QemuImgException;
import org.apache.cloudstack.utils.qemu.QemuImgFile;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.libvirt.LibvirtException;
- import com.cloud.storage.Storage;
- import com.cloud.utils.exception.CloudRuntimeException;
import com.linbit.linstor.api.ApiClient;
import com.linbit.linstor.api.ApiException;
import com.linbit.linstor.api.Configuration;
@@@ -75,35 -65,13 +70,13 @@@ public class LinstorStorageAdaptor impl
return LinstorUtil.RSC_PREFIX + name;
}
- private String getHostname() {
- // either there is already some function for that in the agent or a better way.
- ProcessBuilder pb = new ProcessBuilder("/usr/bin/hostname");
- try
- {
- String result;
- Process p = pb.start();
- final BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
-
- StringJoiner sj = new StringJoiner(System.getProperty("line.separator"));
- reader.lines().iterator().forEachRemaining(sj::add);
- result = sj.toString();
-
- p.waitFor();
- p.destroy();
- return result.trim();
- } catch (IOException | InterruptedException exc) {
- Thread.currentThread().interrupt();
- throw new CloudRuntimeException("Unable to run '/usr/bin/hostname' command.");
- }
- }
-
private void logLinstorAnswer(@Nonnull ApiCallRc answer) {
if (answer.isError()) {
- s_logger.error(answer.getMessage());
+ logger.error(answer.getMessage());
} else if (answer.isWarning()) {
- s_logger.warn(answer.getMessage());
+ logger.warn(answer.getMessage());
} else if (answer.isInfo()) {
- s_logger.info(answer.getMessage());
+ logger.info(answer.getMessage());
}
}
diff --cc plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
index c0c55a9ceae,e953c94db22..a8635b404b3
--- a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
+++ b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
@@@ -146,13 -144,13 +145,13 @@@ public class LinstorUtil
null,
null);
- if (rscGrps.isEmpty()) {
- final String errMsg = String.format("Linstor: Resource group '%s' not found", rscGroupName);
- LOGGER.error(errMsg);
- throw new CloudRuntimeException(errMsg);
- }
+ if (rscGrps.isEmpty()) {
+ final String errMsg = String.format("Linstor: Resource group '%s' not found", rscGroupName);
- s_logger.error(errMsg);
++ LOGGER.error(errMsg);
+ throw new CloudRuntimeException(errMsg);
+ }
- List<StoragePool> storagePools = linstorApi.viewStoragePools(
+ return api.viewStoragePools(
Collections.emptyList(),
rscGrps.get(0).getSelectFilter().getStoragePoolList(),
null,
diff --cc server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 048dc356ff5,aebeb5c9398..a46c2fd81ea
--- a/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/main/java/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@@ -27,6 -27,8 +27,7 @@@ import java.util.Map
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+ import org.apache.commons.collections.CollectionUtils;
-import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.Answer;