You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2025/10/07 13:15:54 UTC

(cloudstack) branch main updated (9bcd98876d6 -> 5f63e8493c5)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


    from 9bcd98876d6 Make kvm domain persistent when unmanaged from CS (#11541)
     add 30cb8c7a820 Fix importing unmanaged instances due to incorrect internal name (#11753)
     add 70af55e8489 UI support for extraconfig in deploy and update instance  (#11719)
     add c631d6a480d CKS: generate a random UUID as password of CKS user in project (#11639)
     add ca7138b3bdf server: Consider Instance in Starting state as well for allocation algorithm (#11751)
     add e12813de497 CKS: fix CKS creation on an existing Shared and Routed network (#11735)
     add 8e4dc0a66d2 VMware: match nic mac for ip address fetch (#10641)
     add 963a67b8167 server: add user.password.reset.smtp.useStartTLS and enabledSecurityProtocols for password reset (#11228)
     add 823cb00a0a0 server: do not enable the disabled local storage(s) on host connection during mgmt server / agent start (#11722)
     add a208db54ea8 linstor: use sparse/discard qemu-img convert on thin devices (#11787)
     add aca82359606 Merge branch '4.19' into 4.20
     new 5f63e8493c5 Merge branch '4.20'

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cloudstack/api/ApiConstants.java    |   1 +
 .../command/user/config/ListCapabilitiesCmd.java   |   1 +
 .../api/response/CapabilitiesResponse.java         |   8 ++
 .../java/com/cloud/vm/dao/VMInstanceDaoImpl.java   |   6 +-
 .../volume/datastore/PrimaryDataStoreHelper.java   |   4 +-
 .../hypervisor/vmware/resource/VmwareResource.java |  17 ++-
 .../cluster/KubernetesClusterManagerImpl.java      |   5 +-
 .../CloudStackPrimaryDataStoreLifeCycleImpl.java   |   2 +-
 plugins/storage/volume/linstor/CHANGELOG.md        |   6 ++
 .../LinstorRevertBackupSnapshotCommandWrapper.java |  22 +++-
 .../kvm/storage/LinstorStorageAdaptor.java         |  38 +------
 .../storage/datastore/util/LinstorUtil.java        |  34 ++++++
 .../com/cloud/server/ManagementServerImpl.java     | 120 ++++++++-------------
 .../java/com/cloud/user/AccountManagerImpl.java    |   5 +-
 .../src/main/java/com/cloud/vm/UserVmManager.java  |   9 ++
 .../main/java/com/cloud/vm/UserVmManagerImpl.java  |  31 +++---
 .../cloudstack/user/UserPasswordResetManager.java  |  11 ++
 .../user/UserPasswordResetManagerImpl.java         |   6 ++
 ui/public/locales/en.json                          |   2 +
 ui/src/views/compute/DeployVM.vue                  |  12 +++
 ui/src/views/compute/EditVM.vue                    |  23 ++++
 21 files changed, 218 insertions(+), 145 deletions(-)


(cloudstack) 01/01: Merge branch '4.20'

Posted by da...@apache.org.
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 5f63e8493c54909402fc2437fa41d4cf51070bd8
Merge: 9bcd98876d6 aca82359606
Author: Daan Hoogland <da...@apache.org>
AuthorDate: Tue Oct 7 15:12:53 2025 +0200

    Merge branch '4.20'

 .../org/apache/cloudstack/api/ApiConstants.java    |   1 +
 .../command/user/config/ListCapabilitiesCmd.java   |   1 +
 .../api/response/CapabilitiesResponse.java         |   8 ++
 .../java/com/cloud/vm/dao/VMInstanceDaoImpl.java   |   6 +-
 .../volume/datastore/PrimaryDataStoreHelper.java   |   4 +-
 .../hypervisor/vmware/resource/VmwareResource.java |  17 ++-
 .../cluster/KubernetesClusterManagerImpl.java      |   5 +-
 .../CloudStackPrimaryDataStoreLifeCycleImpl.java   |   2 +-
 plugins/storage/volume/linstor/CHANGELOG.md        |   6 ++
 .../LinstorRevertBackupSnapshotCommandWrapper.java |  22 +++-
 .../kvm/storage/LinstorStorageAdaptor.java         |  38 +------
 .../storage/datastore/util/LinstorUtil.java        |  34 ++++++
 .../com/cloud/server/ManagementServerImpl.java     | 120 ++++++++-------------
 .../java/com/cloud/user/AccountManagerImpl.java    |   5 +-
 .../src/main/java/com/cloud/vm/UserVmManager.java  |   9 ++
 .../main/java/com/cloud/vm/UserVmManagerImpl.java  |  31 +++---
 .../cloudstack/user/UserPasswordResetManager.java  |  11 ++
 .../user/UserPasswordResetManagerImpl.java         |   6 ++
 ui/public/locales/en.json                          |   2 +
 ui/src/views/compute/DeployVM.vue                  |  12 +++
 ui/src/views/compute/EditVM.vue                    |  23 ++++
 21 files changed, 218 insertions(+), 145 deletions(-)

diff --cc api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
index e73bb97a21b,7553ccffa7d..ed1bd7b063b
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
@@@ -72,9 -72,8 +72,10 @@@ public class ListCapabilitiesCmd extend
          response.setInstancesDisksStatsRetentionTime((Integer) capabilities.get(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_TIME));
          response.setSharedFsVmMinCpuCount((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_CPU_COUNT));
          response.setSharedFsVmMinRamSize((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_RAM_SIZE));
 +        response.setInstanceLeaseEnabled((Boolean) capabilities.get(ApiConstants.INSTANCE_LEASE_ENABLED));
 +        response.setExtensionsPath((String)capabilities.get(ApiConstants.EXTENSIONS_PATH));
          response.setDynamicScalingEnabled((Boolean) capabilities.get(ApiConstants.DYNAMIC_SCALING_ENABLED));
+         response.setAdditionalConfigEnabled((Boolean) capabilities.get(ApiConstants.ADDITONAL_CONFIG_ENABLED));
          response.setObjectName("capability");
          response.setResponseName(getCommandName());
          this.setResponseObject(response);
diff --cc server/src/main/java/com/cloud/server/ManagementServerImpl.java
index 43f6a8a5b87,56e8a56f2e2..1b96cd4ef15
--- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java
@@@ -31,7 -31,7 +31,6 @@@ import java.util.Map
  import java.util.Objects;
  import java.util.Optional;
  import java.util.Set;
--import java.util.TimeZone;
  import java.util.UUID;
  import java.util.concurrent.Executors;
  import java.util.concurrent.ScheduledExecutorService;
@@@ -772,9 -744,8 +770,8 @@@ import com.cloud.network.dao.NetworkDao
  import com.cloud.network.dao.NetworkDomainDao;
  import com.cloud.network.dao.NetworkDomainVO;
  import com.cloud.network.dao.NetworkVO;
- import com.cloud.network.dao.NsxProviderDao;
 -import com.cloud.network.dao.PublicIpQuarantineDao;
  import com.cloud.network.vpc.dao.VpcDao;
 +import com.cloud.offering.ServiceOffering;
  import com.cloud.org.Cluster;
  import com.cloud.org.Grouping.AllocationState;
  import com.cloud.projects.Project;
@@@ -843,7 -815,7 +840,6 @@@ import com.cloud.utils.db.SearchCriteri
  import com.cloud.utils.db.Transaction;
  import com.cloud.utils.db.TransactionCallbackNoReturn;
  import com.cloud.utils.db.TransactionStatus;
--import com.cloud.utils.db.UUIDManager;
  import com.cloud.utils.exception.CloudRuntimeException;
  import com.cloud.utils.fsm.StateMachine2;
  import com.cloud.utils.net.MacAddress;
@@@ -1034,8 -1001,8 +1030,6 @@@ public class ManagementServerImpl exten
      @Inject
      DomainRouterDao routerDao;
      @Inject
--    public UUIDManager uuidMgr;
--    @Inject
      protected UserDataDao userDataDao;
      @Inject
      protected VMTemplateDao templateDao;
@@@ -1056,12 -1023,6 +1050,8 @@@
      protected AffinityGroupVMMapDao _affinityGroupVMMapDao;
      @Inject
      ResourceLimitService resourceLimitService;
 +    @Inject
-     NsxProviderDao nsxProviderDao;
-     @Inject
-     NetrisProviderDao netrisProviderDao;
-     @Inject
 +    ExtensionsManager extensionsManager;
  
      private LockControllerListener _lockControllerListener;
      private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
@@@ -1070,8 -1031,8 +1060,6 @@@
  
      private Map<String, String> _configs;
  
--    private Map<String, Boolean> _availableIdsMap;
--
      private List<UserAuthenticator> _userAuthenticators;
      private List<UserTwoFactorAuthenticator> _userTwoFactorAuthenticators;
      private List<UserAuthenticator> _userPasswordEncoders;
@@@ -1155,12 -1117,12 +1143,6 @@@
              _alertExecutor.scheduleAtFixedRate(new AlertPurgeTask(), alertPurgeInterval, alertPurgeInterval, TimeUnit.SECONDS);
          }
  
--        final String[] availableIds = TimeZone.getAvailableIDs();
--        _availableIdsMap = new HashMap<>(availableIds.length);
--        for (final String id : availableIds) {
--            _availableIdsMap.put(id, true);
--        }
--
          supportedHypervisors.add(HypervisorType.KVM);
          supportedHypervisors.add(HypervisorType.XenServer);
  
@@@ -1221,15 -1183,15 +1203,6 @@@
              throw new InvalidParameterValueException("privatePort is an invalid value");
          }
  
--        // logger.debug("Checking if " + privateIp +
--        // " is a valid private IP address. Guest IP address is: " +
--        // _configs.get("guest.ip.network"));
--        //
--        // if (!NetUtils.isValidPrivateIp(privateIp,
--        // _configs.get("guest.ip.network"))) {
--        // throw new
--        // InvalidParameterValueException("Invalid private ip address");
--        // }
          if (!NetUtils.isValidProto(proto)) {
              throw new InvalidParameterValueException("Invalid protocol");
          }
@@@ -1308,7 -1270,7 +1281,7 @@@
          final Object name = cmd.getClusterName();
          final Object podId = cmd.getPodId();
          Long zoneId = cmd.getZoneId();
--        final Object hypervisorType = cmd.getHypervisorType();
++        final String hypervisorType = cmd.getHypervisorType();
          final Object clusterType = cmd.getClusterType();
          final Object allocationState = cmd.getAllocationState();
          final String keyword = cmd.getKeyword();
@@@ -1353,8 -1307,8 +1326,7 @@@
          }
  
          if (hypervisorType != null) {
--            String hypervisorStr = (String) hypervisorType;
--            String hypervisorSearch = HypervisorType.getType(hypervisorStr).toString();
++            String hypervisorSearch = HypervisorType.getType(hypervisorType).toString();
              sc.setParameters("hypervisorType", hypervisorSearch);
          }
  
@@@ -1491,7 -1438,7 +1463,7 @@@
  
      protected boolean zoneWideVolumeRequiresStorageMotion(PrimaryDataStore volumeDataStore,
                 final Host sourceHost, final Host destinationHost) {
--        if (volumeDataStore.isManaged() && sourceHost.getClusterId() != destinationHost.getClusterId()) {
++        if (volumeDataStore.isManaged() && !Objects.equals(sourceHost.getClusterId(), destinationHost.getClusterId())) {
              PrimaryDataStoreDriver driver = (PrimaryDataStoreDriver)volumeDataStore.getDriver();
              // Depends on the storage driver. For some storages simply
              // changing volume access to host should work: grant access on destination
@@@ -1557,14 -1504,12 +1529,14 @@@
              throw new InvalidParameterValueException("Unsupported operation, VM uses Local storage, cannot migrate");
          }
  
 +        validateVgpuProfileForVmMigration(vmProfile);
 +
          final Type hostType = srcHost.getType();
--        Pair<List<HostVO>, Integer> allHostsPair = null;
--        List<HostVO> allHosts = null;
++        Pair<List<HostVO>, Integer> allHostsPair;
++        List<HostVO> allHosts;
          List<HostVO> filteredHosts = null;
          final Map<Host, Boolean> requiresStorageMotion = new HashMap<>();
--        DataCenterDeployment plan = null;
++        DataCenterDeployment plan;
          if (canMigrateWithStorage) {
              Long podId = !VirtualMachine.Type.User.equals(vm.getType()) ? srcHost.getPodId() : null;
              allHostsPair = searchForServers(startIndex, pageSize, null, hostType, null, srcHost.getDataCenterId(), podId, null, null, keyword,
@@@ -1776,7 -1710,7 +1748,7 @@@
  
          // Volume must be attached to an instance for live migration.
          List<? extends StoragePool> allPools = new ArrayList<>();
--        List<? extends StoragePool> suitablePools = new ArrayList<>();
++        List<StoragePool> suitablePools = new ArrayList<>();
  
          // Volume must be in Ready state to be migrated.
          if (!Volume.State.Ready.equals(volume.getState())) {
@@@ -1839,7 -1773,7 +1811,7 @@@
              suitablePools = findAllSuitableStoragePoolsForDetachedVolume(volume, diskOfferingId, allPools);
          }
          removeDataStoreClusterParents((List<StoragePool>) allPools);
--        removeDataStoreClusterParents((List<StoragePool>) suitablePools);
++        removeDataStoreClusterParents(suitablePools);
          return new Pair<>(allPools, suitablePools);
      }
  
@@@ -1922,7 -1856,7 +1894,7 @@@
       *  Looks for all suitable storage pools to allocate the given volume.
       *  We take into account the service offering of the VM and volume to find suitable storage pools. It is also excluded from the search the current storage pool used by the volume.
       *  We use {@link StoragePoolAllocator} to look for possible storage pools to allocate the given volume. We will look for possible local storage poosl even if the volume is using a shared storage disk offering.
--     *
++     * <p>
       *  Side note: the idea behind this method is to provide power for administrators of manually overriding deployments defined by CloudStack.
       */
      private List<StoragePool> findAllSuitableStoragePoolsForVm(final VolumeVO volume, Long diskOfferingId, Long newSize, Long newMinIops, Long newMaxIops, VMInstanceVO vm, Host vmHost, ExcludeList avoid, Cluster srcCluster, HypervisorType hypervisorType, boolean bypassStorageTypeCheck, String keyword) {
@@@ -2004,7 -1938,7 +1976,7 @@@
          sb.and("hypervisorVersion", sb.entity().getHypervisorVersion(), SearchCriteria.Op.GTEQ);
  
          final String haTag = _haMgr.getHaTag();
--        SearchBuilder<HostTagVO> hostTagSearch = null;
++        SearchBuilder<HostTagVO> hostTagSearch;
          if (haHosts != null && StringUtils.isNotEmpty(haTag)) {
              hostTagSearch = _hostTagsDao.createSearchBuilder();
              if ((Boolean)haHosts) {
@@@ -2468,7 -2391,7 +2440,7 @@@
          }
          boolean isAllocatedTemp = isAllocated;
  
--        VlanType vlanType = null;
++        VlanType vlanType;
          if (forVirtualNetwork != null) {
              vlanType = forVirtualNetwork ? VlanType.VirtualNetwork : VlanType.DirectAttached;
          } else {
@@@ -2541,7 -2464,7 +2513,7 @@@
          Boolean isRecursive = cmd.isRecursive();
          final List<Long> permittedAccounts = new ArrayList<>();
          ListProjectResourcesCriteria listProjectResourcesCriteria = null;
--        Boolean isAllocatedOrReserved = false;
++        boolean isAllocatedOrReserved = false;
          if (isAllocated || IpAddress.State.Reserved.name().equalsIgnoreCase(state)) {
              isAllocatedOrReserved = true;
          }
@@@ -2590,8 -2513,8 +2562,7 @@@
                  if (zoneId == null) {
                      zoneId = guestNetwork.getDataCenterId();
                  } else if (zoneId != guestNetwork.getDataCenterId()) {
--                    InvalidParameterValueException ex = new InvalidParameterValueException("Please specify a valid associated network id in the specified zone.");
--                    throw ex;
++                    throw new InvalidParameterValueException("Please specify a valid associated network id in the specified zone.");
                  }
                  owner = _accountDao.findById(guestNetwork.getAccountId());
              }
@@@ -2633,7 -2556,7 +2604,7 @@@
              }
          }
  
--        if (freeAddrIds.size() > 0) {
++        if (!freeAddrIds.isEmpty()) {
              final SearchBuilder<IPAddressVO> sb2 = _publicIpAddressDao.createSearchBuilder();
              buildParameters(sb2, cmd, false);
              sb2.and("ids", sb2.entity().getId(), SearchCriteria.Op.IN);
@@@ -2687,8 -2609,8 +2658,8 @@@
          if (tags != null && !tags.isEmpty()) {
              final SearchBuilder<ResourceTagVO> tagSearch = _resourceTagDao.createSearchBuilder();
              for (int count = 0; count < tags.size(); count++) {
--                tagSearch.or().op("key" + String.valueOf(count), tagSearch.entity().getKey(), SearchCriteria.Op.EQ);
--                tagSearch.and("value" + String.valueOf(count), tagSearch.entity().getValue(), SearchCriteria.Op.EQ);
++                tagSearch.or().op("key" + count, tagSearch.entity().getKey(), SearchCriteria.Op.EQ);
++                tagSearch.and("value" + count, tagSearch.entity().getValue(), SearchCriteria.Op.EQ);
                  tagSearch.cp();
              }
              tagSearch.and("resourceType", tagSearch.entity().getResourceType(), SearchCriteria.Op.EQ);
@@@ -2717,8 -2632,7 +2688,7 @@@
          final Object keyword = cmd.getKeyword();
          final Long physicalNetworkId = cmd.getPhysicalNetworkId();
          final Long sourceNetworkId = cmd.getNetworkId();
-         final Long vpcId = cmd.getVpcId();
 -        final Long zone = cmd.getZoneId();
 +        Long zone = cmd.getZoneId();
          final String address = cmd.getIpAddress();
          final Long vlan = cmd.getVlanId();
          final Long ipId = cmd.getId();
@@@ -2736,8 -2649,8 +2706,8 @@@
              int count = 0;
              sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.PublicIpAddress.toString());
              for (final String key : tags.keySet()) {
--                sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
--                sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));
++                sc.setJoinParameters("tagSearch", "key" + count, key);
++                sc.setJoinParameters("tagSearch", "value" + count, tags.get(key));
                  count++;
              }
          }
@@@ -3018,7 -2841,7 +2988,7 @@@
          if (duplicate != null) {
              if (!cmd.isForced()) {
                  throw new InvalidParameterValueException(
--                        "Mapping from hypervisor : " + hypervisorType.toString() + ", version : " + hypervisorVersion + " and guest OS : " + guestOs.getDisplayName() + " already exists!");
++                        "Mapping from hypervisor : " + hypervisorType + ", version : " + hypervisorVersion + " and guest OS : " + guestOs.getDisplayName() + " already exists!");
              }
  
              if (Boolean.TRUE.equals(cmd.getOsMappingCheckEnabled())) {
@@@ -3110,7 -2933,7 +3080,7 @@@
  
          logger.debug("GuestOSDetails");
          final GuestOSVO guestOsVo = new GuestOSVO();
--        guestOsVo.setCategoryId(categoryId.longValue());
++        guestOsVo.setCategoryId(categoryId);
          guestOsVo.setDisplayName(displayName);
          guestOsVo.setName(name);
          guestOsVo.setIsUserDefined(true);
@@@ -3123,8 -2946,8 +3093,8 @@@
      }
  
      private void persistGuestOsDetails(Map<String, String> details, long guestOsPersistedId) {
--        for (Object key : details.keySet()) {
--            _guestOsDetailsDao.addDetail(guestOsPersistedId, (String)key, details.get(key), false);
++        for (String key : details.keySet()) {
++            _guestOsDetailsDao.addDetail(guestOsPersistedId, key, details.get(key), false);
          }
      }
  
@@@ -3369,7 -3169,7 +3339,7 @@@
              logger.trace("Trying to retrieve VNC port from agent about VM " + vm.getHostName());
          }
  
--        GetVncPortAnswer answer = null;
++        GetVncPortAnswer answer;
          if (vm.getState() == State.Migrating && vm.getLastHostId() != null) {
              answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getLastHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
          } else {
@@@ -3543,9 -3343,9 +3513,9 @@@
          });
  
  
--        Integer pageSize = null;
++        int pageSize;
          try {
--            pageSize = Integer.valueOf(cmd.getPageSizeVal().toString());
++            pageSize = Integer.parseInt(cmd.getPageSizeVal().toString());
          } catch (final IllegalArgumentException e) {
              throw new InvalidParameterValueException("pageSize " + cmd.getPageSizeVal() + " is out of Integer range is not supported for this call");
          }
@@@ -4324,7 -4086,7 +4294,7 @@@
                      final Calendar purgeCal = Calendar.getInstance();
                      purgeCal.add(Calendar.DAY_OF_YEAR, -_purgeDelay);
                      final Date purgeTime = purgeCal.getTime();
--                    logger.debug("Deleting events older than: " + purgeTime.toString());
++                    logger.debug("Deleting events older than: " + purgeTime);
                      final List<EventVO> oldEvents = _eventDao.listOlderEvents(purgeTime);
                      logger.debug("Found " + oldEvents.size() + " events to be purged");
                      for (final EventVO event : oldEvents) {
@@@ -4358,7 -4120,7 +4328,7 @@@
                      final Calendar purgeCal = Calendar.getInstance();
                      purgeCal.add(Calendar.DAY_OF_YEAR, -_alertPurgeDelay);
                      final Date purgeTime = purgeCal.getTime();
--                    logger.debug("Deleting alerts older than: " + purgeTime.toString());
++                    logger.debug("Deleting alerts older than: " + purgeTime);
                      final List<AlertVO> oldAlerts = _alertDao.listOlderAlerts(purgeTime);
                      logger.debug("Found " + oldAlerts.size() + " events to be purged");
                      for (final AlertVO alert : oldAlerts) {
@@@ -4677,8 -4439,8 +4647,7 @@@
              // get the user obj to get their secret key
              user = _accountMgr.getActiveUser(userId);
              final String secretKey = user.getSecretKey();
--            final String input = cloudIdentifier;
--            signature = signRequest(input, secretKey);
++            signature = signRequest(cloudIdentifier, secretKey);
          } catch (final Exception e) {
              logger.warn("Exception whilst creating a signature:" + e);
          }
@@@ -4695,10 -4457,9 +4664,10 @@@
          final Map<String, Object> capabilities = new HashMap<>();
  
          final Account caller = getCaller();
 +        final boolean isCallerAdmin = _accountService.isAdmin(caller.getId());
          boolean securityGroupsEnabled = false;
--        boolean elasticLoadBalancerEnabled = false;
--        boolean KVMSnapshotEnabled = false;
++        boolean elasticLoadBalancerEnabled;
++        boolean KVMSnapshotEnabled;
          String supportELB = "false";
          final List<NetworkVO> networks = networkDao.listSecurityGroupEnabledNetworks();
          if (networks != null && !networks.isEmpty()) {
@@@ -4737,7 -4498,7 +4706,7 @@@
          // check if region-wide secondary storage is used
          boolean regionSecondaryEnabled = false;
          final List<ImageStoreVO> imgStores = _imgStoreDao.findRegionImageStores();
--        if (imgStores != null && imgStores.size() > 0) {
++        if (imgStores != null && !imgStores.isEmpty()) {
              regionSecondaryEnabled = true;
          }
  
@@@ -4777,10 -4535,9 +4746,11 @@@
          }
          capabilities.put(ApiConstants.SHAREDFSVM_MIN_CPU_COUNT, fsVmMinCpu);
          capabilities.put(ApiConstants.SHAREDFSVM_MIN_RAM_SIZE, fsVmMinRam);
 +        if (isCallerAdmin) {
 +            capabilities.put(ApiConstants.EXTENSIONS_PATH, extensionsManager.getExtensionsPath());
 +        }
+         capabilities.put(ApiConstants.ADDITONAL_CONFIG_ENABLED, UserVmManager.EnableAdditionalVmConfig.valueIn(caller.getId()));
  
 -
          return capabilities;
      }
  
@@@ -4801,7 -4558,7 +4771,7 @@@
          final String groupName = cmd.getGroupName();
  
          // Verify input parameters
--        final InstanceGroupVO group = _vmGroupDao.findById(groupId.longValue());
++        final InstanceGroupVO group = _vmGroupDao.findById(groupId);
          if (group == null) {
              final InvalidParameterValueException ex = new InvalidParameterValueException("unable to find a vm group with specified groupId");
              ex.addProxyObject(groupId.toString(), "groupId");
@@@ -4828,7 -4585,7 +4798,7 @@@
      public String getVersion() {
          final Class<?> c = ManagementServer.class;
          final String fullVersion = c.getPackage().getImplementationVersion();
--        if (fullVersion != null && fullVersion.length() > 0) {
++        if (fullVersion != null && !fullVersion.isEmpty()) {
              return fullVersion;
          }
  
@@@ -4884,7 -4641,7 +4854,7 @@@
              }
          } else {
              try {
--                logger.debug(String.format("Trying to validate the root certificate format"));
++                logger.debug("Trying to validate the root certificate format");
                  CertificateHelper.buildCertificate(certificate);
              } catch (CertificateException e) {
                  String errorMsg = String.format("Failed to pass certificate validation check with error: Certificate validation failed due to exception: %s", e.getMessage());
@@@ -4901,7 -4658,7 +4871,7 @@@
          final String[] hypervisors = hypers.split(",");
  
          if (zoneId != null) {
--            if (zoneId.longValue() == -1L) {
++            if (zoneId == -1L) {
                  final List<DataCenterVO> zones = _dcDao.listAll();
  
                  for (final String hypervisor : hypervisors) {
@@@ -5235,8 -4967,8 +5205,7 @@@
       * @return
       */
      private String getFingerprint(final String publicKey) {
--        final String fingerprint = SSHKeysHelper.getPublicKeyFingerprint(publicKey);
--        return fingerprint;
++        return SSHKeysHelper.getPublicKeyFingerprint(publicKey);
      }
  
      /**
@@@ -5260,8 -4992,8 +5229,7 @@@
      protected Account getOwner(final RegisterSSHKeyPairCmd cmd) {
          final Account caller = getCaller();
  
--        final Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId());
--        return owner;
++        return _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId());
      }
  
      /**
@@@ -5277,11 -5009,11 +5245,10 @@@
       * @return
       */
      protected Account getCaller() {
--        final Account caller = CallContext.current().getCallingAccount();
--        return caller;
++        return CallContext.current().getCallingAccount();
      }
  
 -    private SSHKeyPair createAndSaveSSHKeyPair(final String name, final String fingerprint, final String publicKey, final String privateKey, final Account owner) {
 +    private SSHKeyPair  createAndSaveSSHKeyPair(final String name, final String fingerprint, final String publicKey, final String privateKey, final Account owner) {
          final SSHKeyPairVO newPair = new SSHKeyPairVO();
  
          newPair.setAccountId(owner.getAccountId());
@@@ -5448,9 -5179,9 +5415,7 @@@
                  eventTypes[i++] = field.get(eventObj).toString();
              }
              return eventTypes;
--        } catch (final IllegalArgumentException e) {
--            logger.error("Error while listing Event Types", e);
--        } catch (final IllegalAccessException e) {
++        } catch (final IllegalArgumentException | IllegalAccessException e) {
              logger.error("Error while listing Event Types", e);
          }
          return null;
@@@ -5585,8 -5316,8 +5550,7 @@@
          }
          final boolean result = _userVmMgr.upgradeVirtualMachine(cmd.getId(), cmd.getServiceOfferingId(), cmd.getDetails());
          if (result) {
--            final VirtualMachine vm = _vmInstanceDao.findById(cmd.getId());
--            return vm;
++            return _vmInstanceDao.findById(cmd.getId());
          } else {
              throw new CloudRuntimeException("Failed to upgrade System VM");
          }
@@@ -5792,28 -5523,4 +5756,28 @@@
          _lockControllerListener = lockControllerListener;
      }
  
 +    @Override
 +    @DB
 +    @ActionEvent(eventType = EventTypes.EVENT_MANAGEMENT_SERVER_REMOVE, eventDescription = "removing Management Server")
 +    public boolean removeManagementServer(RemoveManagementServerCmd cmd) {
 +        final Long id = cmd.getId();
 +        ManagementServerJoinVO managementServer = managementServerJoinDao.findById(id);
 +
 +        if (managementServer == null) {
-             throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s].", managementServer.getUuid()));
++            throw new InvalidParameterValueException(String.format("Unable to find a Management Server with ID equal to [%s].", id));
 +        }
 +
 +        if (!ManagementServerHost.State.Down.equals(managementServer.getState())) {
 +            throw new InvalidParameterValueException(String.format("Unable to remove Management Server with ID [%s]. It can only be removed when it is in the [%s] state, however currently it is in the [%s] state.", managementServer.getUuid(), ManagementServerHost.State.Down.name(), managementServer.getState().name()));
 +        }
 +
 +        managementServer.setRemoved(new Date());
 +        return managementServerJoinDao.update(id, managementServer);
 +
 +    }
 +
 +    @Override
 +    public Answer getExternalVmConsole(VirtualMachine vm, Host host) {
 +        return extensionsManager.getInstanceConsole(vm, host);
 +    }
  }
diff --cc server/src/main/java/org/apache/cloudstack/user/UserPasswordResetManagerImpl.java
index 8a278f6e45d,798b6287e7e..618ad5c8657
--- a/server/src/main/java/org/apache/cloudstack/user/UserPasswordResetManagerImpl.java
+++ b/server/src/main/java/org/apache/cloudstack/user/UserPasswordResetManagerImpl.java
@@@ -92,9 -93,10 +92,11 @@@ public class UserPasswordResetManagerIm
                  UserPasswordResetSMTPHost,
                  UserPasswordResetSMTPPort,
                  UserPasswordResetSMTPUseAuth,
+                 UserPasswordResetSMTPUseStartTLS,
+                 UserPasswordResetSMTPEnabledSecurityProtocols,
                  UserPasswordResetSMTPUsername,
                  UserPasswordResetSMTPPassword,
 +                UserPasswordResetDomainURL,
                  PasswordResetMailTemplate
          };
      }
diff --cc ui/src/views/compute/DeployVM.vue
index 854d082075f,82a54ed8314..423338c9264
--- a/ui/src/views/compute/DeployVM.vue
+++ b/ui/src/views/compute/DeployVM.vue
@@@ -2323,14 -2063,13 +2332,17 @@@ export default 
          if (isUserdataAllowed && values.userdata && values.userdata.length > 0) {
            deployVmData.userdata = this.$toBase64AndURIEncoded(values.userdata)
          }
+         if (values.extraconfig && values.extraconfig.length > 0) {
+           deployVmData.extraconfig = encodeURIComponent(values.extraconfig)
+         }
          // step 2: select template/iso
 -        if (this.tabKey === 'templateid') {
 +        if (this.imageType === 'templateid') {
            deployVmData.templateid = values.templateid
            values.hypervisor = null
 +        } else if (this.imageType === 'volumeid') {
 +          deployVmData.volumeid = values.volumeid
 +        } else if (this.imageType === 'snapshotid') {
 +          deployVmData.snapshotid = values.snapshotid
          } else {
            deployVmData.templateid = values.isoid
          }
diff --cc ui/src/views/compute/EditVM.vue
index 7489674b966,9e60175f2a9..bb66f2ccaf3
--- a/ui/src/views/compute/EditVM.vue
+++ b/ui/src/views/compute/EditVM.vue
@@@ -223,13 -205,9 +242,14 @@@ export default 
          group: this.resource.group,
          userdata: '',
          haenable: this.resource.haenable,
 +        leaseduration: this.resource.leaseduration,
 +        leaseexpiryaction: this.resource.leaseexpiryaction
+         extraconfig: this.combinedExtraConfig
        })
 -      this.rules = reactive({})
 +      this.rules = reactive({
 +        leaseduration: [this.naturalNumberRule]
 +      })
 +      this.showLeaseOptions = this.isLeaseEditable
      },
      fetchData () {
        this.fetchZoneDetails()
@@@ -397,15 -362,12 +417,18 @@@
          if (values.userdata && values.userdata.length > 0) {
            params.userdata = this.$toBase64AndURIEncoded(values.userdata)
          }
 +        if (values.leaseduration !== undefined && (values.leaseduration === -1 || values.leaseduration > 0)) {
 +          params.leaseduration = values.leaseduration
 +          if (values.leaseexpiryaction !== undefined) {
 +            params.leaseexpiryaction = values.leaseexpiryaction
 +          }
 +        }
+         if (values.extraconfig && values.extraconfig.length > 0) {
+           params.extraconfig = encodeURIComponent(values.extraconfig)
+         }
          this.loading = true
  
 -        api('updateVirtualMachine', {}, 'POST', params).then(json => {
 +        postAPI('updateVirtualMachine', params).then(json => {
            this.$message.success({
              content: `${this.$t('label.action.edit.instance')} - ${values.name}`,
              duration: 2