Skip to content

Commit 9406e6e

Browse files
committed
Merge remote-tracking branch 'apache/4.19' into fix-kvm-securebootvm-diskcontroller
2 parents d10d510 + 422264f commit 9406e6e

File tree

357 files changed

+4680
-1866
lines changed

Some content is hidden

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

357 files changed

+4680
-1866
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
233233
- name: Install Python dependencies
234234
run: |
235-
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
235+
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid pynose
236236
237237
- name: Install jacoco dependencies
238238
run: |

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.2.0-SNAPSHOT</version>
27+
<version>4.19.3.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

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.2.0-SNAPSHOT</version>
27+
<version>4.19.3.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

api/src/main/java/com/cloud/agent/api/to/RemoteInstanceTO.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class RemoteInstanceTO implements Serializable {
2727

2828
private Hypervisor.HypervisorType hypervisorType;
2929
private String instanceName;
30+
private String instancePath;
3031

3132
// VMware Remote Instances parameters (required for exporting OVA through ovftool)
3233
// TODO: cloud.agent.transport.Request#getCommands() cannot handle gsoc decode for polymorphic classes
@@ -44,9 +45,10 @@ public RemoteInstanceTO(String instanceName) {
4445
this.instanceName = instanceName;
4546
}
4647

47-
public RemoteInstanceTO(String instanceName, String vcenterHost, String vcenterUsername, String vcenterPassword, String datacenterName) {
48+
public RemoteInstanceTO(String instanceName, String instancePath, String vcenterHost, String vcenterUsername, String vcenterPassword, String datacenterName) {
4849
this.hypervisorType = Hypervisor.HypervisorType.VMware;
4950
this.instanceName = instanceName;
51+
this.instancePath = instancePath;
5052
this.vcenterHost = vcenterHost;
5153
this.vcenterUsername = vcenterUsername;
5254
this.vcenterPassword = vcenterPassword;
@@ -61,6 +63,10 @@ public String getInstanceName() {
6163
return this.instanceName;
6264
}
6365

66+
public String getInstancePath() {
67+
return this.instancePath;
68+
}
69+
6470
public String getVcenterUsername() {
6571
return vcenterUsername;
6672
}

api/src/main/java/com/cloud/exception/StorageAccessException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class StorageAccessException extends RuntimeException {
2727
private static final long serialVersionUID = SerialVersionUID.StorageAccessException;
2828

29-
public StorageAccessException(String message) {
30-
super(message);
29+
public StorageAccessException(String message, Exception causer) {
30+
super(message, causer);
3131
}
3232
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class MigrationOptions implements Serializable {
2424

2525
private String srcPoolUuid;
2626
private Storage.StoragePoolType srcPoolType;
27+
private Long srcPoolClusterId;
2728
private Type type;
2829
private ScopeType scopeType;
2930
private String srcBackingFilePath;
@@ -38,21 +39,23 @@ public enum Type {
3839
public MigrationOptions() {
3940
}
4041

41-
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcBackingFilePath, boolean copySrcTemplate, ScopeType scopeType) {
42+
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcBackingFilePath, boolean copySrcTemplate, ScopeType scopeType, Long srcPoolClusterId) {
4243
this.srcPoolUuid = srcPoolUuid;
4344
this.srcPoolType = srcPoolType;
4445
this.type = Type.LinkedClone;
4546
this.scopeType = scopeType;
4647
this.srcBackingFilePath = srcBackingFilePath;
4748
this.copySrcTemplate = copySrcTemplate;
49+
this.srcPoolClusterId = srcPoolClusterId;
4850
}
4951

50-
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcVolumeUuid, ScopeType scopeType) {
52+
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcVolumeUuid, ScopeType scopeType, Long srcPoolClusterId) {
5153
this.srcPoolUuid = srcPoolUuid;
5254
this.srcPoolType = srcPoolType;
5355
this.type = Type.FullClone;
5456
this.scopeType = scopeType;
5557
this.srcVolumeUuid = srcVolumeUuid;
58+
this.srcPoolClusterId = srcPoolClusterId;
5659
}
5760

5861
public String getSrcPoolUuid() {
@@ -63,6 +66,10 @@ public Storage.StoragePoolType getSrcPoolType() {
6366
return srcPoolType;
6467
}
6568

69+
public Long getSrcPoolClusterId() {
70+
return srcPoolClusterId;
71+
}
72+
6673
public ScopeType getScopeType() { return scopeType; }
6774

6875
public String getSrcBackingFilePath() {

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

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -135,34 +135,49 @@ public static enum TemplateType {
135135
ISODISK /* Template corresponding to a iso (non root disk) present in an OVA */
136136
}
137137

138+
public enum EncryptionSupport {
139+
/**
140+
* Encryption not supported.
141+
*/
142+
Unsupported,
143+
/**
144+
* Will use hypervisor encryption driver (qemu -> luks)
145+
*/
146+
Hypervisor,
147+
/**
148+
* Storage pool handles encryption and just provides an encrypted volume
149+
*/
150+
Storage
151+
}
152+
138153
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, true, 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>)
154+
Filesystem(false, true, EncryptionSupport.Hypervisor), // local directory
155+
NetworkFilesystem(true, true, EncryptionSupport.Hypervisor), // NFS
156+
IscsiLUN(true, false, EncryptionSupport.Unsupported), // shared LUN, with a clusterfs overlay
157+
Iscsi(true, false, EncryptionSupport.Unsupported), // for e.g., ZFS Comstar
158+
ISO(false, false, EncryptionSupport.Unsupported), // for iso image
159+
LVM(false, false, EncryptionSupport.Unsupported), // XenServer local LVM SR
160+
CLVM(true, false, EncryptionSupport.Unsupported),
161+
RBD(true, true, EncryptionSupport.Unsupported), // http://libvirt.org/storage.html#StorageBackendRBD
162+
SharedMountPoint(true, true, EncryptionSupport.Hypervisor),
163+
VMFS(true, true, EncryptionSupport.Unsupported), // VMware VMFS storage
164+
PreSetup(true, true, EncryptionSupport.Unsupported), // for XenServer, Storage Pool is set up by customers.
165+
EXT(false, true, EncryptionSupport.Unsupported), // XenServer local EXT SR
166+
OCFS2(true, false, EncryptionSupport.Unsupported),
167+
SMB(true, false, EncryptionSupport.Unsupported),
168+
Gluster(true, false, EncryptionSupport.Unsupported),
169+
PowerFlex(true, true, EncryptionSupport.Hypervisor), // Dell EMC PowerFlex/ScaleIO (formerly VxFlexOS)
170+
ManagedNFS(true, false, EncryptionSupport.Unsupported),
171+
Linstor(true, true, EncryptionSupport.Storage),
172+
DatastoreCluster(true, true, EncryptionSupport.Unsupported), // for VMware, to abstract pool of clusters
173+
StorPool(true, true, EncryptionSupport.Hypervisor),
174+
FiberChannel(true, true, EncryptionSupport.Unsupported); // Fiber Channel Pool for KVM hypervisors is used to find the volume by WWN value (/dev/disk/by-id/wwn-<wwnvalue>)
160175

161176
private final boolean shared;
162177
private final boolean overProvisioning;
163-
private final boolean encryption;
178+
private final EncryptionSupport encryption;
164179

165-
StoragePoolType(boolean shared, boolean overProvisioning, boolean encryption) {
180+
StoragePoolType(boolean shared, boolean overProvisioning, EncryptionSupport encryption) {
166181
this.shared = shared;
167182
this.overProvisioning = overProvisioning;
168183
this.encryption = encryption;
@@ -177,6 +192,10 @@ public boolean supportsOverProvisioning() {
177192
}
178193

179194
public boolean supportsEncryption() {
195+
return encryption == EncryptionSupport.Hypervisor || encryption == EncryptionSupport.Storage;
196+
}
197+
198+
public EncryptionSupport encryptionSupportMode() {
180199
return encryption;
181200
}
182201
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account acc
133133
Snapshot allocSnapshotForVm(Long vmId, Long volumeId, String snapshotName) throws ResourceAllocationException;
134134

135135
/**
136-
* Checks if the target storage supports the disk offering.
136+
* Checks if the storage pool supports the disk offering tags.
137137
* This validation is consistent with the mechanism used to select a storage pool to deploy a volume when a virtual machine is deployed or when a data disk is allocated.
138138
*
139139
* The scenarios when this method returns true or false is presented in the following table.
140140
* <table border="1">
141141
* <tr>
142-
* <th>#</th><th>Disk offering tags</th><th>Storage tags</th><th>Does the storage support the disk offering?</th>
142+
* <th>#</th><th>Disk offering diskOfferingTags</th><th>Storage diskOfferingTags</th><th>Does the storage support the disk offering?</th>
143143
* </tr>
144144
* <body>
145145
* <tr>
@@ -163,7 +163,7 @@ Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account acc
163163
* </body>
164164
* </table>
165165
*/
166-
boolean doesTargetStorageSupportDiskOffering(StoragePool destPool, String diskOfferingTags);
166+
boolean doesStoragePoolSupportDiskOfferingTags(StoragePool destPool, String diskOfferingTags);
167167

168168
Volume destroyVolume(long volumeId, Account caller, boolean expunge, boolean forceExpunge);
169169

api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121

22+
import org.apache.commons.collections.CollectionUtils;
23+
import org.apache.commons.lang3.StringUtils;
2224
import org.apache.log4j.Logger;
2325

2426
import org.apache.cloudstack.acl.RoleType;
@@ -103,14 +105,13 @@ public String getProtocol() {
103105

104106
@Override
105107
public List<String> getSourceCidrList() {
106-
if (cidrlist != null) {
108+
if (CollectionUtils.isNotEmpty(cidrlist) && !(cidrlist.size() == 1 && StringUtils.isBlank(cidrlist.get(0)))) {
107109
return cidrlist;
108110
} else {
109-
List<String> oneCidrList = new ArrayList<String>();
111+
List<String> oneCidrList = new ArrayList<>();
110112
oneCidrList.add(NetUtils.ALL_IP4_CIDRS);
111113
return oneCidrList;
112114
}
113-
114115
}
115116

116117
// ///////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.cloudstack.api.response.SecurityGroupResponse;
4242
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
4343
import org.apache.cloudstack.api.response.TemplateResponse;
44+
import org.apache.cloudstack.api.response.UserDataResponse;
4445
import org.apache.cloudstack.api.response.UserResponse;
4546
import org.apache.cloudstack.api.response.UserVmResponse;
4647
import org.apache.cloudstack.api.response.VpcResponse;
@@ -151,6 +152,9 @@ public class ListVMsCmd extends BaseListRetrieveOnlyResourceCountCmd implements
151152
@Parameter(name = ApiConstants.USER_DATA, type = CommandType.BOOLEAN, description = "Whether to return the VMs' user data or not. By default, user data will not be returned.", since = "4.18.0.0")
152153
private Boolean showUserData;
153154

155+
@Parameter(name = ApiConstants.USER_DATA_ID, type = CommandType.UUID, entityType = UserDataResponse.class, required = false, description = "the instances by userdata", since = "4.20.1")
156+
private Long userdataId;
157+
154158
/////////////////////////////////////////////////////
155159
/////////////////// Accessors ///////////////////////
156160
/////////////////////////////////////////////////////
@@ -245,6 +249,10 @@ protected boolean isViewDetailsEmpty() {
245249
return CollectionUtils.isEmpty(viewDetails);
246250
}
247251

252+
public Long getUserdataId() {
253+
return userdataId;
254+
}
255+
248256
public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
249257
if (isViewDetailsEmpty()) {
250258
if (_queryService.ReturnVmStatsOnVmList.value()) {

0 commit comments

Comments
 (0)