This is an automated email from the ASF dual-hosted git repository. dahn pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit e929f2024ad5bcb92252387dcaf3f09bd2fff7c7 Merge: e32d08e50e1 cd6a8f61ca5 Author: Daan Hoogland <[email protected]> AuthorDate: Thu Feb 5 16:07:46 2026 +0100 Merge branch '4.22' .../cloudstack/api/BaseUpdateTemplateOrIsoCmd.java | 4 +- .../api/command/user/vm/BaseDeployVMCmd.java | 2 +- .../cloudstack/api/response/UserVmResponse.java | 12 ++ .../com/cloud/storage/dao/VMTemplateDaoImpl.java | 4 +- pom.xml | 8 +- .../java/com/cloud/api/query/QueryManagerImpl.java | 2 +- .../com/cloud/api/query/dao/UserVmJoinDaoImpl.java | 8 ++ .../com/cloud/template/TemplateManagerImpl.java | 5 +- .../src/main/java/com/cloud/vm/UserVmManager.java | 9 ++ .../main/java/com/cloud/vm/UserVmManagerImpl.java | 119 ++++++++-------- .../cloud/vm/snapshot/VMSnapshotManagerImpl.java | 23 +-- .../cloud/api/query/dao/UserVmJoinDaoImplTest.java | 4 + .../cloud/vm/snapshot/VMSnapshotManagerTest.java | 42 ++++-- systemvm/agent/noVNC/core/rfb.js | 124 +++++++++++++---- .../noVNC/keymaps/generate-language-keymaps.py | 7 +- .../agent/noVNC/keymaps/keymap-es-latam-atset1.js | 131 +++++++++++++++++ tools/checkstyle/src/main/resources/cloud-pmd.xml | 53 ++++--- ui/public/config.json | 3 +- ui/public/locales/en.json | 6 + ui/src/components/view/DetailSettings.vue | 21 ++- ui/src/components/view/DomainDeleteConfirm.vue | 155 +++++++++++++++++++++ ui/src/views/iam/DomainView.vue | 56 +++++++- ui/src/views/image/UpdateTemplate.vue | 45 ++++-- 23 files changed, 670 insertions(+), 173 deletions(-) diff --cc server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index 9a052e1d42d,f36c851e5bb..36f1f7a2f12 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@@ -150,7 -150,7 +150,6 @@@ import org.apache.cloudstack.utils.byte import org.apache.cloudstack.utils.security.ParserUtils; import org.apache.cloudstack.vm.UnmanagedVMsManager; import org.apache.cloudstack.vm.lease.VMLeaseManager; --import org.apache.cloudstack.vm.schedule.VMScheduleManager; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.math.NumberUtils; @@@ -315,7 -315,7 +314,6 @@@ import com.cloud.resource.ResourceState import com.cloud.resourcelimit.CheckedReservation; import com.cloud.server.ManagementService; import com.cloud.server.ResourceTag; --import com.cloud.server.StatsCollector; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.service.dao.ServiceOfferingDetailsDao; @@@ -615,28 -615,28 +613,28 @@@ public class UserVmManagerImpl extends SnapshotPolicyDao snapshotPolicyDao; @Inject BackupScheduleDao backupScheduleDao; -- -- @Inject -- private StatsCollector statsCollector; @Inject private UserDataDao userDataDao; -- @Inject protected SnapshotHelper snapshotHelper; -- @Inject private AutoScaleManager autoScaleManager; -- -- @Inject -- VMScheduleManager vmScheduleManager; @Inject NsxProviderDao nsxProviderDao; -- @Inject NetworkService networkService; -- @Inject SnapshotDataFactory snapshotDataFactory; ++ @Inject ++ private OrchestrationService _orchSrvc; ++ @Inject ++ private VolumeOrchestrationService volumeMgr; ++ @Inject ++ private ManagementService _mgr; ++ @Inject ++ private UserDataManager userDataManager; ++ @Inject ++ VnfTemplateManager vnfTemplateManager; private ScheduledExecutorService _executor = null; private ScheduledExecutorService _vmIpFetchExecutor = null; @@@ -646,8 -646,8 +644,6 @@@ private int capacityReleaseInterval; private ExecutorService _vmIpFetchThreadExecutor; private List<KubernetesServiceHelper> kubernetesServiceHelpers; -- -- private String _instance; private boolean _instanceNameFlag; private int _scaleRetry; @@@ -655,10 -655,10 +651,6 @@@ protected static long ROOT_DEVICE_ID = 0; -- private static final int MAX_HTTP_GET_LENGTH = 2 * MAX_USER_DATA_LENGTH_BYTES; -- private static final int NUM_OF_2K_BLOCKS = 512; -- private static final int MAX_HTTP_POST_LENGTH = NUM_OF_2K_BLOCKS * MAX_USER_DATA_LENGTH_BYTES; -- public List<KubernetesServiceHelper> getKubernetesServiceHelpers() { return kubernetesServiceHelpers; } @@@ -667,34 -667,34 +659,19 @@@ this.kubernetesServiceHelpers = kubernetesServiceHelpers; } -- @Inject -- private OrchestrationService _orchSrvc; -- -- @Inject -- private VolumeOrchestrationService volumeMgr; -- -- @Inject -- private ManagementService _mgr; -- -- @Inject -- private UserDataManager userDataManager; -- -- @Inject -- VnfTemplateManager vnfTemplateManager; -- -- private static final ConfigKey<Integer> VmIpFetchWaitInterval = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmip.retrieval.interval", "180", ++ private static final ConfigKey<Integer> VmIpFetchWaitInterval = new ConfigKey<>("Advanced", Integer.class, "externaldhcp.vmip.retrieval.interval", "180", "Wait Interval (in seconds) for shared network vm dhcp ip addr fetch for next iteration ", true); -- private static final ConfigKey<Integer> VmIpFetchTrialMax = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmip.max.retry", "10", ++ private static final ConfigKey<Integer> VmIpFetchTrialMax = new ConfigKey<>("Advanced", Integer.class, "externaldhcp.vmip.max.retry", "10", "The max number of retrieval times for shared network vm dhcp ip fetch, in case of failures", true); -- private static final ConfigKey<Integer> VmIpFetchThreadPoolMax = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmipFetch.threadPool.max", "10", ++ private static final ConfigKey<Integer> VmIpFetchThreadPoolMax = new ConfigKey<>("Advanced", Integer.class, "externaldhcp.vmipFetch.threadPool.max", "10", "number of threads for fetching vms ip address", true); -- private static final ConfigKey<Integer> VmIpFetchTaskWorkers = new ConfigKey<Integer>("Advanced", Integer.class, "externaldhcp.vmipfetchtask.workers", "10", ++ private static final ConfigKey<Integer> VmIpFetchTaskWorkers = new ConfigKey<>("Advanced", Integer.class, "externaldhcp.vmipfetchtask.workers", "10", "number of worker threads for vm ip fetch task ", true); -- private static final ConfigKey<Boolean> AllowDeployVmIfGivenHostFails = new ConfigKey<Boolean>("Advanced", Boolean.class, "allow.deploy.vm.if.deploy.on.given.host.fails", "false", ++ private static final ConfigKey<Boolean> AllowDeployVmIfGivenHostFails = new ConfigKey<>("Advanced", Boolean.class, "allow.deploy.vm.if.deploy.on.given.host.fails", "false", "allow vm to deploy on different host if vm fails to deploy on the given host ", true); private static final ConfigKey<String> KvmAdditionalConfigAllowList = new ConfigKey<>(String.class, @@@ -706,7 -706,7 +683,7 @@@ private static final ConfigKey<String> VmwareAdditionalConfigAllowList = new ConfigKey<>(String.class, "allow.additional.vm.configuration.list.vmware", "Advanced", "", "Comma separated list of allowed additional configuration options.", true, ConfigKey.Scope.Global, null, null, EnableAdditionalVmConfig.key(), null, null, ConfigKey.Kind.CSV, null); -- private static final ConfigKey<Boolean> VmDestroyForcestop = new ConfigKey<Boolean>("Advanced", Boolean.class, "vm.destroy.forcestop", "false", ++ private static final ConfigKey<Boolean> VmDestroyForcestop = new ConfigKey<>("Advanced", Boolean.class, "vm.destroy.forcestop", "false", "On destroy, force-stop takes this value ", true); @Override @@@ -735,7 -735,7 +712,6 @@@ long vmId; int retrievalCount = VmIpFetchTrialMax.value(); -- public VmAndCountDetails() { } @@@ -1192,7 -1192,7 +1168,7 @@@ if (dc.getNetworkType() == DataCenter.NetworkType.Advanced) { //List all networks of vm List<Long> vmNetworks = _vmNetworkMapDao.getNetworks(vmId); -- List<DomainRouterVO> routers = new ArrayList<DomainRouterVO>(); ++ List<DomainRouterVO> routers = new ArrayList<>(); //List the stopped routers for(long vmNetworkId : vmNetworks) { List<DomainRouterVO> router = _routerDao.listStopped(vmNetworkId); @@@ -2936,7 -2915,10 +2908,10 @@@ .map(item -> (item).trim()) .collect(Collectors.toList()); List<VMInstanceDetailVO> existingDetails = vmInstanceDetailsDao.listDetails(id); - if (cleanupDetails){ + if (cleanupDetails) { + if (template != null && template.isDeployAsIs()) { + throw new InvalidParameterValueException("Detail settings are read from OVA, it cannot be cleaned up by API call."); + } if (caller != null && caller.getType() == Account.Type.ADMIN) { for (final VMInstanceDetailVO detail : existingDetails) { if (detail != null && detail.isDisplay() && !isExtraConfig(detail.getName())) { @@@ -3214,7 -3220,7 +3206,7 @@@ // Verify that vm's hostName is unique -- List<NetworkVO> vmNtwks = new ArrayList<NetworkVO>(nics.size()); ++ List<NetworkVO> vmNtwks = new ArrayList<>(nics.size()); for (Nic nic : nics) { vmNtwks.add(_networkDao.findById(nic.getNetworkId())); } @@@ -3784,7 -3790,7 +3776,7 @@@ StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); -- List<NetworkVO> networkList = new ArrayList<NetworkVO>(); ++ List<NetworkVO> networkList = new ArrayList<>(); // Verify that caller can perform actions in behalf of vm owner _accountMgr.checkAccess(caller, null, true, owner); @@@ -3810,7 -3816,7 +3802,7 @@@ //add the default securityGroup only if no security group is specified if (securityGroupIdList == null || securityGroupIdList.isEmpty()) { if (securityGroupIdList == null) { -- securityGroupIdList = new ArrayList<Long>(); ++ securityGroupIdList = new ArrayList<>(); } SecurityGroup defaultGroup = _securityGroupMgr.getDefaultSecurityGroup(owner.getId()); if (defaultGroup != null) { @@@ -3842,7 -3848,7 +3834,7 @@@ Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType, Volume volume, Snapshot snapshot) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); -- List<NetworkVO> networkList = new ArrayList<NetworkVO>(); ++ List<NetworkVO> networkList = new ArrayList<>(); boolean isSecurityGroupEnabledNetworkUsed = false; boolean isVmWare = (template.getHypervisorType() == HypervisorType.VMware || (hypervisor != null && hypervisor == HypervisorType.VMware)); @@@ -3920,7 -3926,7 +3912,7 @@@ //add the default securityGroup only if no security group is specified if (securityGroupIdList == null || securityGroupIdList.isEmpty()) { if (securityGroupIdList == null) { -- securityGroupIdList = new ArrayList<Long>(); ++ securityGroupIdList = new ArrayList<>(); } SecurityGroup defaultGroup = _securityGroupMgr.getDefaultSecurityGroup(owner.getId()); @@@ -3955,7 -3961,7 +3947,7 @@@ StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); -- List<NetworkVO> networkList = new ArrayList<NetworkVO>(); ++ List<NetworkVO> networkList = new ArrayList<>(); // Verify that caller can perform actions in behalf of vm owner _accountMgr.checkAccess(caller, null, true, owner); @@@ -4910,10 -4916,10 +4902,10 @@@ logger.debug("Allocating in the DB for vm"); DataCenterDeployment plan = new DataCenterDeployment(zone.getId()); -- List<String> computeTags = new ArrayList<String>(); ++ List<String> computeTags = new ArrayList<>(); computeTags.add(offering.getHostTag()); -- List<String> rootDiskTags = new ArrayList<String>(); ++ List<String> rootDiskTags = new ArrayList<>(); DiskOfferingVO rootDiskOfferingVO = _diskOfferingDao.findById(rootDiskOfferingId); rootDiskTags.add(rootDiskOfferingVO.getTags()); @@@ -5127,7 -5133,7 +5119,7 @@@ VirtualMachine.class.getName(), vm.getUuid(), isDisplay); } else { -- Map<String, String> customParameters = new HashMap<String, String>(); ++ Map<String, String> customParameters = new HashMap<>(); customParameters.put(UsageEventVO.DynamicParameters.cpuNumber.name(), serviceOffering.getCpu().toString()); customParameters.put(UsageEventVO.DynamicParameters.cpuSpeed.name(), serviceOffering.getSpeed().toString()); customParameters.put(UsageEventVO.DynamicParameters.memory.name(), serviceOffering.getRamSize().toString()); @@@ -5144,7 -5150,7 +5136,7 @@@ } logger.debug("Collect vm network statistics from host before stopping Vm"); long hostId = userVm.getHostId(); -- List<String> vmNames = new ArrayList<String>(); ++ List<String> vmNames = new ArrayList<>(); vmNames.add(userVm.getInstanceName()); final HostVO host = _hostDao.findById(hostId); Account account = _accountMgr.getAccount(userVm.getAccountId()); @@@ -5736,7 -5742,7 +5728,7 @@@ SecurityGroup defaultSecurityGroup = _securityGroupMgr.getDefaultSecurityGroup(vm.getAccountId()); if (defaultSecurityGroup != null) { -- List<Long> groupList = new ArrayList<Long>(); ++ List<Long> groupList = new ArrayList<>(); groupList.add(defaultSecurityGroup.getId()); _securityGroupMgr.addInstanceToGroups(vm, groupList); } @@@ -6025,7 -6031,7 +6017,7 @@@ return; } long hostId = userVm.getHostId(); -- List<String> vmNames = new ArrayList<String>(); ++ List<String> vmNames = new ArrayList<>(); vmNames.add(userVm.getInstanceName()); final HostVO host = _hostDao.findById(hostId); Account account = _accountMgr.getAccount(userVm.getAccountId()); @@@ -6433,7 -6439,7 +6425,7 @@@ String userData = null; Long userDataId = null; String userDataDetails = null; -- List<String> sshKeyPairNames = new ArrayList<String>(); ++ List<String> sshKeyPairNames = new ArrayList<>(); if (cmd instanceof CreateVMFromBackupCmd) { if (cmd.getUserData() != null) { throw new InvalidParameterValueException("User data not supported for instance created from backup"); @@@ -6890,7 -6896,7 +6882,7 @@@ //transform group names to ids here if (cmd.getSecurityGroupNameList() != null) { -- List<Long> securityGroupIds = new ArrayList<Long>(); ++ List<Long> securityGroupIds = new ArrayList<>(); for (String groupName : cmd.getSecurityGroupNameList()) { SecurityGroup sg = _securityGroupMgr.getSecurityGroup(groupName, cmd.getEntityOwnerId()); if (sg == null) { @@@ -7675,7 -7681,7 +7667,7 @@@ } private Map<Long, Long> getVolumePoolMappingForMigrateVmWithStorage(VMInstanceVO vm, Map<String, String> volumeToPool) { -- Map<Long, Long> volToPoolObjectMap = new HashMap<Long, Long>(); ++ Map<Long, Long> volToPoolObjectMap = new HashMap<>(); List<VolumeVO> vmVolumes = getVmVolumesForMigrateVmWithStorage(vm); @@@ -9712,7 -9719,7 +9705,7 @@@ Map<Long, IpAddresses> ipToNetworkMap = cmd.getIpToNetworkMap(); if (networkIds == null && ipToNetworkMap == null) { -- networkIds = new ArrayList<Long>(); ++ networkIds = new ArrayList<>(); ipToNetworkMap = backupManager.getIpToNetworkMapFromBackup(backup, cmd.getPreserveIp(), networkIds); }
