From decf87d6e5ab7d954762543fa8875f681d1da03f Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 14 Apr 2026 18:06:23 +0200 Subject: [PATCH] vmware: do not check secondary storage when start a system vm --- .../vmware/resource/VmwareResource.java | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 831e222200ab..0b2747ce0993 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -2271,39 +2271,7 @@ protected StartAnswer execute(StartCommand cmd) { // Setup ISO device // - // prepare systemvm patch ISO - if (vmSpec.getType() != VirtualMachine.Type.User) { - // attach ISO (for patching of system VM) - Pair secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId)); - String secStoreUrl = secStoreUrlAndId.first(); - if (secStoreUrl == null) { - String msg = String.format("NFS secondary or cache storage of dc %s either doesn't have enough capacity (has reached %d%% usage threshold) or not ready yet, or non-NFS secondary storage is used", - _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); - throw new Exception(msg); - } - - ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl); - if (morSecDs == null) { - String msg = "Failed to prepare secondary storage on host, NFS secondary or cache store url: " + secStoreUrl + " in dc "+ _dcId; - throw new Exception(msg); - } - DatastoreMO secDsMo = new DatastoreMO(hyperHost.getContext(), morSecDs); - - deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); - Pair isoInfo = VmwareHelper.prepareIsoDevice(vmMo, - null, secDsMo.getMor(), true, true, ideUnitNumber++, i + 1); - deviceConfigSpecArray[i].setDevice(isoInfo.first()); - if (isoInfo.second()) { - if (logger.isDebugEnabled()) - logger.debug("Prepare ISO volume at new device " + _gson.toJson(isoInfo.first())); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.ADD); - } else { - if (logger.isDebugEnabled()) - logger.debug("Prepare ISO volume at existing device " + _gson.toJson(isoInfo.first())); - deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.EDIT); - } - i++; - } else if (!deployAsIs) { + if (VirtualMachine.Type.User.equals(vmSpec.getType()) && !deployAsIs) { // Note: we will always plug a CDROM device if (volIso != null) { for (DiskTO vol : disks) {