Skip to content

Commit 4ea3d0b

Browse files
Merge branch '4.22' into fix/nas-backup-restore-volume-mapping
2 parents 2e7d20e + 10d3e11 commit 4ea3d0b

140 files changed

Lines changed: 4043 additions & 428 deletions

File tree

Some content is hidden

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

.github/linters/codespell.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ environmnet
187187
equivalant
188188
erro
189189
erronous
190+
errorprone
190191
everthing
191192
everytime
192193
excute

PendingReleaseNotes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,17 @@ example.ver.1 > example.ver.2:
3939
which can now be attached to Instances. This is to prevent the Secondary
4040
Storage to grow to enormous sizes as Linux Distributions keep growing in
4141
size while a stripped down Linux should fit on a 2.88MB floppy.
42+
43+
4.22.0.0 > 4.22.0.1:
44+
* Disk-only instance snapshots for KVM UEFI VMs now include a sidecar copy of
45+
the active NVRAM state so revert operations restore both disk and firmware
46+
boot state consistently.
47+
48+
* UEFI disk-only instance snapshots taken before this change do not contain an
49+
NVRAM sidecar and cannot be safely reverted. Take a new snapshot after
50+
upgrading before relying on revert for UEFI VMs.
51+
52+
* Taking a disk-only instance snapshot for KVM UEFI VMs now briefly suspends
53+
the guest while the NVRAM sidecar is copied, so that the captured firmware
54+
state is consistent with the disk snapshot. Non-UEFI VMs are unaffected and
55+
continue to snapshot live.

agent/src/main/java/com/cloud/agent/mockvm/MockVmMgr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void freeVncPort(int port) {
249249
public MockVm createVmFromSpec(VirtualMachineTO vmSpec) {
250250
String vmName = vmSpec.getName();
251251
long ramSize = vmSpec.getMinRam();
252-
int utilizationPercent = randSeed.nextInt() % 100;
252+
int utilizationPercent = randSeed.nextInt(100);
253253
MockVm vm = null;
254254

255255
synchronized (this) {

api/src/main/java/com/cloud/host/Host.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public static String[] toStrings(Host.Type... types) {
5555
}
5656

5757
String HOST_UEFI_ENABLE = "host.uefi.enable";
58+
String HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM = "host.kvm.diskonlyvmsnapshot.nvram";
5859
String HOST_VOLUME_ENCRYPTION = "host.volume.encryption";
5960
String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
6061
String HOST_VDDK_SUPPORT = "host.vddk.support";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public static class Param {
7979
public static final Param PreserveNics = new Param("PreserveNics");
8080
public static final Param ConsiderLastHost = new Param("ConsiderLastHost");
8181
public static final Param ReturnAfterVolumePrepare = new Param("ReturnAfterVolumePrepare");
82+
public static final Param ResetPasswordOnRestore = new Param("ResetPasswordOnRestore");
8283

8384
private String name;
8485

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ public class ApiConstants {
452452
public static final String CURRENT_PASSWORD = "currentpassword";
453453
public static final String SHOULD_UPDATE_PASSWORD = "update_passwd_on_host";
454454
public static final String PASSWORD_ENABLED = "passwordenabled";
455+
public static final String RESET_PASSWORD = "resetpassword";
455456
public static final String SSHKEY_ENABLED = "sshkeyenabled";
456457
public static final String PATH = "path";
457458
public static final String PATH_READY = "pathready";

api/src/main/java/org/apache/cloudstack/api/command/admin/backup/UpdateBackupOfferingCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public Boolean getAllowUserDrivenBackups() {
8383
public void execute() {
8484
try {
8585
if (StringUtils.isAllEmpty(getName(), getDescription()) && getAllowUserDrivenBackups() == null) {
86-
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated, at least one of the",
87-
"following should be informed: name, description or allowUserDrivenBackups.", id));
86+
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated," +
87+
" at least one of the following should be passed: name, description or allowUserDrivenBackups.", id));
8888
}
8989

9090
BackupOffering result = backupManager.updateBackupOffering(this);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public class CreateVMFromBackupCmd extends BaseDeployVMCmd {
7070
@Parameter(name = ApiConstants.PRESERVE_IP, type = CommandType.BOOLEAN, description = "Use the same IP/MAC addresses as stored in the backup metadata. Works only if the original Instance is deleted and the IP/MAC address is available.")
7171
private Boolean preserveIp;
7272

73+
@Parameter(name = ApiConstants.RESET_PASSWORD, type = CommandType.BOOLEAN,
74+
description = "For a password enabled template, whether to generate a new password for the created Instance and return it in the response. " +
75+
"If not specified, the zone setting `restore.vm.from.backup.reset.password` decides.", since = "4.22.1.0")
76+
private Boolean resetPassword;
77+
7378
/////////////////////////////////////////////////////
7479
/////////////////// Accessors ///////////////////////
7580
/////////////////////////////////////////////////////
@@ -90,6 +95,10 @@ public boolean getPreserveIp() {
9095
return (preserveIp != null) ? preserveIp : false;
9196
}
9297

98+
public Boolean getResetPassword() {
99+
return resetPassword;
100+
}
101+
93102
@Override
94103
public void create() {
95104
UserVm vm;

api/src/main/java/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
import com.cloud.vm.VirtualMachine;
3838
import com.cloud.vm.snapshot.VMSnapshot;
3939

40-
@APICommand(name = "createVMSnapshot", description = "Creates Snapshot for an Instance.", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class},
40+
@APICommand(name = "createVMSnapshot", description = "Creates Snapshot for an Instance. Running KVM UEFI disk-only snapshots briefly suspend the Instance while copying NVRAM state.",
41+
responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class},
4142
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
4243
public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
4344

api/src/test/java/com/cloud/network/IsolationMethodTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class IsolationMethodTest {
2626
@After
2727
public void cleanTheRegistry() {
28-
PhysicalNetwork.IsolationMethod.registeredIsolationMethods.removeAll(PhysicalNetwork.IsolationMethod.registeredIsolationMethods);
28+
PhysicalNetwork.IsolationMethod.registeredIsolationMethods.clear();
2929
}
3030

3131
@Test

0 commit comments

Comments
 (0)