Skip to content

Commit 0d1fc0c

Browse files
author
SadiJr
committed
Merge branch 'main' into veeam-check-failure-when-restoring
2 parents 42bbf17 + 399bd0a commit 0d1fc0c

File tree

494 files changed

+4915
-1206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+4915
-1206
lines changed

.asf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ github:
5353
- acs-robot
5454
- kiranchavala
5555
- rajujith
56-
- alexandremattioli
5756
- vishesh92
5857
- GaOrtiga
5958
- SadiJr

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
cache: maven
4242

4343
- name: Set up Python
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v5
4545
with:
4646
python-version: '3.8'
4747
architecture: 'x64'

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
cache: maven
212212

213213
- name: Set up Python
214-
uses: actions/setup-python@v4
214+
uses: actions/setup-python@v5
215215
with:
216216
python-version: '3.8'
217217
architecture: 'x64'

agent/conf/agent.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -378,6 +378,10 @@ iscsi.session.cleanup.enabled=false
378378
# If the time is exceeded shutdown will be forced.
379379
#stop.script.timeout=120
380380

381+
# Time (in seconds) to wait for scripts to complete.
382+
# This is currently used only while checking if the host supports UEFI.
383+
#agent.script.timeout=60
384+
381385
# Definition of VMs video model type.
382386
#vm.video.hardware=
383387

agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.19.0.0-SNAPSHOT</version>
27+
<version>4.20.0.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@ public class AgentProperties{
659659
*/
660660
public static final Property<Integer> STOP_SCRIPT_TIMEOUT = new Property<>("stop.script.timeout", 120);
661661

662+
/**
663+
* Time (in seconds) to wait for scripts to complete.<br>
664+
* This is currently used only while checking if the host supports UEFI.<br>
665+
* Data type: Integer.<br>
666+
* Default value: <code>60</code>
667+
*/
668+
public static final Property<Integer> AGENT_SCRIPT_TIMEOUT = new Property<>("agent.script.timeout", 60);
669+
662670
/**
663671
* Definition of VMs video model type.<br>
664672
* Data type: String.<br>

agent/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.19.0.0-SNAPSHOT</version>
27+
<version>4.20.0.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ public class EventTypes {
400400
public static final String EVENT_IMAGE_STORE_DATA_MIGRATE = "IMAGE.STORE.MIGRATE.DATA";
401401
public static final String EVENT_IMAGE_STORE_RESOURCES_MIGRATE = "IMAGE.STORE.MIGRATE.RESOURCES";
402402
public static final String EVENT_IMAGE_STORE_OBJECT_DOWNLOAD = "IMAGE.STORE.OBJECT.DOWNLOAD";
403+
public static final String EVENT_UPDATE_IMAGE_STORE_ACCESS_STATE = "IMAGE.STORE.ACCESS.UPDATED";
403404

404405
// Configuration Table
405406
public static final String EVENT_CONFIGURATION_VALUE_EDIT = "CONFIGURATION.VALUE.EDIT";
@@ -1164,6 +1165,7 @@ public class EventTypes {
11641165

11651166
entityEventDetails.put(EVENT_IMAGE_STORE_DATA_MIGRATE, ImageStore.class);
11661167
entityEventDetails.put(EVENT_IMAGE_STORE_OBJECT_DOWNLOAD, ImageStore.class);
1168+
entityEventDetails.put(EVENT_UPDATE_IMAGE_STORE_ACCESS_STATE, ImageStore.class);
11671169
entityEventDetails.put(EVENT_LIVE_PATCH_SYSTEMVM, "SystemVMs");
11681170

11691171
//Object Store

api/src/main/java/com/cloud/storage/Storage.java

Lines changed: 107 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
// under the License.
1717
package com.cloud.storage;
1818

19-
import org.apache.commons.lang.NotImplementedException;
20-
2119
import java.util.ArrayList;
20+
import java.util.LinkedHashMap;
2221
import java.util.List;
22+
import java.util.Map;
23+
import java.util.Objects;
24+
25+
import org.apache.commons.lang.NotImplementedException;
26+
import org.apache.commons.lang3.StringUtils;
2327

2428
public class Storage {
2529
public static enum ImageFormat {
@@ -135,37 +139,72 @@ public static enum TemplateType {
135139
ISODISK /* Template corresponding to a iso (non root disk) present in an OVA */
136140
}
137141

138-
public static enum StoragePoolType {
139-
Filesystem(false, true, true), // local directory
140-
NetworkFilesystem(true, true, true), // NFS
141-
IscsiLUN(true, false, false), // shared LUN, with a clusterfs overlay
142-
Iscsi(true, false, false), // for e.g., ZFS Comstar
143-
ISO(false, false, false), // for iso image
144-
LVM(false, false, false), // XenServer local LVM SR
145-
CLVM(true, false, false),
146-
RBD(true, true, false), // http://libvirt.org/storage.html#StorageBackendRBD
147-
SharedMountPoint(true, false, true),
148-
VMFS(true, true, false), // VMware VMFS storage
149-
PreSetup(true, true, false), // for XenServer, Storage Pool is set up by customers.
150-
EXT(false, true, false), // XenServer local EXT SR
151-
OCFS2(true, false, false),
152-
SMB(true, false, false),
153-
Gluster(true, false, false),
154-
PowerFlex(true, true, true), // Dell EMC PowerFlex/ScaleIO (formerly VxFlexOS)
155-
ManagedNFS(true, false, false),
156-
Linstor(true, true, false),
157-
DatastoreCluster(true, true, false), // for VMware, to abstract pool of clusters
158-
StorPool(true, true, true),
159-
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>)
160-
142+
/**
143+
* StoragePoolTypes carry some details about the format and capabilities of a storage pool. While not necessarily a
144+
* 1:1 with PrimaryDataStoreDriver (and for KVM agent, KVMStoragePool and StorageAdaptor) implementations, it is
145+
* often used to decide which storage plugin or storage command to call, so it may be necessary for new storage
146+
* plugins to add a StoragePoolType. This can be done by adding it below, or by creating a new public static final
147+
* instance of StoragePoolType in the plugin itself, which registers it with the map.
148+
*
149+
* Note that if the StoragePoolType is for KVM and defined in plugin code rather than below, care must be taken to
150+
* ensure this is available on the agent side as well. This is best done by defining the StoragePoolType in a common
151+
* package available on both management server and agent plugin jars.
152+
*/
153+
public static class StoragePoolType {
154+
private static final Map<String, StoragePoolType> map = new LinkedHashMap<>();
155+
156+
public static final StoragePoolType Filesystem = new StoragePoolType("Filesystem", false, true, true);
157+
public static final StoragePoolType NetworkFilesystem = new StoragePoolType("NetworkFilesystem", true, true, true);
158+
public static final StoragePoolType IscsiLUN = new StoragePoolType("IscsiLUN", true, false, false);
159+
public static final StoragePoolType Iscsi = new StoragePoolType("Iscsi", true, false, false);
160+
public static final StoragePoolType ISO = new StoragePoolType("ISO", false, false, false);
161+
public static final StoragePoolType LVM = new StoragePoolType("LVM", false, false, false);
162+
public static final StoragePoolType CLVM = new StoragePoolType("CLVM", true, false, false);
163+
public static final StoragePoolType RBD = new StoragePoolType("RBD", true, true, false);
164+
public static final StoragePoolType SharedMountPoint = new StoragePoolType("SharedMountPoint", true, false, true);
165+
public static final StoragePoolType VMFS = new StoragePoolType("VMFS", true, true, false);
166+
public static final StoragePoolType PreSetup = new StoragePoolType("PreSetup", true, true, false);
167+
public static final StoragePoolType EXT = new StoragePoolType("EXT", false, true, false);
168+
public static final StoragePoolType OCFS2 = new StoragePoolType("OCFS2", true, false, false);
169+
public static final StoragePoolType SMB = new StoragePoolType("SMB", true, false, false);
170+
public static final StoragePoolType Gluster = new StoragePoolType("Gluster", true, false, false);
171+
public static final StoragePoolType PowerFlex = new StoragePoolType("PowerFlex", true, true, true);
172+
public static final StoragePoolType ManagedNFS = new StoragePoolType("ManagedNFS", true, false, false);
173+
public static final StoragePoolType Linstor = new StoragePoolType("Linstor", true, true, false);
174+
public static final StoragePoolType DatastoreCluster = new StoragePoolType("DatastoreCluster", true, true, false);
175+
public static final StoragePoolType StorPool = new StoragePoolType("StorPool", true,true,true);
176+
public static final StoragePoolType FiberChannel = new StoragePoolType("FiberChannel", true,true,false);
177+
178+
179+
private final String name;
161180
private final boolean shared;
162181
private final boolean overprovisioning;
163182
private final boolean encryption;
164183

165-
StoragePoolType(boolean shared, boolean overprovisioning, boolean encryption) {
184+
/**
185+
* New StoragePoolType, set the name to check with it in Dao (Note: Do not register it into the map of pool types).
186+
* @param name name of the StoragePoolType.
187+
*/
188+
public StoragePoolType(String name) {
189+
this.name = name;
190+
this.shared = false;
191+
this.overprovisioning = false;
192+
this.encryption = false;
193+
}
194+
195+
/**
196+
* Define a new StoragePoolType, and register it into the map of pool types known to the management server.
197+
* @param name Simple unique name of the StoragePoolType.
198+
* @param shared Storage pool is shared/accessible to multiple hypervisors
199+
* @param overprovisioning Storage pool supports overprovisioning
200+
* @param encryption Storage pool supports encrypted volumes
201+
*/
202+
public StoragePoolType(String name, boolean shared, boolean overprovisioning, boolean encryption) {
203+
this.name = name;
166204
this.shared = shared;
167205
this.overprovisioning = overprovisioning;
168206
this.encryption = encryption;
207+
addStoragePoolType(this);
169208
}
170209

171210
public boolean isShared() {
@@ -177,6 +216,48 @@ public boolean supportsOverProvisioning() {
177216
}
178217

179218
public boolean supportsEncryption() { return encryption; }
219+
220+
private static void addStoragePoolType(StoragePoolType storagePoolType) {
221+
map.putIfAbsent(storagePoolType.name, storagePoolType);
222+
}
223+
224+
public static StoragePoolType[] values() {
225+
return map.values().toArray(StoragePoolType[]::new).clone();
226+
}
227+
228+
public static StoragePoolType valueOf(String name) {
229+
if (StringUtils.isBlank(name)) {
230+
return null;
231+
}
232+
233+
StoragePoolType storage = map.get(name);
234+
if (storage == null) {
235+
throw new IllegalArgumentException("StoragePoolType '" + name + "' not found");
236+
}
237+
return storage;
238+
}
239+
240+
@Override
241+
public String toString() {
242+
return name;
243+
}
244+
245+
public String name() {
246+
return name;
247+
}
248+
249+
@Override
250+
public boolean equals(Object o) {
251+
if (this == o) return true;
252+
if (o == null || getClass() != o.getClass()) return false;
253+
StoragePoolType that = (StoragePoolType) o;
254+
return Objects.equals(name, that.name);
255+
}
256+
257+
@Override
258+
public int hashCode() {
259+
return Objects.hash(name);
260+
}
180261
}
181262

182263
public static List<StoragePoolType> getNonSharedStoragePoolTypes() {

0 commit comments

Comments
 (0)