Skip to content

Commit 1cd990e

Browse files
committed
Merge remote-tracking branch 'apache/4.20' into fix-kvm-agent-install-warnings
2 parents 034160a + 4d95f08 commit 1cd990e

File tree

118 files changed

+1558
-425
lines changed

Some content is hidden

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

118 files changed

+1558
-425
lines changed

api/src/main/java/com/cloud/hypervisor/Hypervisor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@
3131
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.DirectDownloadTemplate;
3232
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.RootDiskSizeOverride;
3333
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigration;
34+
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigrationWithSnapshots;
3435

3536
public class Hypervisor {
3637
public static class HypervisorType {
3738
public enum Functionality {
3839
DirectDownloadTemplate,
3940
RootDiskSizeOverride,
40-
VmStorageMigration
41+
VmStorageMigration,
42+
VmStorageMigrationWithSnapshots
4143
}
4244

4345
private static final Map<String, HypervisorType> hypervisorTypeMap = new LinkedHashMap<>();
4446
public static final HypervisorType None = new HypervisorType("None"); //for storage hosts
4547
public static final HypervisorType XenServer = new HypervisorType("XenServer", ImageFormat.VHD, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
4648
public static final HypervisorType KVM = new HypervisorType("KVM", ImageFormat.QCOW2, EnumSet.of(DirectDownloadTemplate, RootDiskSizeOverride, VmStorageMigration));
47-
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
49+
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration, VmStorageMigrationWithSnapshots));
4850
public static final HypervisorType Hyperv = new HypervisorType("Hyperv");
4951
public static final HypervisorType VirtualBox = new HypervisorType("VirtualBox");
5052
public static final HypervisorType Parralels = new HypervisorType("Parralels");

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,31 @@ UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException
503503

504504
void collectVmNetworkStatistics (UserVm userVm);
505505

506-
UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemplate template, final String instanceName, final String displayName, final Account owner, final String userData, final Account caller, final Boolean isDisplayVm, final String keyboard,
506+
/**
507+
* Import VM into CloudStack
508+
* @param zone importing zone
509+
* @param host importing host
510+
* @param template template for the imported VM
511+
* @param instanceNameInternal set to null to CloudStack to autogenerate from the next available VM ID on database
512+
* @param displayName display name for the imported VM
513+
* @param owner owner of the imported VM
514+
* @param userData user data for the imported VM
515+
* @param caller caller account
516+
* @param isDisplayVm true to display the imported VM
517+
* @param keyboard keyboard distribution for the imported VM
518+
* @param accountId account ID
519+
* @param userId user ID
520+
* @param serviceOffering service offering for the imported VM
521+
* @param sshPublicKey ssh key for the imported VM
522+
* @param hostName the name for the imported VM
523+
* @param hypervisorType hypervisor type for the imported VM
524+
* @param customParameters details for the imported VM
525+
* @param powerState power state of the imported VM
526+
* @param networkNicMap network to nic mapping
527+
* @return the imported VM
528+
* @throws InsufficientCapacityException in case of errors
529+
*/
530+
UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemplate template, final String instanceNameInternal, final String displayName, final Account owner, final String userData, final Account caller, final Boolean isDisplayVm, final String keyboard,
507531
final long accountId, final long userId, final ServiceOffering serviceOffering, final String sshPublicKey,
508532
final String hostName, final HypervisorType hypervisorType, final Map<String, String> customParameters,
509533
final VirtualMachine.PowerState powerState, final LinkedHashMap<String, List<NicProfile>> networkNicMap) throws InsufficientCapacityException;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.util.List;
2121

22+
import com.cloud.utils.fsm.NoTransitionException;
2223
import org.apache.cloudstack.api.command.user.vmsnapshot.ListVMSnapshotCmd;
2324

2425
import com.cloud.exception.ConcurrentOperationException;
@@ -53,4 +54,6 @@ UserVm revertToSnapshot(Long vmSnapshotId) throws InsufficientServerCapacityExce
5354
* @param id vm id
5455
*/
5556
boolean deleteVMSnapshotsFromDB(Long vmId, boolean unmanage);
57+
58+
void updateOperationFailed(VMSnapshot vmSnapshot) throws NoTransitionException;
5659
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class ApiConstants {
2626
public static final String ACTIVATION_RULE = "activationrule";
2727
public static final String ACTIVITY = "activity";
2828
public static final String ADAPTER_TYPE = "adaptertype";
29+
public static final String ADDITONAL_CONFIG_ENABLED = "additionalconfigenabled";
2930
public static final String ADDRESS = "address";
3031
public static final String ALGORITHM = "algorithm";
3132
public static final String ALIAS = "alias";

api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public void execute() {
7373
response.setSharedFsVmMinCpuCount((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_CPU_COUNT));
7474
response.setSharedFsVmMinRamSize((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_RAM_SIZE));
7575
response.setDynamicScalingEnabled((Boolean) capabilities.get(ApiConstants.DYNAMIC_SCALING_ENABLED));
76+
response.setAdditionalConfigEnabled((Boolean) capabilities.get(ApiConstants.ADDITONAL_CONFIG_ENABLED));
7677
response.setObjectName("capability");
7778
response.setResponseName(getCommandName());
7879
this.setResponseObject(response);

api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,9 @@ public Long getSyncObjId() {
209209
}
210210
return null;
211211
}
212+
213+
@Override
214+
public Long getApiResourceId() {
215+
return getEntityId();
216+
}
212217
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void setNetworkAvailable(String networkAvailable) {
464464

465465
@Override
466466
public void setVpcLimit(String vpcLimit) {
467-
this.vpcLimit = networkLimit;
467+
this.vpcLimit = vpcLimit;
468468
}
469469

470470
@Override

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public class CapabilitiesResponse extends BaseResponse {
140140
@Param(description = "true if dynamically scaling for instances is enabled", since = "4.21.0")
141141
private Boolean dynamicScalingEnabled;
142142

143+
@SerializedName(ApiConstants.ADDITONAL_CONFIG_ENABLED)
144+
@Param(description = "true if additional configurations or extraconfig can be passed to Instances", since = "4.20.2")
145+
private Boolean additionalConfigEnabled;
146+
143147
public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {
144148
this.securityGroupsEnabled = securityGroupsEnabled;
145149
}
@@ -255,4 +259,8 @@ public void setSharedFsVmMinRamSize(Integer sharedFsVmMinRamSize) {
255259
public void setDynamicScalingEnabled(Boolean dynamicScalingEnabled) {
256260
this.dynamicScalingEnabled = dynamicScalingEnabled;
257261
}
262+
263+
public void setAdditionalConfigEnabled(Boolean additionalConfigEnabled) {
264+
this.additionalConfigEnabled = additionalConfigEnabled;
265+
}
258266
}

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotDataFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import com.cloud.storage.DataStoreRole;
24+
import com.cloud.utils.fsm.NoTransitionException;
2425

2526
public interface SnapshotDataFactory {
2627
SnapshotInfo getSnapshot(long snapshotId, DataStore store);
@@ -42,4 +43,6 @@ public interface SnapshotDataFactory {
4243
List<SnapshotInfo> listSnapshotOnCache(long snapshotId);
4344

4445
SnapshotInfo getReadySnapshotOnCache(long snapshotId);
46+
47+
void updateOperationFailed(long snapshotId) throws NoTransitionException;
4548
}

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/VMSnapshotStrategy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.apache.cloudstack.engine.subsystem.api.storage;
2020

21+
import com.cloud.utils.fsm.NoTransitionException;
2122
import com.cloud.vm.snapshot.VMSnapshot;
2223

2324
public interface VMSnapshotStrategy {
@@ -44,4 +45,6 @@ public interface VMSnapshotStrategy {
4445
* @return true if vm snapshot removed from DB, false if not.
4546
*/
4647
boolean deleteVMSnapshotFromDB(VMSnapshot vmSnapshot, boolean unmanage);
48+
49+
void updateOperationFailed(VMSnapshot vmSnapshot) throws NoTransitionException;
4750
}

0 commit comments

Comments
 (0)