Skip to content

Commit f99fbb4

Browse files
authored
Merge branch 'main' into ui-adv-improv
2 parents 6ca2263 + 82bfa9f commit f99fbb4

File tree

225 files changed

+12020
-2370
lines changed

Some content is hidden

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

225 files changed

+12020
-2370
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/plugins/storage/volume/linstor @rp-
1919
/plugins/storage/volume/storpool @slavkap
20+
/plugins/storage/volume/ontap @rajiv1 @sandeeplocharla @piyush5 @suryag
2021

2122
.pre-commit-config.yaml @jbampton
2223
/.github/linters/ @jbampton

agent/conf/agent.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,6 @@ iscsi.session.cleanup.enabled=false
457457

458458
# Instance conversion VIRT_V2V_TMPDIR env var
459459
#convert.instance.env.virtv2v.tmpdir=
460+
461+
# Time, in seconds, to wait before retrying to rebase during the incremental snapshot process.
462+
# incremental.snapshot.retry.rebase.wait=60

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,11 @@ public Property<Integer> getWorkers() {
885885
*/
886886
public static final Property<Boolean> CREATE_FULL_CLONE = new Property<>("create.full.clone", false);
887887

888+
/**
889+
* Time, in seconds, to wait before retrying to rebase during the incremental snapshot process.
890+
* */
891+
public static final Property<Integer> INCREMENTAL_SNAPSHOT_RETRY_REBASE_WAIT = new Property<>("incremental.snapshot.retry.rebase.wait", 60);
892+
888893

889894
public static class Property <T>{
890895
private String name;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ public final class BucketTO {
2626

2727
private String secretKey;
2828

29+
private long accountId;
30+
2931
public BucketTO(Bucket bucket) {
3032
this.name = bucket.getName();
3133
this.accessKey = bucket.getAccessKey();
3234
this.secretKey = bucket.getSecretKey();
35+
this.accountId = bucket.getAccountId();
3336
}
3437

3538
public BucketTO(String name) {
@@ -47,4 +50,8 @@ public String getAccessKey() {
4750
public String getSecretKey() {
4851
return this.secretKey;
4952
}
53+
54+
public long getAccountId() {
55+
return this.accountId;
56+
}
5057
}

api/src/main/java/com/cloud/projects/ProjectService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public interface ProjectService {
8282

8383
Project updateProject(long id, String name, String displayText, String newOwnerName, Long userId, Role newRole) throws ResourceAllocationException;
8484

85-
boolean addAccountToProject(long projectId, String accountName, String email, Long projectRoleId, Role projectRoleType);
85+
boolean addAccountToProject(long projectId, String accountName, String email, Long projectRoleId, Role projectRoleType) throws ResourceAllocationException;
8686

8787
boolean deleteAccountFromProject(long projectId, String accountName);
8888

@@ -100,6 +100,6 @@ public interface ProjectService {
100100

101101
Project findByProjectAccountIdIncludingRemoved(long projectAccountId);
102102

103-
boolean addUserToProject(Long projectId, String username, String email, Long projectRoleId, Role projectRole);
103+
boolean addUserToProject(Long projectId, String username, String email, Long projectRoleId, Role projectRole) throws ResourceAllocationException;
104104

105105
}

api/src/main/java/com/cloud/server/ManagementService.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
7272
import org.apache.cloudstack.config.Configuration;
7373
import org.apache.cloudstack.config.ConfigurationGroup;
74-
import org.apache.cloudstack.framework.config.ConfigKey;
7574

7675
import com.cloud.alert.Alert;
7776
import com.cloud.capacity.Capacity;
@@ -108,14 +107,6 @@
108107
public interface ManagementService {
109108
static final String Name = "management-server";
110109

111-
ConfigKey<Boolean> JsInterpretationEnabled = new ConfigKey<>("Hidden"
112-
, Boolean.class
113-
, "js.interpretation.enabled"
114-
, "false"
115-
, "Enable/Disable all JavaScript interpretation related functionalities to create or update Javascript rules."
116-
, false
117-
, ConfigKey.Scope.Global);
118-
119110
/**
120111
* returns the a map of the names/values in the configuration table
121112
*
@@ -534,6 +525,4 @@ VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableE
534525

535526
boolean removeManagementServer(RemoveManagementServerCmd cmd);
536527

537-
void checkJsInterpretationAllowedIfNeededForParameterValue(String paramName, boolean paramValue);
538-
539528
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323

2424
public interface VMTemplateStorageResourceAssoc extends InternalIdentity {
2525
public static enum Status {
26-
UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, CREATING, CREATED, BYPASSED
26+
UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, LIMIT_REACHED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, CREATING, CREATED, BYPASSED
2727
}
2828

29+
List<Status> ERROR_DOWNLOAD_STATES = List.of(Status.DOWNLOAD_ERROR, Status.ABANDONED, Status.LIMIT_REACHED, Status.UNKNOWN);
2930
List<Status> PENDING_DOWNLOAD_STATES = List.of(Status.NOT_DOWNLOADED, Status.DOWNLOAD_IN_PROGRESS);
3031

3132
String getInstallPath();

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.cloud.offering.DiskOffering;
3131
import com.cloud.offering.ServiceOffering;
3232
import com.cloud.template.VirtualMachineTemplate;
33+
import org.apache.cloudstack.resourcelimit.Reserver;
3334

3435
public interface ResourceLimitService {
3536

@@ -191,6 +192,7 @@ public interface ResourceLimitService {
191192
*/
192193
public void checkResourceLimit(Account account, ResourceCount.ResourceType type, long... count) throws ResourceAllocationException;
193194
public void checkResourceLimitWithTag(Account account, ResourceCount.ResourceType type, String tag, long... count) throws ResourceAllocationException;
195+
public void checkResourceLimitWithTag(Account account, Long domainId, boolean considerSystemAccount, ResourceCount.ResourceType type, String tag, long... count) throws ResourceAllocationException;
194196

195197
/**
196198
* Gets the count of resources for a resource type and account
@@ -251,12 +253,12 @@ public interface ResourceLimitService {
251253
List<String> getResourceLimitStorageTags(DiskOffering diskOffering);
252254
void updateTaggedResourceLimitsAndCountsForAccounts(List<AccountResponse> responses, String tag);
253255
void updateTaggedResourceLimitsAndCountsForDomains(List<DomainResponse> responses, String tag);
254-
void checkVolumeResourceLimit(Account owner, Boolean display, Long size, DiskOffering diskOffering) throws ResourceAllocationException;
255-
256+
void checkVolumeResourceLimit(Account owner, Boolean display, Long size, DiskOffering diskOffering, List<Reserver> reservations) throws ResourceAllocationException;
257+
List<String> getResourceLimitStorageTagsForResourceCountOperation(Boolean display, DiskOffering diskOffering);
256258
void checkVolumeResourceLimitForDiskOfferingChange(Account owner, Boolean display, Long currentSize, Long newSize,
257-
DiskOffering currentOffering, DiskOffering newOffering) throws ResourceAllocationException;
259+
DiskOffering currentOffering, DiskOffering newOffering, List<Reserver> reservations) throws ResourceAllocationException;
258260

259-
void checkPrimaryStorageResourceLimit(Account owner, Boolean display, Long size, DiskOffering diskOffering) throws ResourceAllocationException;
261+
void checkPrimaryStorageResourceLimit(Account owner, Boolean display, Long size, DiskOffering diskOffering, List<Reserver> reservations) throws ResourceAllocationException;
260262

261263
void incrementVolumeResourceCount(long accountId, Boolean display, Long size, DiskOffering diskOffering);
262264
void decrementVolumeResourceCount(long accountId, Boolean display, Long size, DiskOffering diskOffering);
@@ -273,25 +275,23 @@ void updateVolumeResourceCountForDiskOfferingChange(long accountId, Boolean disp
273275

274276
void incrementVolumePrimaryStorageResourceCount(long accountId, Boolean display, Long size, DiskOffering diskOffering);
275277
void decrementVolumePrimaryStorageResourceCount(long accountId, Boolean display, Long size, DiskOffering diskOffering);
276-
void checkVmResourceLimit(Account owner, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template) throws ResourceAllocationException;
278+
void checkVmResourceLimit(Account owner, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Reserver> reservations) throws ResourceAllocationException;
277279
void incrementVmResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template);
278280
void decrementVmResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template);
279281

280282
void checkVmResourceLimitsForServiceOfferingChange(Account owner, Boolean display, Long currentCpu, Long newCpu,
281-
Long currentMemory, Long newMemory, ServiceOffering currentOffering, ServiceOffering newOffering, VirtualMachineTemplate template) throws ResourceAllocationException;
283+
Long currentMemory, Long newMemory, ServiceOffering currentOffering, ServiceOffering newOffering, VirtualMachineTemplate template, List<Reserver> reservations) throws ResourceAllocationException;
282284

283285
void checkVmResourceLimitsForTemplateChange(Account owner, Boolean display, ServiceOffering offering,
284-
VirtualMachineTemplate currentTemplate, VirtualMachineTemplate newTemplate) throws ResourceAllocationException;
286+
VirtualMachineTemplate currentTemplate, VirtualMachineTemplate newTemplate, List<Reserver> reservations) throws ResourceAllocationException;
285287

286-
void checkVmCpuResourceLimit(Account owner, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long cpu) throws ResourceAllocationException;
287288
void incrementVmCpuResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long cpu);
288289
void decrementVmCpuResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long cpu);
289-
void checkVmMemoryResourceLimit(Account owner, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long memory) throws ResourceAllocationException;
290290
void incrementVmMemoryResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long memory);
291291
void decrementVmMemoryResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long memory);
292292

293-
void checkVmGpuResourceLimit(Account owner, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long gpu) throws ResourceAllocationException;
294293
void incrementVmGpuResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long gpu);
295294
void decrementVmGpuResourceCount(long accountId, Boolean display, ServiceOffering serviceOffering, VirtualMachineTemplate template, Long gpu);
296295

296+
long recalculateDomainResourceCount(final long domainId, final ResourceType type, String tag);
297297
}

api/src/main/java/org/apache/cloudstack/api/ApiCommandResourceType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public String toString() {
127127
}
128128

129129
public static ApiCommandResourceType fromString(String value) {
130-
if (StringUtils.isNotEmpty(value) && EnumUtils.isValidEnum(ApiCommandResourceType.class, value)) {
131-
return valueOf(value);
130+
if (StringUtils.isNotBlank(value) && EnumUtils.isValidEnumIgnoreCase(ApiCommandResourceType.class, value)) {
131+
return EnumUtils.getEnumIgnoreCase(ApiCommandResourceType.class, value);
132132
}
133133
return null;
134134
}

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ public class ApiConstants {
509509
public static final String REPAIR = "repair";
510510
public static final String REPETITION_ALLOWED = "repetitionallowed";
511511
public static final String REQUIRES_HVM = "requireshvm";
512+
public static final String RESERVED_RESOURCE_DETAILS = "reservedresourcedetails";
512513
public static final String RESOURCES = "resources";
513514
public static final String RESOURCE_COUNT = "resourcecount";
514515
public static final String RESOURCE_NAME = "resourcename";

0 commit comments

Comments
 (0)