This is an automated email from the ASF dual-hosted git repository. Pearl1594 pushed a commit to branch clvm-ng-vm-snapshots in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 1e23cb2eca3e224f9aceca37dff67b7ce9e04ab7 Author: Pearl1594 <[email protected]> AuthorDate: Fri Nov 27 08:29:23 2026 -0500 CLVM_NG: drop the host capability check for disk and memory VM snapshots --- api/src/main/java/com/cloud/host/Host.java | 1 - .../java/com/cloud/agent/manager/AgentManagerImpl.java | 6 +----- .../vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java | 15 --------------- .../hypervisor/kvm/resource/LibvirtComputingResource.java | 2 -- .../kvm/resource/wrapper/LibvirtReadyCommandWrapper.java | 1 - 5 files changed, 1 insertion(+), 24 deletions(-) diff --git a/api/src/main/java/com/cloud/host/Host.java b/api/src/main/java/com/cloud/host/Host.java index 6911d980a3a..09325a8f426 100644 --- a/api/src/main/java/com/cloud/host/Host.java +++ b/api/src/main/java/com/cloud/host/Host.java @@ -56,7 +56,6 @@ public interface Host extends StateObject<Status>, Identity, Partition, HAResour String HOST_UEFI_ENABLE = "host.uefi.enable"; String HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM = "host.kvm.diskonlyvmsnapshot.nvram"; - String HOST_KVM_VM_SNAPSHOT_MEMORY = "host.kvm.vmsnapshot.memory"; String HOST_VOLUME_ENCRYPTION = "host.volume.encryption"; String HOST_RBD_VOLUME_ENCRYPTION = "host.volume.encryption.rbd"; String HOST_RBD_CLI = "host.rbd.cli"; diff --git a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java index f8e70455231..e6b547ef9dc 100644 --- a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java +++ b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java @@ -812,7 +812,6 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl } String uefiEnabled = detailsMap.get(Host.HOST_UEFI_ENABLE); String diskOnlyVmSnapshotNvramSupport = detailsMap.get(Host.HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM); - String vmSnapshotMemorySupport = detailsMap.get(Host.HOST_KVM_VM_SNAPSHOT_MEMORY); String virtv2vVersion = detailsMap.get(Host.HOST_VIRTV2V_VERSION); String ovftoolVersion = detailsMap.get(Host.HOST_OVFTOOL_VERSION); String vddkSupport = detailsMap.get(Host.HOST_VDDK_SUPPORT); @@ -832,7 +831,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl String qemuImgRbdSupport = detailsMap.get(Host.HOST_QEMU_RBD_SUPPORT); String vddkRbdDirectImportSupport = detailsMap.get(Host.HOST_VDDK_RBD_DIRECT_IMPORT_SUPPORT); logger.debug("Got HOST_UEFI_ENABLE [{}] for host [{}]:", uefiEnabled, host); - if (ObjectUtils.anyNotNull(uefiEnabled, diskOnlyVmSnapshotNvramSupport, vmSnapshotMemorySupport, virtv2vVersion, ovftoolVersion, vddkSupport, vddkLibDir, vddkVersion, + if (ObjectUtils.anyNotNull(uefiEnabled, diskOnlyVmSnapshotNvramSupport, virtv2vVersion, ovftoolVersion, vddkSupport, vddkLibDir, vddkVersion, vlanFilteringEnabled, guestBridgeStpEnabled, vlanTrunkXmlSupported, vmwareCbtSupport, vmwareCbtInPlaceFinalizationSupport, vmwareCbtRbdSupport, qemuImgVersion, qemuNbdVersion, qemuIoVersion, virtV2vInPlaceVersion, virtv2vInPlaceSupport, qemuImgRbdSupport, vddkRbdDirectImportSupport)) { @@ -844,9 +843,6 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl if (syncBooleanHostCapability(host, Host.HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM, diskOnlyVmSnapshotNvramSupport)) { updateNeeded = true; } - if (syncBooleanHostCapability(host, Host.HOST_KVM_VM_SNAPSHOT_MEMORY, vmSnapshotMemorySupport)) { - updateNeeded = true; - } if (StringUtils.isNotBlank(virtv2vVersion) && !virtv2vVersion.equals(host.getDetails().get(Host.HOST_VIRTV2V_VERSION))) { host.getDetails().put(Host.HOST_VIRTV2V_VERSION, virtv2vVersion); updateNeeded = true; diff --git a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java index 0c20df79117..6c8c7a2993a 100644 --- a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java +++ b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java @@ -226,7 +226,6 @@ public class KvmFileBasedStorageVmSnapshotStrategy extends StorageVMSnapshotStra VMSnapshotVO vmSnapshotBeingReverted = (VMSnapshotVO) vmSnapshot; Long hostId = pickHostForUefiNvramAwareDiskOnlySnapshot(userVm, "revert"); validateHostSupportsUefiNvramAwareDiskOnlySnapshots(hostId, userVm, "revert"); - validateHostSupportsMemorySnapshot(hostId, vmSnapshot, "revert"); transitStateWithoutThrow(vmSnapshotBeingReverted, VMSnapshot.Event.RevertRequested); @@ -603,7 +602,6 @@ public class KvmFileBasedStorageVmSnapshotStrategy extends StorageVMSnapshotStra Long hostId = pickHostForUefiNvramAwareDiskOnlySnapshot(userVm, "create"); validateHostSupportsUefiNvramAwareDiskOnlySnapshots(hostId, userVm, "create"); - validateHostSupportsMemorySnapshot(hostId, vmSnapshot, "create"); VMSnapshotVO vmSnapshotVO = (VMSnapshotVO) vmSnapshot; List<VolumeObjectTO> volumeTOs = vmSnapshotHelper.getVolumeTOList(userVm.getId()); @@ -866,16 +864,6 @@ public class KvmFileBasedStorageVmSnapshotStrategy extends StorageVMSnapshotStra return memoryDetail != null ? memoryDetail.getValue() : null; } - protected void validateHostSupportsMemorySnapshot(Long hostId, VMSnapshot vmSnapshot, String operation) { - if (!VMSnapshot.Type.DiskAndMemory.equals(vmSnapshot.getType())) { - return; - } - if (!isHostCapabilityEnabled(hostId, Host.HOST_KVM_VM_SNAPSHOT_MEMORY)) { - throw new CloudRuntimeException(String.format("Cannot %s a VM snapshot with memory on host [%s] because the host does not advertise support for it. Upgrade the KVM agent and retry.", - operation, hostId)); - } - } - protected String getNvramSnapshotPath(VMSnapshotVO vmSnapshot) { VMSnapshotDetailsVO nvramDetail = vmSnapshotDetailsDao.findDetail(vmSnapshot.getId(), KVM_FILE_BASED_STORAGE_SNAPSHOT_NVRAM); return nvramDetail != null ? nvramDetail.getValue() : null; @@ -915,9 +903,6 @@ public class KvmFileBasedStorageVmSnapshotStrategy extends StorageVMSnapshotStra if (StringUtils.isNotBlank(getNvramSnapshotPath(vmSnapshotVO))) { requiredCapabilities.add(Host.HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM); } - if (StringUtils.isNotBlank(getMemorySnapshotPath(vmSnapshotVO))) { - requiredCapabilities.add(Host.HOST_KVM_VM_SNAPSHOT_MEMORY); - } if (requiredCapabilities.isEmpty()) { return selectedHostId; } diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 18f821216df..5ef4c758fa7 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -21,7 +21,6 @@ import static com.cloud.host.Host.HOST_CDROM_MAX_COUNT; import static com.cloud.host.Host.HOST_CPU_MAX_SPEED_MHZ; import static com.cloud.host.Host.HOST_INSTANCE_CONVERSION; import static com.cloud.host.Host.HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM; -import static com.cloud.host.Host.HOST_KVM_VM_SNAPSHOT_MEMORY; import static com.cloud.host.Host.HOST_OVFTOOL_VERSION; import static com.cloud.host.Host.HOST_QEMU_RBD_SUPPORT; import static com.cloud.host.Host.HOST_QEMU_IMG_VERSION; @@ -4513,7 +4512,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv cmd.getHostDetails().putAll(getVersionStrings()); cmd.getHostDetails().put(KeyStoreUtils.SECURED, String.valueOf(isHostSecured()).toLowerCase()); cmd.getHostDetails().put(HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM, Boolean.TRUE.toString()); - cmd.getHostDetails().put(HOST_KVM_VM_SNAPSHOT_MEMORY, Boolean.TRUE.toString()); cmd.setPool(pool); cmd.setCluster(clusterId); cmd.setGatewayIpAddress(localGateway); diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java index 7b2ddeabc01..62fab3b40b4 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java @@ -44,7 +44,6 @@ public final class LibvirtReadyCommandWrapper extends CommandWrapper<ReadyComman public Answer execute(final ReadyCommand command, final LibvirtComputingResource libvirtComputingResource) { Map<String, String> hostDetails = new HashMap<String, String>(); hostDetails.put(Host.HOST_KVM_DISK_ONLY_VM_SNAPSHOT_NVRAM, Boolean.TRUE.toString()); - hostDetails.put(Host.HOST_KVM_VM_SNAPSHOT_MEMORY, Boolean.TRUE.toString()); if (hostSupportsUefi(libvirtComputingResource.isUbuntuOrDebianHost()) && libvirtComputingResource.isUefiPropertiesFileLoaded()) { hostDetails.put(Host.HOST_UEFI_ENABLE, Boolean.TRUE.toString());
