Skip to content

Commit 4839a2e

Browse files
committed
Merge branch 'main' of https://github.com/apache/cloudstack into netris-integration-upstream
2 parents 807f783 + e717216 commit 4839a2e

File tree

199 files changed

+11387
-1750
lines changed

Some content is hidden

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

199 files changed

+11387
-1750
lines changed

.asf.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ github:
5353
- acs-robot
5454
- gpordeus
5555
- hsato03
56-
- bernardodemarco
5756
- FelipeM525
5857
- lucas-a-martins
5958
- nicoschmdt
6059
- abh1sar
61-
- sudo87
6260
- rosi-shapeblue
61+
- sudo87
6362

6463
protected_branches: ~
6564

.github/workflows/ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
npm run test:unit
5757
5858
- uses: codecov/codecov-action@v4
59+
if: github.repository == 'apache/cloudstack'
5960
with:
6061
working-directory: ui
6162
files: ./coverage/lcov.info

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ public class AgentProperties{
155155
*/
156156
public static final Property<Integer> CMDS_TIMEOUT = new Property<>("cmds.timeout", 7200);
157157

158+
/**
159+
* The timeout (in seconds) for the snapshot merge operation, mainly used for classic volume snapshots and disk-only VM snapshots on file-based storage.<br>
160+
* This configuration is only considered if libvirt.events.enabled is also true. <br>
161+
* Data type: Integer.<br>
162+
* Default value: <code>259200</code>
163+
*/
164+
public static final Property<Integer> QCOW2_DELTA_MERGE_TIMEOUT = new Property<>("qcow2.delta.merge.timeout", 60 * 60 * 72);
165+
158166
/**
159167
* This parameter sets the VM migration speed (in mbps). The default value is -1,<br>
160168
* which means that the agent will try to guess the speed of the guest network and consume all possible bandwidth.<br>
@@ -833,7 +841,7 @@ public static class Property <T>{
833841
private T defaultValue;
834842
private Class<T> typeClass;
835843

836-
Property(String name, T value) {
844+
public Property(String name, T value) {
837845
init(name, value);
838846
}
839847

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,11 @@ public class EventTypes {
811811
public static final String VM_LEASE_CANCELLED = "VM.LEASE.CANCELLED";
812812
public static final String VM_LEASE_EXPIRING = "VM.LEASE.EXPIRING";
813813

814+
// GUI Theme
815+
public static final String EVENT_GUI_THEME_CREATE = "GUI.THEME.CREATE";
816+
public static final String EVENT_GUI_THEME_REMOVE = "GUI.THEME.REMOVE";
817+
public static final String EVENT_GUI_THEME_UPDATE = "GUI.THEME.UPDATE";
818+
814819
static {
815820

816821
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
@@ -1314,6 +1319,11 @@ public class EventTypes {
13141319
entityEventDetails.put(VM_LEASE_EXPIRING, VirtualMachine.class);
13151320
entityEventDetails.put(VM_LEASE_DISABLED, VirtualMachine.class);
13161321
entityEventDetails.put(VM_LEASE_CANCELLED, VirtualMachine.class);
1322+
1323+
// GUI theme
1324+
entityEventDetails.put(EVENT_GUI_THEME_CREATE, "GuiTheme");
1325+
entityEventDetails.put(EVENT_GUI_THEME_REMOVE, "GuiTheme");
1326+
entityEventDetails.put(EVENT_GUI_THEME_UPDATE, "GuiTheme");
13171327
}
13181328

13191329
public static boolean isNetworkEvent(String eventType) {

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Volume updateVolume(long volumeId, String path, String state, Long storageId,
137137

138138
void updateDisplay(Volume volume, Boolean displayVolume);
139139

140-
Snapshot allocSnapshotForVm(Long vmId, Long volumeId, String snapshotName) throws ResourceAllocationException;
140+
Snapshot allocSnapshotForVm(Long vmId, Long volumeId, String snapshotName, Long vmSnapshotId) throws ResourceAllocationException;
141141

142142
/**
143143
* Checks if the storage pool supports the disk offering tags.
@@ -171,6 +171,13 @@ Volume updateVolume(long volumeId, String path, String state, Long storageId,
171171
* </table>
172172
*/
173173
boolean doesStoragePoolSupportDiskOffering(StoragePool destPool, DiskOffering diskOffering);
174+
175+
/**
176+
* Checks if the storage pool supports the required disk offering tags
177+
* destPool the storage pool to check the disk offering tags
178+
* diskOfferingTags the tags that should be supported
179+
* return whether the tags are supported in the storage pool
180+
*/
174181
boolean doesStoragePoolSupportDiskOfferingTags(StoragePool destPool, String diskOfferingTags);
175182

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

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.vm;
1818

19+
import com.cloud.storage.Snapshot;
20+
import com.cloud.storage.Volume;
1921
import java.util.LinkedHashMap;
2022
import java.util.List;
2123
import java.util.Map;
@@ -222,7 +224,7 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
222224
String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
223225
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
224226
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
225-
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId) throws InsufficientCapacityException,
227+
Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot) throws InsufficientCapacityException,
226228
ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
227229

228230
/**
@@ -298,7 +300,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
298300
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
299301
HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
300302
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
301-
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
303+
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType, Volume volume, Snapshot snapshot) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
302304

303305
/**
304306
* Creates a User VM in Advanced Zone (Security Group feature is disabled)
@@ -370,7 +372,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
370372
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
371373
Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
372374
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
373-
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String vmType, Long overrideDiskOfferingId)
375+
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String vmType, Long overrideDiskOfferingId, Volume volume, Snapshot snapshot)
374376

375377
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
376378

api/src/main/java/com/cloud/vm/snapshot/VMSnapshot.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity
3131
enum State {
3232
Allocated("The VM snapshot is allocated but has not been created yet."), Creating("The VM snapshot is being created."), Ready(
3333
"The VM snapshot is ready to be used."), Reverting("The VM snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
34-
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered");
34+
"The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered"),
35+
Hidden("The VM snapshot is hidden from the user and cannot be recovered.");
3536

3637
String _description;
3738

@@ -60,6 +61,8 @@ public String getDescription() {
6061
s_fsm.addTransition(Expunging, Event.ExpungeRequested, Expunging);
6162
s_fsm.addTransition(Expunging, Event.OperationSucceeded, Removed);
6263
s_fsm.addTransition(Expunging, Event.OperationFailed, Error);
64+
s_fsm.addTransition(Expunging, Event.Hide, Hidden);
65+
s_fsm.addTransition(Hidden, Event.ExpungeRequested, Expunging);
6366
}
6467
}
6568

@@ -68,7 +71,7 @@ enum Type {
6871
}
6972

7073
enum Event {
71-
CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested,
74+
CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested, Hide,
7275
}
7376

7477
@Override

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ public class ApiConstants {
9090
public static final String CONVERT_INSTANCE_HOST_ID = "convertinstancehostid";
9191
public static final String CONVERT_INSTANCE_STORAGE_POOL_ID = "convertinstancepoolid";
9292
public static final String ENABLED_REVOCATION_CHECK = "enabledrevocationcheck";
93+
public static final String COMBINED_CAPACITY_ORDERING = "COMBINED";
9394
public static final String CONTROLLER = "controller";
9495
public static final String CONTROLLER_UNIT = "controllerunit";
9596
public static final String COPY_IMAGE_TAGS = "copyimagetags";
97+
public static final String CPU_OVERCOMMIT_RATIO = "cpuOvercommitRatio";
9698
public static final String CSR = "csr";
9799
public static final String PRIVATE_KEY = "privatekey";
98100
public static final String DATASTORE_HOST = "datastorehost";
@@ -124,6 +126,7 @@ public class ApiConstants {
124126
public static final String CNI_CONFIG_DETAILS = "cniconfigdetails";
125127
public static final String CNI_CONFIG_NAME = "cniconfigname";
126128
public static final String COMPONENT = "component";
129+
public static final String CPU = "CPU";
127130
public static final String CPU_CORE_PER_SOCKET = "cpucorepersocket";
128131
public static final String CPU_NUMBER = "cpunumber";
129132
public static final String CPU_SPEED = "cpuspeed";
@@ -220,6 +223,7 @@ public class ApiConstants {
220223
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
221224
public static final String FORCE_DELETE_HOST = "forcedeletehost";
222225
public static final String FORCE_MS_TO_IMPORT_VM_FILES = "forcemstoimportvmfiles";
226+
public static final String FORCE_UPDATE_OS_TYPE = "forceupdateostype";
223227
public static final String FORMAT = "format";
224228
public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
225229
public static final String FOR_SYSTEM_VMS = "forsystemvms";
@@ -346,6 +350,7 @@ public class ApiConstants {
346350
public static final String MAX_BACKUPS = "maxbackups";
347351
public static final String MAX_CPU_NUMBER = "maxcpunumber";
348352
public static final String MAX_MEMORY = "maxmemory";
353+
public static final String MEMORY_OVERCOMMIT_RATIO = "memoryOvercommitRatio";
349354
public static final String MIN_CPU_NUMBER = "mincpunumber";
350355
public static final String MIN_MEMORY = "minmemory";
351356
public static final String MIGRATION_TYPE = "migrationtype";
@@ -445,6 +450,7 @@ public class ApiConstants {
445450
public static final String PUBLIC_END_PORT = "publicendport";
446451
public static final String PUBLIC_ZONE = "publiczone";
447452
public static final String PURGE_RESOURCES = "purgeresources";
453+
public static final String RAM = "RAM";
448454
public static final String REBALANCE = "rebalance";
449455
public static final String RECEIVED_BYTES = "receivedbytes";
450456
public static final String RECONNECT = "reconnect";
@@ -1267,6 +1273,22 @@ public class ApiConstants {
12671273

12681274
public static final String VMWARE_DC = "vmwaredc";
12691275

1276+
public static final String CSS = "css";
1277+
1278+
public static final String JSON_CONFIGURATION = "jsonconfiguration";
1279+
1280+
public static final String COMMON_NAMES = "commonnames";
1281+
1282+
public static final String COMMON_NAME = "commonname";
1283+
1284+
public static final String DOMAIN_IDS = "domainids";
1285+
1286+
public static final String SHOW_PUBLIC = "showpublic";
1287+
1288+
public static final String LIST_ONLY_DEFAULT_THEME = "listonlydefaulttheme";
1289+
1290+
public static final String RECURSIVE_DOMAINS = "recursivedomains";
1291+
12701292
/**
12711293
* This enum specifies IO Drivers, each option controls specific policies on I/O.
12721294
* Qemu guests support "threads" and "native" options Since 0.8.8 ; "io_uring" is supported Since 6.3.0 (QEMU 5.0).

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
5151
description = "the ID of the OS type that best represents the OS of this image.")
5252
private Long osTypeId;
5353

54+
@Parameter(name = ApiConstants.FORCE_UPDATE_OS_TYPE, type = CommandType.BOOLEAN, since = "4.21", description = "Force OS type update. Warning: Updating OS type will " +
55+
"update the guest OS configuration for all the existing Instances deployed with this template/iso, which may affect their behavior.")
56+
private Boolean forceUpdateOsType;
57+
5458
@Parameter(name = ApiConstants.FORMAT, type = CommandType.STRING, description = "the format for the image")
5559
private String format;
5660

@@ -112,6 +116,10 @@ public Long getOsTypeId() {
112116
return osTypeId;
113117
}
114118

119+
public Boolean getForceUpdateOsType() {
120+
return forceUpdateOsType;
121+
}
122+
115123
public Boolean getPasswordEnabled() {
116124
return passwordEnabled;
117125
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import org.apache.cloudstack.api.response.GuestOsMappingResponse;
6565
import org.apache.cloudstack.api.response.GuestVlanRangeResponse;
6666
import org.apache.cloudstack.api.response.GuestVlanResponse;
67+
import org.apache.cloudstack.api.response.GuiThemeResponse;
6768
import org.apache.cloudstack.api.response.HostForMigrationResponse;
6869
import org.apache.cloudstack.api.response.HostResponse;
6970
import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
@@ -150,6 +151,7 @@
150151
import org.apache.cloudstack.direct.download.DirectDownloadCertificate;
151152
import org.apache.cloudstack.direct.download.DirectDownloadCertificateHostMap;
152153
import org.apache.cloudstack.direct.download.DirectDownloadManager;
154+
import org.apache.cloudstack.gui.theme.GuiThemeJoin;
153155
import org.apache.cloudstack.management.ManagementServerHost;
154156
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
155157
import org.apache.cloudstack.region.PortableIp;
@@ -579,4 +581,6 @@ List<TemplateResponse> createTemplateResponses(ResponseView view, VirtualMachine
579581
SharedFSResponse createSharedFSResponse(ResponseView view, SharedFS sharedFS);
580582

581583
void updateTemplateIsoResponsesForIcons(List<TemplateResponse> responses, ResourceTag.ResourceObjectType type);
584+
585+
GuiThemeResponse createGuiThemeResponse(GuiThemeJoin guiThemeJoin);
582586
}

0 commit comments

Comments
 (0)