This is an automated email from the ASF dual-hosted git repository. dahn pushed a commit to branch 4.20 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 34d2a3bc86d89d93fd50973844c13be37d51f374 Merge: 7e295ec4e19 0a77eb7f85f Author: Daan Hoogland <d...@onecht.net> AuthorDate: Fri Jan 24 17:01:42 2025 +0100 Merge branch '4.19' into 4.20 .../api/response/HostForMigrationResponse.java | 447 +-------------------- .../com/cloud/agent/manager/AgentManagerImpl.java | 38 +- .../kvm/resource/LibvirtComputingResource.java | 19 +- .../LibvirtDeleteStoragePoolCommandWrapper.java | 60 ++- .../kvm/resource/LibvirtComputingResourceTest.java | 5 +- .../cluster/KubernetesClusterManagerImpl.java | 2 +- .../com/cloud/api/query/dao/HostJoinDaoImpl.java | 122 +----- .../java/com/cloud/storage/StorageManagerImpl.java | 16 +- ui/public/locales/en.json | 2 + ui/src/components/view/ListView.vue | 7 + ui/src/components/view/SearchView.vue | 23 +- ui/src/components/widgets/Status.vue | 2 + ui/src/config/section/network.js | 125 +----- ui/src/views/AutogenView.vue | 3 + ui/src/views/dashboard/CapacityDashboard.vue | 29 +- ui/src/views/network/AclListRulesTab.vue | 2 +- ui/src/views/network/VpcTiersTab.vue | 2 +- 17 files changed, 189 insertions(+), 715 deletions(-) diff --cc engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java index 63e97519534,92d18dcf4e4..09fb211fedf --- a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java +++ b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java @@@ -53,8 -52,10 +53,9 @@@ import org.apache.cloudstack.framework. import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao; import org.apache.cloudstack.utils.identity.ManagementServerNode; +import org.apache.commons.collections.MapUtils; + import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils; import org.apache.commons.lang3.BooleanUtils; -import org.apache.log4j.Logger; -import org.apache.log4j.MDC; import com.cloud.agent.AgentManager; import com.cloud.agent.Listener; @@@ -615,33 -565,32 +616,28 @@@ public class AgentManagerImpl extends M final long hostId = attache.getId(); final HostVO host = _hostDao.findById(hostId); for (final Pair<Integer, Listener> monitor : _hostMonitors) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Sending Connect to listener: " + monitor.second().getClass().getSimpleName()); - } + logger.debug("Sending Connect to listener: {}", monitor.second().getClass().getSimpleName()); for (int i = 0; i < cmd.length; i++) { try { - if (s_logger.isDebugEnabled()) { - s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance); - } ++ logger.debug("process connection to issue {} forRebalance == {}", ReflectionToStringBuilderUtils.reflectCollection(cmd[i]), forRebalance); monitor.second().processConnect(host, cmd[i], forRebalance); - } catch (final Exception e) { - if (e instanceof ConnectionException) { - final ConnectionException ce = (ConnectionException)e; - if (ce.isSetupError()) { - logger.warn("Monitor {} says there is an error in the connect process for {} due to {}", - monitor.second().getClass().getSimpleName(), host, e.getMessage()); - handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); - throw ce; - } else { - logger.info("Monitor {} says not to continue the connect process for {} due to {}", - monitor.second().getClass().getSimpleName(), host, e.getMessage()); - handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); - return attache; - } - } else if (e instanceof HypervisorVersionChangedException) { - handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); - throw new CloudRuntimeException(String.format("Unable to connect %s", attache), e); - } else { - logger.error("Monitor {} says there is an error in the connect process for {} due to {}", - monitor.second().getClass().getSimpleName(), host, e.getMessage(), e); + } catch (final ConnectionException ce) { + if (ce.isSetupError()) { - s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage()); ++ logger.warn("Monitor {} says there is an error in the connect process for {} due to {}", monitor.second().getClass().getSimpleName(), hostId, ce.getMessage()); handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); - throw new CloudRuntimeException(String.format("Unable to connect %s", attache), e); + throw ce; + } else { - s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + ce.getMessage()); ++ logger.info("Monitor {} says not to continue the connect process for {} due to {}", monitor.second().getClass().getSimpleName(), hostId, ce.getMessage()); + handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); + return attache; } + } catch (final HypervisorVersionChangedException hvce) { + handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); + throw new CloudRuntimeException("Unable to connect " + attache.getId(), hvce); + } catch (final Exception e) { - s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e); ++ logger.error("Monitor {} says there is an error in the connect process for {} due to {}", monitor.second().getClass().getSimpleName(), hostId, e.getMessage(), e); + handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); + throw new CloudRuntimeException("Unable to connect " + attache.getId(), e); } } } diff --cc server/src/main/java/com/cloud/storage/StorageManagerImpl.java index 1c5da19fbbc,0a45fd448ad..4ca5bf2eb92 --- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java @@@ -834,10 -831,8 +836,8 @@@ public class StorageManagerImpl extend } } - DataStoreProvider provider = _dataStoreProviderMgr.getDefaultPrimaryDataStoreProvider(); - DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle(); if (pool == null) { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); String name = pInfo.getName() != null ? pInfo.getName() : createLocalStoragePoolName(host, pInfo); params.put("zoneId", host.getDataCenterId()); params.put("clusterId", host.getClusterId()); @@@ -864,7 -859,15 +864,15 @@@ } } catch (Exception e) { - logger.warn("Unable to setup the local storage pool for " + host, e); - s_logger.warn("Unable to setup the local storage pool for " + host, e); ++ logger.warn("Unable to setup the local storage pool for {}", host, e); + try { + if (store != null) { - s_logger.debug(String.format("Trying to delete storage pool entry if exists %s", store)); ++ logger.debug("Trying to delete storage pool entry if exists {}", store); + lifeCycle.deleteDataStore(store); + } + } catch (Exception ex) { - s_logger.debug(String.format("Failed to clean up local storage pool: %s", ex.getMessage())); ++ logger.debug("Failed to clean up local storage pool: {}", ex.getMessage()); + } throw new ConnectionException(true, "Unable to setup the local storage pool for " + host, e); } diff --cc ui/src/components/view/SearchView.vue index 786a9f15be6,9cbe1ef0fe6..3bd7ad5ef68 --- a/ui/src/components/view/SearchView.vue +++ b/ui/src/components/view/SearchView.vue @@@ -302,18 -289,12 +302,21 @@@ export default if (item === 'groupid' && !('listInstanceGroups' in this.$store.getters.apis)) { return true } + if (item === 'associatednetworkid' && this.$route.meta.name === 'asnumbers') { + item = 'networkid' + } + if (item === 'usagetype' && !('listUsageTypes' in this.$store.getters.apis)) { + return true + } + if (item === 'isencrypted' && !('listVolumes' in this.$store.getters.apis)) { + return true + } + if (item === 'displaynetwork' && this.$store.getters.userInfo.roletype !== 'Admin') { + return true + } if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level', 'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider', - 'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired'].includes(item) - 'type', 'serviceofferingid', 'diskofferingid', 'displaynetwork'].includes(item) ++ 'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'networkid', 'usagetype', 'restartrequired', 'displaynetwork'].includes(item) ) { type = 'list' } else if (item === 'tags') { diff --cc ui/src/config/section/network.js index e87127b15b7,986a2c206c7..2fee9fca319 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@@ -54,7 -54,7 +54,7 @@@ export default return fields }, filters: ['all', 'account', 'domainpath', 'shared'], - searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'restartrequired', 'tags'], - searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'displaynetwork', 'tags'], ++ searchFilters: ['keyword', 'zoneid', 'domainid', 'account', 'type', 'restartrequired', 'displaynetwork', 'tags'], related: [{ name: 'vm', title: 'label.instances', @@@ -148,9 -140,9 +140,7 @@@ icon: 'edit-outlined', label: 'label.update.network', dataView: true, -- disabled: (record, user) => { -- return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) -- }, ++ disabled: (record, user) => { return (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) }, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/network/UpdateNetwork.vue'))) }, @@@ -160,9 -152,9 +150,7 @@@ label: 'label.restart.network', message: 'message.restart.network', dataView: true, -- disabled: (record, user) => { -- return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) -- }, ++ disabled: (record, user) => { return (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) }, args: (record, store, isGroupAction) => { var fields = [] if (isGroupAction || record.vpcid == null) { @@@ -201,9 -193,9 +189,7 @@@ label: 'label.action.delete.network', message: 'message.action.delete.network', dataView: true, -- disabled: (record, user) => { -- return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) -- }, ++ disabled: (record, user) => { return (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype)) }, groupAction: true, popup: true, groupMap: (selection) => { return selection.map(x => { return { id: x } }) }