Skip to content

Commit c421ce7

Browse files
author
SadiJr
committed
Merge branch 'main' into veeam-check-failure-when-restoring
2 parents ef1b354 + 080a5ae commit c421ce7

File tree

142 files changed

+11299
-300
lines changed

Some content is hidden

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

142 files changed

+11299
-300
lines changed

.asf.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ github:
4141
features:
4242
wiki: true
4343
issues: true
44+
discussions: true
4445
projects: true
4546

4647
enabled_merge_buttons:
@@ -49,15 +50,21 @@ github:
4950
rebase: false
5051

5152
collaborators:
53+
- acs-robot
5254
- kiranchavala
5355
- rajujith
5456
- alexandremattioli
5557
- vishesh92
5658
- GaOrtiga
57-
- acs-robot
5859
- BryanMLima
5960
- SadiJr
6061
- JoaoJandre
6162
- winterhazel
6263

6364
protected_branches: ~
65+
66+
notifications:
67+
commits: commits@cloudstack.apache.org
68+
issues: commits@cloudstack.apache.org
69+
pullrequests: commits@cloudstack.apache.org
70+
discussions: users@cloudstack.apache.org

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
package com.cloud.agent.properties;
1616

17+
import org.apache.cloudstack.utils.security.KeyStoreUtils;
18+
1719
/**
1820
* Class of constant agent's properties available to configure on
1921
* "agent.properties".
@@ -779,6 +781,13 @@ public Property<Integer> getWorkers() {
779781
*/
780782
public static final Property<Long> KVM_HEARTBEAT_CHECKER_TIMEOUT = new Property<>("kvm.heartbeat.checker.timeout", 360000L);
781783

784+
/**
785+
* Keystore passphrase
786+
* Data type: String.<br>
787+
* Default value: <code>null</code>
788+
*/
789+
public static final Property<String> KEYSTORE_PASSPHRASE = new Property<>(KeyStoreUtils.KS_PASSPHRASE_PROPERTY, null, String.class);
790+
782791
public static class Property <T>{
783792
private String name;
784793
private T defaultValue;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ public class EventTypes {
320320
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
321321
public static final String EVENT_DOMAIN_DELETE = "DOMAIN.DELETE";
322322
public static final String EVENT_DOMAIN_UPDATE = "DOMAIN.UPDATE";
323+
public static final String EVENT_DOMAIN_MOVE = "DOMAIN.MOVE";
323324

324325
// Snapshots
325326
public static final String EVENT_SNAPSHOT_COPY = "SNAPSHOT.COPY";
@@ -878,6 +879,7 @@ public class EventTypes {
878879
entityEventDetails.put(EVENT_DOMAIN_CREATE, Domain.class);
879880
entityEventDetails.put(EVENT_DOMAIN_DELETE, Domain.class);
880881
entityEventDetails.put(EVENT_DOMAIN_UPDATE, Domain.class);
882+
entityEventDetails.put(EVENT_DOMAIN_MOVE, Domain.class);
881883

882884
// Snapshots
883885
entityEventDetails.put(EVENT_SNAPSHOT_CREATE, Snapshot.class);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@ public String getFileExtension() {
7777
}
7878

7979
public static enum Capability {
80-
HARDWARE_ACCELERATION("HARDWARE_ACCELERATION");
80+
HARDWARE_ACCELERATION("HARDWARE_ACCELERATION"),
81+
ALLOW_MIGRATE_OTHER_POOLS("ALLOW_MIGRATE_OTHER_POOLS");
8182

8283
private final String capability;
8384

8485
private Capability(String capability) {
8586
this.capability = capability;
8687
}
88+
89+
public String toString() {
90+
return this.capability;
91+
}
8792
}
8893

8994
public static enum ProvisioningType {
@@ -150,7 +155,8 @@ public static enum StoragePoolType {
150155
ManagedNFS(true, false, false),
151156
Linstor(true, true, false),
152157
DatastoreCluster(true, true, false), // for VMware, to abstract pool of clusters
153-
StorPool(true, true, true);
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>)
154160

155161
private final boolean shared;
156162
private final boolean overprovisioning;

api/src/main/java/com/cloud/user/DomainService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
import org.apache.cloudstack.api.command.admin.domain.ListDomainChildrenCmd;
2222
import org.apache.cloudstack.api.command.admin.domain.ListDomainsCmd;
23+
import org.apache.cloudstack.api.command.admin.domain.MoveDomainCmd;
2324

2425
import com.cloud.domain.Domain;
2526
import com.cloud.exception.PermissionDeniedException;
27+
import com.cloud.exception.ResourceAllocationException;
2628
import com.cloud.utils.Pair;
2729

2830
public interface DomainService {
@@ -66,4 +68,5 @@ public interface DomainService {
6668
*/
6769
Domain findDomainByIdOrPath(Long id, String domainPath);
6870

71+
Domain moveDomainAndChildrenToNewParentDomain(MoveDomainCmd cmd) throws ResourceAllocationException;
6972
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.command.admin.domain;
18+
19+
import com.cloud.domain.Domain;
20+
import com.cloud.exception.ResourceAllocationException;
21+
import com.cloud.user.Account;
22+
import org.apache.cloudstack.acl.RoleType;
23+
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiConstants;
25+
import org.apache.cloudstack.api.ApiErrorCode;
26+
import org.apache.cloudstack.api.BaseCmd;
27+
import org.apache.cloudstack.api.Parameter;
28+
import org.apache.cloudstack.api.ServerApiException;
29+
import org.apache.cloudstack.api.response.DomainResponse;
30+
31+
@APICommand(name = "moveDomain", description = "Moves a domain and its children to a new parent domain.", since = "4.19.0.0", responseObject = DomainResponse.class,
32+
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {RoleType.Admin})
33+
public class MoveDomainCmd extends BaseCmd {
34+
35+
private static final String APINAME = "moveDomain";
36+
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class, description = "The ID of the domain to be moved.")
37+
private Long domainId;
38+
39+
@Parameter(name = ApiConstants.PARENT_DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class,
40+
description = "The ID of the new parent domain of the domain to be moved.")
41+
private Long parentDomainId;
42+
43+
public Long getDomainId() {
44+
return domainId;
45+
}
46+
47+
public Long getParentDomainId() {
48+
return parentDomainId;
49+
}
50+
51+
@Override
52+
public String getCommandName() {
53+
return APINAME.toLowerCase() + BaseCmd.RESPONSE_SUFFIX;
54+
}
55+
56+
@Override
57+
public long getEntityOwnerId() {
58+
return Account.ACCOUNT_ID_SYSTEM;
59+
}
60+
61+
@Override
62+
public void execute() throws ResourceAllocationException {
63+
Domain domain = _domainService.moveDomainAndChildrenToNewParentDomain(this);
64+
65+
if (domain != null) {
66+
DomainResponse response = _responseGenerator.createDomainResponse(domain);
67+
response.setResponseName(getCommandName());
68+
this.setResponseObject(response);
69+
} else {
70+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to move the domain.");
71+
}
72+
}
73+
}

api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.admin.storage;
1818

1919
import java.util.List;
20+
import java.util.Map;
2021

2122
import org.apache.cloudstack.api.ApiCommandResourceType;
2223
import org.apache.log4j.Logger;
@@ -32,6 +33,7 @@
3233
import com.cloud.storage.StoragePool;
3334
import com.cloud.user.Account;
3435

36+
@SuppressWarnings("rawtypes")
3537
@APICommand(name = "updateStoragePool", description = "Updates a storage pool.", responseObject = StoragePoolResponse.class, since = "3.0.0",
3638
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
3739
public class UpdateStoragePoolCmd extends BaseCmd {
@@ -61,6 +63,20 @@ public class UpdateStoragePoolCmd extends BaseCmd {
6163
" enable it back.")
6264
private Boolean enabled;
6365

66+
@Parameter(name = ApiConstants.DETAILS,
67+
type = CommandType.MAP,
68+
required = false,
69+
description = "the details for the storage pool",
70+
since = "4.19.0")
71+
private Map details;
72+
73+
@Parameter(name = ApiConstants.URL,
74+
type = CommandType.STRING,
75+
required = false,
76+
description = "the URL of the storage pool",
77+
since = "4.19.0")
78+
private String url;
79+
6480
@Parameter(name = ApiConstants.IS_TAG_A_RULE, type = CommandType.BOOLEAN, description = ApiConstants.PARAMETER_DESCRIPTION_IS_TAG_A_RULE)
6581
private Boolean isTagARule;
6682

@@ -115,6 +131,22 @@ public ApiCommandResourceType getApiResourceType() {
115131
return ApiCommandResourceType.StoragePool;
116132
}
117133

134+
public Map<String,String> getDetails() {
135+
return details;
136+
}
137+
138+
public void setDetails(Map<String,String> details) {
139+
this.details = details;
140+
}
141+
142+
public String getUrl() {
143+
return url;
144+
}
145+
146+
public void setUrl(String url) {
147+
this.url = url;
148+
}
149+
118150
@Override
119151
public void execute() {
120152
StoragePool result = _storageService.updateStoragePool(this);

api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -97,52 +97,44 @@ public String getCommandName() {
9797
public void execute() {
9898
Pair<List<? extends UserVm>, List<String>> vmServiceMap = _lbService.listLoadBalancerInstances(this);
9999
List<? extends UserVm> result = vmServiceMap.first();
100+
s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result));
101+
100102
List<String> serviceStates = vmServiceMap.second();
103+
s_logger.debug(String.format("A total of [%s] service states were obtained when listing the load balancer instances: [%s].", serviceStates.size(), serviceStates));
101104

102105
if (!isListLbVmip()) {
103-
// list lb instances
104-
ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
105-
List<UserVmResponse> vmResponses = new ArrayList<UserVmResponse>();
106-
if (result != null) {
107-
vmResponses = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "loadbalancerruleinstance", result.toArray(new UserVm[result.size()]));
108-
106+
ListResponse<UserVmResponse> response = new ListResponse<>();
107+
List<UserVmResponse> vmResponses = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "loadbalancerruleinstance", result.toArray(new UserVm[0]));
109108

110-
for (int i = 0; i < result.size(); i++) {
111-
vmResponses.get(i).setServiceState(serviceStates.get(i));
112-
}
109+
for (int i = 0; i < result.size(); i++) {
110+
vmResponses.get(i).setServiceState(serviceStates.get(i));
113111
}
112+
114113
response.setResponses(vmResponses);
115114
response.setResponseName(getCommandName());
116115
setResponseObject(response);
116+
return;
117+
}
117118

119+
ListResponse<LoadBalancerRuleVmMapResponse> lbRes = new ListResponse<>();
118120

119-
} else {
120-
ListResponse<LoadBalancerRuleVmMapResponse> lbRes = new ListResponse<LoadBalancerRuleVmMapResponse>();
121-
122-
List<UserVmResponse> vmResponses = new ArrayList<UserVmResponse>();
123-
List<LoadBalancerRuleVmMapResponse> listlbVmRes = new ArrayList<LoadBalancerRuleVmMapResponse>();
124-
125-
if (result != null) {
126-
vmResponses = _responseGenerator.createUserVmResponse(getResponseView(), "loadbalancerruleinstance", result.toArray(new UserVm[result.size()]));
127-
121+
List<UserVmResponse> vmResponses = _responseGenerator.createUserVmResponse(getResponseView(), "loadbalancerruleinstance", result.toArray(new UserVm[0]));
122+
List<LoadBalancerRuleVmMapResponse> lbRuleVmMapList = new ArrayList<>();
128123

129-
List<String> ipaddr = null;
124+
for (int i=0; i<result.size(); i++) {
125+
LoadBalancerRuleVmMapResponse lbRuleVmIpResponse = new LoadBalancerRuleVmMapResponse();
126+
UserVmResponse userVmResponse = vmResponses.get(i);
127+
userVmResponse.setServiceState(serviceStates.get(i));
128+
lbRuleVmIpResponse.setUserVmResponse(userVmResponse);
130129

131-
for (int i=0;i<result.size(); i++) {
132-
LoadBalancerRuleVmMapResponse lbRuleVmIpResponse = new LoadBalancerRuleVmMapResponse();
133-
vmResponses.get(i).setServiceState(serviceStates.get(i));
134-
lbRuleVmIpResponse.setUserVmResponse(vmResponses.get(i));
135-
//get vm id from the uuid
136-
VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmResponses.get(i).getId());
137-
lbRuleVmIpResponse.setIpAddr(_lbService.listLbVmIpAddress(getId(), lbvm.getId()));
138-
lbRuleVmIpResponse.setObjectName("lbrulevmidip");
139-
listlbVmRes.add(lbRuleVmIpResponse);
140-
}
141-
}
142-
143-
lbRes.setResponseName(getCommandName());
144-
lbRes.setResponses(listlbVmRes);
145-
setResponseObject(lbRes);
130+
VirtualMachine lbVm = _entityMgr.findByUuid(VirtualMachine.class, userVmResponse.getId());
131+
lbRuleVmIpResponse.setIpAddr(_lbService.listLbVmIpAddress(getId(), lbVm.getId()));
132+
lbRuleVmIpResponse.setObjectName("lbrulevmidip");
133+
lbRuleVmMapList.add(lbRuleVmIpResponse);
146134
}
135+
136+
lbRes.setResponseName(getCommandName());
137+
lbRes.setResponses(lbRuleVmMapList);
138+
setResponseObject(lbRes);
147139
}
148140
}

api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
166166
private String serviceOfferingName;
167167

168168
@SerializedName(ApiConstants.DISK_OFFERING_ID)
169-
@Param(description = "the ID of the disk offering of the virtual machine", since = "4.4")
169+
@Param(description = "the ID of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
170170
private String diskOfferingId;
171171

172172
@SerializedName("diskofferingname")
173-
@Param(description = "the name of the disk offering of the virtual machine", since = "4.4")
173+
@Param(description = "the name of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
174174
private String diskOfferingName;
175175

176176
@SerializedName(ApiConstants.BACKUP_OFFERING_ID)

client/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@
111111
<artifactId>cloud-plugin-storage-volume-storpool</artifactId>
112112
<version>${project.version}</version>
113113
</dependency>
114+
<dependency>
115+
<groupId>org.apache.cloudstack</groupId>
116+
<artifactId>cloud-plugin-storage-volume-primera</artifactId>
117+
<version>${project.version}</version>
118+
</dependency>
119+
<dependency>
120+
<groupId>org.apache.cloudstack</groupId>
121+
<artifactId>cloud-plugin-storage-volume-flasharray</artifactId>
122+
<version>${project.version}</version>
123+
</dependency>
114124
<dependency>
115125
<groupId>org.apache.cloudstack</groupId>
116126
<artifactId>cloud-server</artifactId>

0 commit comments

Comments
 (0)