From d58e94ba04dea7c0d05bfc0753ac7316531326a4 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Thu, 22 Oct 2026 11:35:22 +0200 Subject: [PATCH 1/2] declare and register ConfigKeys for all remaining Config enum entries Part of the split of #13884 (phase out the Config enum, #10752). Co-Authored-By: Claude Opus 5.5 --- .../deploy/DeploymentClusterPlanner.java | 12 ++ .../java/com/cloud/network/NetworkModel.java | 19 ++ .../com/cloud/network/NetworkService.java | 30 +++ .../cloud/network/NetworkUsageService.java | 10 + .../network/vpn/RemoteAccessVpnService.java | 7 + .../com/cloud/storage/VolumeApiService.java | 12 ++ .../com/cloud/user/ResourceLimitService.java | 65 ++++++ .../apache/cloudstack/usage/UsageService.java | 23 +++ .../service/NetworkOrchestrationService.java | 17 ++ .../api/storage/StorageCacheManager.java | 15 ++ .../java/com/cloud/agent/AgentManager.java | 27 +++ .../java/com/cloud/alert/AlertManager.java | 53 +++++ .../deploy/DeploymentPlanningManager.java | 7 + .../com/cloud/ha/HighAvailabilityManager.java | 3 + .../security/SecurityGroupManager.java | 19 ++ .../com/cloud/network/vpc/VpcManager.java | 6 + .../com/cloud/storage/StorageManager.java | 19 ++ .../com/cloud/template/TemplateManager.java | 7 + .../cloud/vm/snapshot/VMSnapshotManager.java | 3 + .../cloud/agent/manager/AgentManagerImpl.java | 4 +- .../orchestration/NetworkOrchestrator.java | 3 +- .../manager/StorageCacheManagerImpl.java | 14 +- .../com/cloud/cluster/ClusterManagerImpl.java | 2 +- .../cloud/cluster/ClusterServiceAdapter.java | 2 +- .../ratelimit/ApiRateLimitService.java | 4 + .../ratelimit/ApiRateLimitServiceImpl.java | 14 +- .../baremetal/manager/BaremetalManager.java | 19 ++ .../manager/BaremetalManagerImpl.java | 15 +- .../com/cloud/ucs/manager/UcsManager.java | 5 + .../com/cloud/ucs/manager/UcsManagerImpl.java | 14 +- .../vmware/manager/VmwareManager.java | 18 ++ .../vmware/manager/VmwareManagerImpl.java | 3 +- .../lb/ElasticLoadBalancerManager.java | 13 ++ .../lb/ElasticLoadBalancerManagerImpl.java | 14 +- .../network/element/NetscalerElement.java | 6 + .../NetscalerLoadBalancerElementService.java | 8 + .../cloud/network/ovs/OvsTunnelManager.java | 6 + .../network/ovs/OvsTunnelManagerImpl.java | 14 +- .../com/cloud/alert/AlertManagerImpl.java | 5 +- .../consoleproxy/ConsoleProxyManager.java | 12 ++ .../deploy/DeploymentPlanningManagerImpl.java | 2 +- .../com/cloud/deploy/FirstFitPlanner.java | 3 +- .../cloud/ha/HighAvailabilityManagerImpl.java | 2 +- .../ExternalFirewallDeviceManager.java | 4 + .../ExternalFirewallDeviceManagerImpl.java | 14 +- .../ExternalLoadBalancerDeviceManager.java | 5 + ...ExternalLoadBalancerDeviceManagerImpl.java | 14 +- .../com/cloud/network/NetworkModelImpl.java | 3 +- .../com/cloud/network/NetworkServiceImpl.java | 4 +- .../network/NetworkUsageManagerImpl.java | 14 +- .../network/lb/LBHealthCheckManager.java | 5 + .../network/lb/LBHealthCheckManagerImpl.java | 14 +- .../VirtualNetworkApplianceManager.java | 37 ++++ .../VirtualNetworkApplianceManagerImpl.java | 14 +- .../security/SecurityGroupManagerImpl.java | 14 +- .../com/cloud/network/vpc/VpcManagerImpl.java | 4 +- .../vpn/RemoteAccessVpnManagerImpl.java | 2 +- .../network/vpn/Site2SiteVpnManager.java | 11 ++ .../network/vpn/Site2SiteVpnManagerImpl.java | 2 +- .../com/cloud/projects/ProjectManager.java | 32 +++ .../cloud/projects/ProjectManagerImpl.java | 4 +- .../ResourceLimitManagerImpl.java | 33 +++- .../com/cloud/server/ManagementServer.java | 186 ++++++++++++++++++ .../cloud/server/ManagementServerImpl.java | 16 +- .../java/com/cloud/server/StatsCollector.java | 11 +- .../com/cloud/storage/StorageManagerImpl.java | 7 +- .../cloud/storage/VolumeApiServiceImpl.java | 6 +- .../secondary/SecondaryStorageVmManager.java | 44 +++++ .../storage/snapshot/SnapshotManager.java | 9 + .../storage/snapshot/SnapshotManagerImpl.java | 3 +- .../cloud/template/TemplateManagerImpl.java | 4 +- .../com/cloud/usage/UsageServiceImpl.java | 15 +- .../java/com/cloud/user/AccountManager.java | 12 ++ .../com/cloud/user/AccountManagerImpl.java | 3 +- .../main/java/com/cloud/vm/UserVmManager.java | 15 ++ .../java/com/cloud/vm/UserVmManagerImpl.java | 3 +- .../vm/snapshot/VMSnapshotManagerImpl.java | 2 +- .../SecondaryStorageManagerImpl.java | 5 +- 78 files changed, 1085 insertions(+), 42 deletions(-) diff --git a/api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java b/api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java index 9471c3d5c84c..efbc1804e9fa 100644 --- a/api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java +++ b/api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java @@ -68,6 +68,18 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner { ConfigKey.Kind.Select, "random,firstfit,userdispersing,firstfitleastconsumed"); + ConfigKey ApplyAllocationAlgorithmToPods = new ConfigKey<>("Advanced", Boolean.class, "apply.allocation.algorithm.to.pods", "false", + "If true, deployment planner applies the allocation heuristics at pods first in the given datacenter during VM resource allocation", true); + + ConfigKey HostCapacityTypeToOrderClusters = new ConfigKey<>("Advanced", String.class, "host.capacityType.to.order.clusters", "CPU", + "The host capacity type (CPU, RAM, COMBINED) is used by deployment planner to order clusters during VM resource allocation", true); + + ConfigKey VmUserDispersionWeight = new ConfigKey<>("Advanced", Float.class, "vm.user.dispersion.weight", "1", + "Weight for user dispersion heuristic (as a value between 0 and 1) applied to resource allocation during vm deployment. Weight for capacity heuristic will be (1 - weight of user dispersion)", true); + + ConfigKey ImplicitHostTags = new ConfigKey<>("Advanced", String.class, "implicit.host.tags", "GPU", + "Tag hosts at the time of host discovery based on the host properties/capabilities", true); + /** * This is called to determine list of possible clusters where a virtual * machine can be deployed. diff --git a/api/src/main/java/com/cloud/network/NetworkModel.java b/api/src/main/java/com/cloud/network/NetworkModel.java index 7e1a07ebeb69..50d98582e0fe 100644 --- a/api/src/main/java/com/cloud/network/NetworkModel.java +++ b/api/src/main/java/com/cloud/network/NetworkModel.java @@ -97,6 +97,25 @@ public interface NetworkModel { static final ConfigKey AdminIsAllowedToDeployAnywhere = new ConfigKey<>("Advanced",Boolean.class, "admin.is.allowed.to.deploy.anywhere", "false", "This will determine if the root admin is allowed to deploy in networks in subdomains.", true, ConfigKey.Scope.Global); + ConfigKey SecurityGroupDefaultAdding = new ConfigKey<>("Network", Boolean.class, "network.securitygroups.defaultadding", "true", + "If true, the user VM would be added to the default security group by default", true); + + ConfigKey CloudIdentifier = new ConfigKey<>("Hidden", String.class, "cloud.identifier", null, + "A unique identifier for the cloud.", true); + + ConfigKey SubDomainNetworkAccess = new ConfigKey<>("Advanced", Boolean.class, "allow.subdomain.network.access", "true", + "Allow subdomains to use networks dedicated to their parent domain(s)", true); + + ConfigKey ExecuteInSequenceNetworkElementCommands = new ConfigKey<>("Advanced", Boolean.class, "execute.in.sequence.network.element.commands", "false", + "If set to true, DhcpEntryCommand, SavePasswordCommand, VmDataCommand will be synchronized on the agent side." + + " If set to false, these commands become asynchronous. Default value is false.", true); + + ConfigKey ExternalNetworkStatsInterval = new ConfigKey<>("Advanced", Integer.class, "external.network.stats.interval", "300", + "Interval (in seconds) to report external network statistics.", true); + + ConfigKey NetworkIPv6SearchRetryMax = new ConfigKey<>("Network", Integer.class, "network.ipv6.search.retry.max", "10000", + "The maximum number of retrying times to search for an available IPv6 address in the table", true); + /** * Lists IP addresses that belong to VirtualNetwork VLANs * diff --git a/api/src/main/java/com/cloud/network/NetworkService.java b/api/src/main/java/com/cloud/network/NetworkService.java index c32bb711c0f2..8f2026fb7e04 100644 --- a/api/src/main/java/com/cloud/network/NetworkService.java +++ b/api/src/main/java/com/cloud/network/NetworkService.java @@ -84,6 +84,36 @@ public interface NetworkService { "allow.end.users.to.specify.vr.mtu", "false", "Allow end Users to specify VR MTU", true, ConfigKey.Scope.Zone); + ConfigKey GuestVlanBits = new ConfigKey<>("Network", Integer.class, "guest.vlan.bits", "12", + "The number of bits to reserve for the VLAN identifier in the guest subnet.", true); + + ConfigKey MaxNumberOfSecondaryIPsPerNIC = new ConfigKey<>("Network", Integer.class, + "vm.network.nic.max.secondary.ipaddresses", "10", + "Specify the number of secondary ip addresses per nic per vm. Default value 10 is used, if not specified.", true); + + ConfigKey NetworkGuestCidrLimit = new ConfigKey<>("Network", Integer.class, "network.guest.cidr.limit", "22", + "size limit for guest cidr; can't be less than this value", true); + + ConfigKey XenServerPublicNetwork = new ConfigKey<>("Hidden", String.class, + "xenserver.public.network.device", null, + "[ONLY IF THE PUBLIC NETWORK IS ON A DEDICATED NIC]:The network name label of the physical device dedicated to the public network on a XenServer host", true); + + ConfigKey XenServerGuestNetwork = new ConfigKey<>("Hidden", String.class, + "xenserver.guest.network.device", null, + "Specify for guest network name label", true); + + ConfigKey XenServerStorageNetwork1 = new ConfigKey<>("Hidden", String.class, + "xenserver.storage.network.device1", null, + "Specify when there are storage networks", true); + + ConfigKey XenServerStorageNetwork2 = new ConfigKey<>("Hidden", String.class, + "xenserver.storage.network.device2", null, + "Specify when there are storage networks", true); + + ConfigKey XenServerPrivateNetwork = new ConfigKey<>("Hidden", String.class, + "xenserver.private.network.device", null, + "Specify when the private network name is different", true); + List getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner); IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolean displayIp, String ipaddress) throws ResourceAllocationException, InsufficientAddressCapacityException, diff --git a/api/src/main/java/com/cloud/network/NetworkUsageService.java b/api/src/main/java/com/cloud/network/NetworkUsageService.java index 71a2f49b75f2..dbb5ae410536 100644 --- a/api/src/main/java/com/cloud/network/NetworkUsageService.java +++ b/api/src/main/java/com/cloud/network/NetworkUsageService.java @@ -21,12 +21,22 @@ import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.host.Host; import com.cloud.utils.component.Manager; public interface NetworkUsageService extends Manager { + ConfigKey DirectNetworkStatsInterval = new ConfigKey<>("Usage", Integer.class, "direct.network.stats.interval", "86400", + "Interval (in seconds) to collect stats from Traffic Monitor", true); + + ConfigKey TrafficSentinelIncludeZones = new ConfigKey<>("Usage", String.class, "traffic.sentinel.include.zones", "EXTERNAL", + "Traffic going into specified list of zones is metered. For metering all traffic leave this parameter empty", true); + + ConfigKey TrafficSentinelExcludeZones = new ConfigKey<>("Usage", String.class, "traffic.sentinel.exclude.zones", "", + "Traffic going into specified list of zones is not metered.", true); + Host addTrafficMonitor(AddTrafficMonitorCmd cmd); boolean deleteTrafficMonitor(DeleteTrafficMonitorCmd cmd); diff --git a/api/src/main/java/com/cloud/network/vpn/RemoteAccessVpnService.java b/api/src/main/java/com/cloud/network/vpn/RemoteAccessVpnService.java index ffa8af4576d7..00bd4b3a512e 100644 --- a/api/src/main/java/com/cloud/network/vpn/RemoteAccessVpnService.java +++ b/api/src/main/java/com/cloud/network/vpn/RemoteAccessVpnService.java @@ -20,6 +20,7 @@ import org.apache.cloudstack.api.command.user.vpn.ListRemoteAccessVpnsCmd; import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceUnavailableException; @@ -31,6 +32,12 @@ public interface RemoteAccessVpnService { static final String RemoteAccessVpnClientIpRangeCK = "remote.access.vpn.client.iprange"; + ConfigKey RemoteAccessVpnPskLength = new ConfigKey<>("Network", Integer.class, "remote.access.vpn.psk.length", "24", + "The length of the ipsec preshared key (minimum 8, maximum 256)", true); + + ConfigKey RemoteAccessVpnUserLimit = new ConfigKey<>("Network", Integer.class, "remote.access.vpn.user.limit", "8", + "The maximum number of VPN users that can be created per account", true); + RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, Boolean forDisplay) throws NetworkRuleConflictException; boolean destroyRemoteAccessVpnForIp(long ipId, Account caller, boolean forceCleanup) throws ResourceUnavailableException; diff --git a/api/src/main/java/com/cloud/storage/VolumeApiService.java b/api/src/main/java/com/cloud/storage/VolumeApiService.java index 372eb0385618..904ab5b9bc9c 100644 --- a/api/src/main/java/com/cloud/storage/VolumeApiService.java +++ b/api/src/main/java/com/cloud/storage/VolumeApiService.java @@ -61,6 +61,18 @@ public interface VolumeApiService { true, ConfigKey.Scope.Zone); + ConfigKey CopyVolumeWait = new ConfigKey<>("Storage", Integer.class, "copy.volume.wait", "10800", + "In second, timeout for copy volume command", true); + + ConfigKey CreateVolumeFromSnapshotWait = new ConfigKey<>("Storage", Integer.class, "create.volume.from.snapshot.wait", "10800", + "In second, timeout for creating volume from snapshot", true); + + ConfigKey MaxUploadVolumeSize = new ConfigKey<>("Storage", Long.class, "storage.max.volume.upload.size", "500", + "The maximum size for a uploaded volume(in GB).", true); + + ConfigKey StoragePoolMaxWaitSeconds = new ConfigKey<>("Storage", Integer.class, "storage.pool.max.waitseconds", "3600", + "Timeout (in seconds) to synchronize storage pool operations.", true); + /** * Creates the database object for a volume based on the given criteria * diff --git a/api/src/main/java/com/cloud/user/ResourceLimitService.java b/api/src/main/java/com/cloud/user/ResourceLimitService.java index 89128f87829e..e46e198f877d 100644 --- a/api/src/main/java/com/cloud/user/ResourceLimitService.java +++ b/api/src/main/java/com/cloud/user/ResourceLimitService.java @@ -58,6 +58,71 @@ public interface ResourceLimitService { static final ConfigKey DefaultMaxProjectGpus = new ConfigKey<>("Project Defaults",Long.class,"max.project.gpus","20", "The default maximum number of GPU devices that can be used for a project", false); + static final ConfigKey DefaultMaxAccountUserVms = new ConfigKey<>("Account Defaults", Long.class, "max.account.user.vms", "20", + "The default maximum number of user VMs that can be deployed for an account", false); + static final ConfigKey DefaultMaxAccountPublicIPs = new ConfigKey<>("Account Defaults", Long.class, "max.account.public.ips", "20", + "The default maximum number of public IPs that can be consumed by an account", false); + static final ConfigKey DefaultMaxAccountTemplates = new ConfigKey<>("Account Defaults", Long.class, "max.account.templates", "20", + "The default maximum number of Templates that can be deployed for an account", false); + static final ConfigKey DefaultMaxAccountSnapshots = new ConfigKey<>("Account Defaults", Long.class, "max.account.snapshots", "20", + "The default maximum number of snapshots that can be created for an account", false); + static final ConfigKey DefaultMaxAccountVolumes = new ConfigKey<>("Account Defaults", Long.class, "max.account.volumes", "20", + "The default maximum number of volumes that can be created for an account", false); + static final ConfigKey DefaultMaxAccountNetworks = new ConfigKey<>("Account Defaults", Long.class, "max.account.networks", "20", + "The default maximum number of networks that can be created for an account", false); + static final ConfigKey DefaultMaxAccountVpcs = new ConfigKey<>("Account Defaults", Long.class, "max.account.vpcs", "20", + "The default maximum number of vpcs that can be created for an account", false); + static final ConfigKey DefaultMaxAccountCpus = new ConfigKey<>("Account Defaults", Long.class, "max.account.cpus", "40", + "The default maximum number of cpu cores that can be used for an account", false); + static final ConfigKey DefaultMaxAccountMemory = new ConfigKey<>("Account Defaults", Long.class, "max.account.memory", "40960", + "The default maximum memory (in MB) that can be used for an account", false); + static final ConfigKey DefaultMaxAccountPrimaryStorage = new ConfigKey<>("Account Defaults", Long.class, "max.account.primary.storage", "200", + "The default maximum primary storage space (in GiB) that can be used for an account", false); + + static final ConfigKey DefaultMaxDomainUserVms = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.user.vms", "40", + "The default maximum number of user Instances that can be deployed for a domain", false); + static final ConfigKey DefaultMaxDomainPublicIPs = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.public.ips", "40", + "The default maximum number of public IPs that can be consumed by a domain", false); + static final ConfigKey DefaultMaxDomainTemplates = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.templates", "40", + "The default maximum number of Templates that can be deployed for a domain", false); + static final ConfigKey DefaultMaxDomainSnapshots = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.snapshots", "40", + "The default maximum number of Snapshots that can be created for a domain", false); + static final ConfigKey DefaultMaxDomainVolumes = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.volumes", "40", + "The default maximum number of Volumes that can be created for a domain", false); + static final ConfigKey DefaultMaxDomainNetworks = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.networks", "40", + "The default maximum number of Networks that can be created for a domain", false); + static final ConfigKey DefaultMaxDomainVpcs = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.vpcs", "40", + "The default maximum number of VPCs that can be created for a domain", false); + static final ConfigKey DefaultMaxDomainCpus = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.cpus", "80", + "The default maximum number of CPU cores that can be used for a domain", false); + static final ConfigKey DefaultMaxDomainMemory = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.memory", "81920", + "The default maximum memory (in MB) that can be used for a domain", false); + static final ConfigKey DefaultMaxDomainPrimaryStorage = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.primary.storage", "400", + "The default maximum primary storage space (in GiB) that can be used for a domain", false); + static final ConfigKey DefaultMaxDomainSecondaryStorage = new ConfigKey<>("Domain Defaults", Long.class, "max.domain.secondary.storage", "800", + "The default maximum secondary storage space (in GiB) that can be used for a domain", false); + + static final ConfigKey DefaultMaxProjectUserVms = new ConfigKey<>("Project Defaults", Long.class, "max.project.user.vms", "20", + "The default maximum number of user VMs that can be deployed for a project", false); + static final ConfigKey DefaultMaxProjectPublicIPs = new ConfigKey<>("Project Defaults", Long.class, "max.project.public.ips", "20", + "The default maximum number of public IPs that can be consumed by a project", false); + static final ConfigKey DefaultMaxProjectTemplates = new ConfigKey<>("Project Defaults", Long.class, "max.project.templates", "20", + "The default maximum number of Templates that can be deployed for a project", false); + static final ConfigKey DefaultMaxProjectSnapshots = new ConfigKey<>("Project Defaults", Long.class, "max.project.snapshots", "20", + "The default maximum number of snapshots that can be created for a project", false); + static final ConfigKey DefaultMaxProjectVolumes = new ConfigKey<>("Project Defaults", Long.class, "max.project.volumes", "20", + "The default maximum number of volumes that can be created for a project", false); + static final ConfigKey DefaultMaxProjectNetworks = new ConfigKey<>("Project Defaults", Long.class, "max.project.networks", "20", + "The default maximum number of networks that can be created for a project", false); + static final ConfigKey DefaultMaxProjectVpcs = new ConfigKey<>("Project Defaults", Long.class, "max.project.vpcs", "20", + "The default maximum number of vpcs that can be created for a project", false); + static final ConfigKey DefaultMaxProjectCpus = new ConfigKey<>("Project Defaults", Long.class, "max.project.cpus", "40", + "The default maximum number of cpu cores that can be used for a project", false); + static final ConfigKey DefaultMaxProjectMemory = new ConfigKey<>("Project Defaults", Long.class, "max.project.memory", "40960", + "The default maximum memory (in MB) that can be used for a project", false); + static final ConfigKey DefaultMaxProjectPrimaryStorage = new ConfigKey<>("Project Defaults", Long.class, "max.project.primary.storage", "200", + "The default maximum primary storage space (in GiB) that can be used for a project", false); + static final List HostTagsSupportingTypes = List.of(ResourceType.user_vm, ResourceType.cpu, ResourceType.memory, ResourceType.gpu); static final List StorageTagsSupportingTypes = List.of(ResourceType.volume, ResourceType.primary_storage); diff --git a/api/src/main/java/org/apache/cloudstack/usage/UsageService.java b/api/src/main/java/org/apache/cloudstack/usage/UsageService.java index 00e8b431f8fe..f239f9b1019a 100644 --- a/api/src/main/java/org/apache/cloudstack/usage/UsageService.java +++ b/api/src/main/java/org/apache/cloudstack/usage/UsageService.java @@ -20,11 +20,34 @@ import org.apache.cloudstack.api.command.admin.usage.GenerateUsageRecordsCmd; import org.apache.cloudstack.api.command.admin.usage.ListUsageRecordsCmd; import org.apache.cloudstack.api.command.admin.usage.RemoveRawUsageRecordsCmd; +import org.apache.cloudstack.framework.config.ConfigKey; import java.util.List; import java.util.TimeZone; public interface UsageService { + + ConfigKey UsageAggregationTimezone = new ConfigKey<>("Usage", String.class, "usage.aggregation.timezone", "GMT", + "The timezone to use for usage stats aggregation", true); + + ConfigKey UsageExecutionTimezone = new ConfigKey<>("Usage", String.class, "usage.execution.timezone", null, + "The timezone to use for usage job execution time", true); + + ConfigKey UsageSanityCheckInterval = new ConfigKey<>("Usage", Integer.class, "usage.sanity.check.interval", null, + "Interval (in days) to check sanity of usage data. To disable set it to 0 or negative.", true); + + ConfigKey UsageStatsJobAggregationRange = new ConfigKey<>("Usage", Integer.class, "usage.stats.job.aggregation.range", "1440", + "The range of time for aggregating the user statistics specified in minutes (e.g. 1440 for daily, 60 for hourly.", true); + + ConfigKey UsageStatsJobExecTime = new ConfigKey<>("Usage", String.class, "usage.stats.job.exec.time", "00:15", + "The time at which the usage statistics aggregation job will run as an HH24:MM time, e.g. 00:30 to run at 12:30am.", true); + + ConfigKey EnableUsageServer = new ConfigKey<>("Usage", Boolean.class, "enable.usage.server", "true", + "Flag for enabling usage", true); + + ConfigKey UsageSnapshotVirtualSizeSelect = new ConfigKey<>("Usage", Boolean.class, "usage.snapshot.virtualsize.select", "false", + "Set the value to true if snapshot usage need to consider virtual size, else physical size is considered", true); + /** * Generate Billing Records from the last time it was generated to the * time specified. diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java index 109a44488ec4..992f4adea831 100644 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java +++ b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java @@ -138,6 +138,23 @@ public interface NetworkOrchestrationService { ConfigKey VmNetworkThrottlingRate = new ConfigKey("Network", Integer.class, "vm.network.throttling.rate", "200", "Default data transfer rate in megabits per second allowed in User vm's default network.", true, ConfigKey.Scope.Zone); + ConfigKey NetworkLBHaproxyStatsVisbility = new ConfigKey<>("Network", String.class, + "network.loadbalancer.haproxy.stats.visibility", "global", + "Load Balancer(haproxy) stats visibility, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default", + true, ConfigKey.Kind.Select, "global,guest-network,link-local,disabled,all,default"); + + ConfigKey NetworkLBHaproxyStatsUri = new ConfigKey<>("Network", String.class, + "network.loadbalancer.haproxy.stats.uri", "/admin?stats", + "Load Balancer(haproxy) uri.", true); + + ConfigKey NetworkLBHaproxyStatsAuth = new ConfigKey<>("Secure", String.class, + "network.loadbalancer.haproxy.stats.auth", "admin1:AdMiN123", + "Load Balancer(haproxy) authentication string in the format username:password", true); + + ConfigKey NetworkLBHaproxyStatsPort = new ConfigKey<>("Network", String.class, + "network.loadbalancer.haproxy.stats.port", "8081", + "Load Balancer(haproxy) stats port number.", true); + List setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault) throws ConcurrentOperationException; diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java index b8aeb5cf7510..d17adf16cc64 100644 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java +++ b/engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java @@ -18,7 +18,22 @@ */ package org.apache.cloudstack.engine.subsystem.api.storage; +import org.apache.cloudstack.framework.config.ConfigKey; + public interface StorageCacheManager { + + ConfigKey StorageCacheReplacementEnabled = new ConfigKey<>("Storage", Boolean.class, + "storage.cache.replacement.enabled", "true", + "enable or disable cache storage replacement algorithm.", true); + + ConfigKey StorageCacheReplacementInterval = new ConfigKey<>("Storage", Integer.class, + "storage.cache.replacement.interval", "86400", + "time interval between cache replacement threads (in seconds).", true); + + ConfigKey StorageCacheReplacementLRUTimeInterval = new ConfigKey<>("Storage", Integer.class, + "storage.cache.replacement.lru.interval", "30", + "time interval for unused data on cache storage (in days).", true); + DataStore getCacheStorage(Scope scope); DataStore getCacheStorage(DataObject data, Scope scope); diff --git a/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java b/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java index 4d63fae33560..183c7626cbf5 100644 --- a/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java +++ b/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java @@ -58,6 +58,33 @@ public interface AgentManager { "kvm.host.discovery.ssh.port", String.valueOf(Host.DEFAULT_SSH_PORT), "SSH port used for KVM host discovery and any other operations on host (using SSH)." + " Please note that this is applicable when port is not defined through host url while adding the KVM host.", true, ConfigKey.Scope.Cluster); + ConfigKey InstanceName = new ConfigKey<>("Advanced", String.class, "instance.name", "VM", + "Name of the deployment instance.", false); + + ConfigKey XapiWait = new ConfigKey<>("Advanced", Integer.class, "xapiwait", "60", + "Time (in seconds) to wait for XAPI to return", true); + + ConfigKey MigrateWait = new ConfigKey<>("Advanced", Integer.class, "migratewait", "3600", + "Time (in seconds) to wait for VM migrate finish", true); + + ConfigKey SecStorageVmMTUSize = new ConfigKey<>("Advanced", Integer.class, "secstorage.vm.mtu.size", "1500", + "MTU size (in Byte) of storage network in secondary storage vms", true); + + ConfigKey SecStorageCapacityStandby = new ConfigKey<>("Advanced", Integer.class, "secstorage.capacity.standby", "10", + "The minimal number of command execution sessions that system is able to serve immediately(standby capacity)", true); + + ConfigKey SecStorageSessionMax = new ConfigKey<>("Advanced", Integer.class, "secstorage.session.max", "50", + "The max number of command execution sessions that a SSVM can handle", true); + + ConfigKey SecStorageCmdExecutionTimeMax = new ConfigKey<>("Advanced", Integer.class, "secstorage.cmd.execution.time.max", "30", + "The max command execution time in minute", true); + + ConfigKey SecStorageProxy = new ConfigKey<>("Advanced", String.class, "secstorage.proxy", null, + "http proxy used by ssvm, in http://username:password@proxyserver:port format", true); + + ConfigKey XenServerMaxNics = new ConfigKey<>("Advanced", Integer.class, "xenserver.nics.max", "7", + "Maximum allowed nics for Vms created on XenServer", true); + enum TapAgentsAction { Add, Del, Contains, } diff --git a/engine/components-api/src/main/java/com/cloud/alert/AlertManager.java b/engine/components-api/src/main/java/com/cloud/alert/AlertManager.java index 46993b066a49..aece878d93fd 100644 --- a/engine/components-api/src/main/java/com/cloud/alert/AlertManager.java +++ b/engine/components-api/src/main/java/com/cloud/alert/AlertManager.java @@ -53,6 +53,59 @@ public interface AlertManager extends Manager, AlertService { "alert.allowed.repetitive.types", "", "Comma-separated list of alert types (by name) that can be sent multiple times", true); + ConfigKey AlertEmailAddresses = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, String.class, + "alert.email.addresses", null, + "Comma separated list of email addresses which are going to receive alert emails.", true, + ConfigKey.Kind.CSV, null); + + ConfigKey AlertEmailSender = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, String.class, + "alert.email.sender", null, + "Sender of alert email (will be in the From header of the email).", true); + + ConfigKey AlertSMTPHost = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, String.class, + "alert.smtp.host", null, + "SMTP hostname used for sending out email alerts.", true); + + ConfigKey AlertSMTPPort = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Integer.class, + "alert.smtp.port", "465", + "Port the SMTP server is listening on.", true); + + ConfigKey AlertSMTPUsername = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, String.class, + "alert.smtp.username", null, + "Username for SMTP authentication (applies only if alert.smtp.useAuth is true).", true); + + ConfigKey AlertSMTPPassword = new ConfigKey<>("Secure", String.class, + "alert.smtp.password", null, + "Password for SMTP authentication (applies only if alert.smtp.useAuth is true).", true); + + ConfigKey CapacityCheckPeriod = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Integer.class, + "capacity.check.period", "300000", + "The interval in milliseconds between capacity checks", true); + + ConfigKey PublicIpCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "zone.virtualnetwork.publicip.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of public IP address space utilization above which alerts will be sent.", true); + + ConfigKey PrivateIpCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "pod.privateip.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of private IP address space utilization above which alerts will be sent.", true); + + ConfigKey SecondaryStorageCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "zone.secstorage.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of secondary storage utilization above which alerts will be sent about low storage available.", true); + + ConfigKey VlanCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "zone.vlan.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of Zone Vlan utilization above which alerts will be sent about low number of Zone Vlans.", true); + + ConfigKey DirectNetworkPublicIpCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "zone.directnetwork.publicip.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of Direct Network Public Ip Utilization above which alerts will be sent about low number of direct network public ips.", true); + + ConfigKey LocalStorageCapacityThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ALERT, Double.class, + "cluster.localStorage.capacity.notificationthreshold", "0.75", + "Percentage (as a value between 0 and 1) of local storage utilization above which alerts will be sent about low local storage available.", true); + void clearAlert(AlertType alertType, long dataCenterId, long podId); void recalculateCapacity(); diff --git a/engine/components-api/src/main/java/com/cloud/deploy/DeploymentPlanningManager.java b/engine/components-api/src/main/java/com/cloud/deploy/DeploymentPlanningManager.java index ce40287bf033..1a7e17019542 100644 --- a/engine/components-api/src/main/java/com/cloud/deploy/DeploymentPlanningManager.java +++ b/engine/components-api/src/main/java/com/cloud/deploy/DeploymentPlanningManager.java @@ -37,6 +37,13 @@ public interface DeploymentPlanningManager extends Manager { static final ConfigKey allowAdminVmOnDisabledResource = new ConfigKey("Advanced", Boolean.class, "allow.admin.vm.on.disabled.resources", "false", "Allow deploying VMs owned by the admin account in disabled Clusters, Pods, and Zones", true); + ConfigKey HostReservationReleasePeriod = new ConfigKey<>("Advanced", Integer.class, "host.reservation.release.period", "300000", + "The interval in milliseconds between host reservation release checks", true); + + ConfigKey VmDeploymentPlanner = new ConfigKey<>("Advanced", String.class, "vm.deployment.planner", "FirstFitPlanner", + "'FirstFitPlanner', 'UserDispersingPlanner', 'UserConcentratedPodPlanner': DeploymentPlanner heuristic that will be used for VM deployment.", + true, ConfigKey.Kind.Select, "FirstFitPlanner,UserDispersingPlanner,UserConcentratedPodPlanner"); + /** * Manages vm deployment stages: First Process Affinity/Anti-affinity - Call * the chain of AffinityGroupProcessor adapters to set deploymentplan scope diff --git a/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java b/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java index 53bfcce27038..a946b0db417b 100644 --- a/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java +++ b/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java @@ -78,6 +78,9 @@ public interface HighAvailabilityManager extends Manager { ConfigKey KvmHAFenceHostIfHeartbeatFailsOnStorage = new ConfigKey<>("Advanced", Boolean.class, "kvm.ha.fence.on.storage.heartbeat.failure", "false", "Proceed fencing the host even the heartbeat failed for only one storage pool", false, ConfigKey.Scope.Zone); + ConfigKey HaTag = new ConfigKey<>("Advanced", String.class, "ha.tag", null, + "HA tag defining that the host marked with this tag can be used for HA purposes only", true); + enum WorkType { Migration, // Migrating VMs off of a host. Stop, // Stops a VM for storage pool migration purposes. This should be obsolete now. diff --git a/engine/components-api/src/main/java/com/cloud/network/security/SecurityGroupManager.java b/engine/components-api/src/main/java/com/cloud/network/security/SecurityGroupManager.java index 6e2270ffb108..5167a396e2e0 100644 --- a/engine/components-api/src/main/java/com/cloud/network/security/SecurityGroupManager.java +++ b/engine/components-api/src/main/java/com/cloud/network/security/SecurityGroupManager.java @@ -19,6 +19,8 @@ import java.util.HashMap; import java.util.List; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.uservm.UserVm; import com.cloud.utils.Pair; @@ -33,6 +35,23 @@ public interface SecurityGroupManager { public static final int TIME_BETWEEN_CLEANUPS = 60; public static final int WORKER_THREAD_COUNT = 10; + ConfigKey SecurityGroupWorkCleanupInterval = new ConfigKey<>("Network", Integer.class, + "network.securitygroups.work.cleanup.interval", "120", + "Time interval (seconds) in which finished work is cleaned up from the work table", true); + + ConfigKey SecurityGroupWorkerThreads = new ConfigKey<>("Network", Integer.class, + "network.securitygroups.workers.pool.size", "50", + "Number of worker threads processing the security group update work queue", true); + + ConfigKey SecurityGroupWorkGlobalLockTimeout = new ConfigKey<>("Network", Integer.class, + "network.securitygroups.work.lock.timeout", "300", + "Lock wait timeout (seconds) while updating the security group work queue", true); + + ConfigKey SecurityGroupWorkPerAgentMaxQueueSize = new ConfigKey<>("Network", Integer.class, + "network.securitygroups.work.per.agent.queue.size", "100", + "The number of outstanding security group work items that can be queued to a host. If exceeded, work items will get dropped to conserve memory. " + + "Security Group Sync will take care of ensuring that the host gets updated eventually", true); + public SecurityGroupVO createSecurityGroup(String name, String description, Long domainId, Long accountId, String accountName); public SecurityGroupVO createDefaultSecurityGroup(Long accountId); diff --git a/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java b/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java index 792a3a6b397f..5668fa24cd6c 100644 --- a/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java +++ b/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java @@ -58,6 +58,12 @@ public interface VpcManager { ConfigKey.Scope.Global, null); + ConfigKey VpcCleanupInterval = new ConfigKey<>("Advanced", Integer.class, "vpc.cleanup.interval", "3600", + "The interval (in seconds) between cleanup for Inactive VPCs", true); + + ConfigKey VpcMaxNetworks = new ConfigKey<>("Advanced", Integer.class, "vpc.max.networks", "3", + "Maximum number of networks per vpc", true); + /** * Returns all the Guest networks that are part of VPC * diff --git a/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java b/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java index 962bea638d0f..9bd59437dbea 100644 --- a/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java +++ b/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java @@ -56,6 +56,9 @@ public interface StorageManager extends StorageService { false, ConfigKey.Scope.Global, null); + + ConfigKey StoragePoolCleanupEnabled = new ConfigKey<>("Advanced", Boolean.class, "storage.pool.cleanup.enabled", "true", + "Enables/disables cleanup of the garbage-collecting storage pool allocator.", true); ConfigKey StorageCleanupInterval = new ConfigKey<>(Integer.class, "storage.cleanup.interval", "Advanced", @@ -172,6 +175,22 @@ public interface StorageManager extends StorageService { ConfigKey MaxDataMigrationWaitTime = new ConfigKey<>("Advanced", Integer.class, "max.data.migration.wait.time", "15", "Maximum wait time (in minutes) for a data migration task before spawning a new SSVM", false, ConfigKey.Scope.Global); + + ConfigKey VmDiskThrottlingIopsReadRate = new ConfigKey<>("Advanced", Integer.class, "vm.disk.throttling.iops_read_rate", "0", + "Default disk I/O read rate in requests per second allowed in User vm's disk.", true); + + ConfigKey VmDiskThrottlingIopsWriteRate = new ConfigKey<>("Advanced", Integer.class, "vm.disk.throttling.iops_write_rate", "0", + "Default disk I/O writerate in requests per second allowed in User vm's disk.", true); + + ConfigKey VmDiskThrottlingBytesReadRate = new ConfigKey<>("Advanced", Long.class, "vm.disk.throttling.bytes_read_rate", "0", + "Default disk I/O read rate in bytes per second allowed in User vm's disk.", true); + + ConfigKey VmDiskThrottlingBytesWriteRate = new ConfigKey<>("Advanced", Long.class, "vm.disk.throttling.bytes_write_rate", "0", + "Default disk I/O writerate in bytes per second allowed in User vm's disk.", true); + + ConfigKey ExpungeWorkers = new ConfigKey<>("Advanced", Integer.class, "expunge.workers", "1", + "Number of workers performing expunge ", true); + ConfigKey DiskProvisioningStrictness = new ConfigKey<>("Storage", Boolean.class, "disk.provisioning.type.strictness", "false", "If set to true, the disk is created only when there is a suitable storage pool that supports the disk provisioning type specified by the service/disk offering. " + "If set to false, the disk is created with a disk provisioning type supported by the pool. Default value is false, and this is currently supported for VMware only.", diff --git a/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java b/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java index 8c11fe6c93ad..e89b97e6a3e9 100644 --- a/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java +++ b/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java @@ -85,6 +85,13 @@ public interface TemplateManager { true, ConfigKey.Scope.Cluster); + ConfigKey SSVMPSK = new ConfigKey<>("Hidden", String.class, "upload.post.secret.key", "", + "PSK with SSVM", true); + + ConfigKey CreatePrivateTemplateFromSnapshotWait = new ConfigKey<>("Storage", Integer.class, + "create.private.template.from.snapshot.wait", "10800", + "In second, timeout for CreatePrivateTemplateFromSnapshotCommand", true); + // KVM/libvirt maps deviceSeq=3 to hdc (hda/hdb are taken by the root volume on i440fx/IDE). // user_vm.iso_id has always pointed at this slot; additional cdroms live in vm_iso_map. int CDROM_PRIMARY_DEVICE_SEQ = 3; diff --git a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java index 6831552b83db..24c165db268f 100644 --- a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java +++ b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java @@ -33,6 +33,9 @@ public interface VMSnapshotManager extends VMSnapshotService, Manager { ConfigKey VMSnapshotMax = new ConfigKey("Advanced", Integer.class, "vmsnapshot.max", "10", "Maximum VM snapshots for a single VM", true, ConfigKey.Scope.Account); + ConfigKey VMSnapshotCreateWait = new ConfigKey<>("Advanced", Integer.class, "vmsnapshot.create.wait", "1800", + "In second, timeout for create vm snapshot", true); + /** * Delete all VM snapshots belonging to one VM * @param id, VM id 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 9eab15214aeb..d9f1fef87e47 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 @@ -2235,7 +2235,9 @@ public ConfigKey[] getConfigKeys() { return new ConfigKey[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize, DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait, GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections, - RemoteAgentNewConnectionsMonitorInterval, KVMHostDiscoverySshPort }; + RemoteAgentNewConnectionsMonitorInterval, KVMHostDiscoverySshPort, InstanceName, XapiWait, MigrateWait, + SecStorageVmMTUSize, SecStorageCapacityStandby, SecStorageSessionMax, SecStorageCmdExecutionTimeMax, + SecStorageProxy, XenServerMaxNics }; } protected class SetHostParamsListener implements Listener { diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index c1697819174d..4fcdb0596fe4 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -5117,6 +5117,7 @@ public ConfigKey[] getConfigKeys() { GuestDomainSuffix, NetworkThrottlingRate, VmNetworkThrottlingRate, MinVRVersion, DhcpLeaseTimeout, PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled, TUNGSTEN_ENABLED, NSX_ENABLED, NETRIS_ENABLED, NETWORK_LB_HAPROXY_MAX_CONN, - NETWORK_LB_HAPROXY_IDLE_TIMEOUT}; + NETWORK_LB_HAPROXY_IDLE_TIMEOUT, NetworkLBHaproxyStatsVisbility, NetworkLBHaproxyStatsUri, + NetworkLBHaproxyStatsAuth, NetworkLBHaproxyStatsPort}; } } diff --git a/engine/storage/cache/src/main/java/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java b/engine/storage/cache/src/main/java/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java index 21ef851fb2f2..1e09e59b0473 100644 --- a/engine/storage/cache/src/main/java/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java +++ b/engine/storage/cache/src/main/java/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java @@ -48,6 +48,8 @@ import org.apache.cloudstack.engine.subsystem.api.storage.StorageCacheManager; import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.storage.cache.allocator.StorageCacheAllocator; import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager; @@ -64,7 +66,7 @@ import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.exception.CloudRuntimeException; -public class StorageCacheManagerImpl implements StorageCacheManager, Manager { +public class StorageCacheManagerImpl implements StorageCacheManager, Manager, Configurable { protected Logger logger = LogManager.getLogger(getClass()); @Inject List storageCacheAllocator; @@ -166,6 +168,16 @@ public boolean configure(String name, Map params) throws Configu return true; } + @Override + public String getConfigComponentName() { + return StorageCacheManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {StorageCacheReplacementEnabled, StorageCacheReplacementInterval, StorageCacheReplacementLRUTimeInterval}; + } + protected class CacheReplacementRunner extends ManagedContextRunnable { @Override diff --git a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java index 759948cb9c0c..f1f82b1b742d 100644 --- a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java +++ b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java @@ -1244,7 +1244,7 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {HeartbeatInterval, HeartbeatThreshold}; + return new ConfigKey[] {HeartbeatInterval, HeartbeatThreshold, ClusterServiceAdapter.ClusterMessageTimeOut}; } private boolean pingManagementNode(final ManagementServerHostVO mshost) { diff --git a/framework/cluster/src/main/java/com/cloud/cluster/ClusterServiceAdapter.java b/framework/cluster/src/main/java/com/cloud/cluster/ClusterServiceAdapter.java index e073a28a6221..299951883ed2 100644 --- a/framework/cluster/src/main/java/com/cloud/cluster/ClusterServiceAdapter.java +++ b/framework/cluster/src/main/java/com/cloud/cluster/ClusterServiceAdapter.java @@ -23,7 +23,7 @@ import com.cloud.utils.component.Adapter; public interface ClusterServiceAdapter extends Adapter { - final ConfigKey ClusterMessageTimeOut = new ConfigKey(Integer.class, "cluster.message.timeout.seconds", "Advance", "300", + final ConfigKey ClusterMessageTimeOut = new ConfigKey(Integer.class, "cluster.message.timeout.seconds", "Advanced", "300", "Time (in seconds) to wait before a inter-management server message post times out.", true); public ClusterService getPeerService(String strPeer) throws RemoteException; diff --git a/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitService.java b/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitService.java index bb97f5a6ee09..db886994ae3e 100644 --- a/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitService.java +++ b/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitService.java @@ -17,6 +17,7 @@ package org.apache.cloudstack.ratelimit; import org.apache.cloudstack.api.response.ApiLimitResponse; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.user.Account; import com.cloud.utils.component.PluggableService; @@ -27,6 +28,9 @@ */ public interface ApiRateLimitService extends PluggableService { + ConfigKey ApiLimitCacheSize = new ConfigKey<>("Advanced", Integer.class, "api.throttling.cachesize", "50000", + "Account based API count cache size", true); + public ApiLimitResponse searchApiLimit(Account caller); public boolean resetApiLimit(Long accountId); diff --git a/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java b/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java index c1baccfd9f5d..cc342249bd68 100644 --- a/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java +++ b/plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java @@ -38,6 +38,8 @@ import org.apache.cloudstack.api.command.admin.ratelimit.ResetApiLimitCmd; import org.apache.cloudstack.api.command.user.ratelimit.GetApiLimitCmd; import org.apache.cloudstack.api.response.ApiLimitResponse; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import com.cloud.configuration.Config; @@ -49,7 +51,7 @@ import com.cloud.utils.component.AdapterBase; @Component -public class ApiRateLimitServiceImpl extends AdapterBase implements APIChecker, ApiRateLimitService { +public class ApiRateLimitServiceImpl extends AdapterBase implements APIChecker, ApiRateLimitService, Configurable { /** * True if api rate limiting is enabled @@ -265,4 +267,14 @@ public void setEnabled(boolean enabled) { this.enabled = enabled; } + + @Override + public String getConfigComponentName() { + return ApiRateLimitService.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {ApiLimitCacheSize}; + } } diff --git a/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManager.java b/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManager.java index 629153a2b38d..0a59d7623efe 100644 --- a/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManager.java +++ b/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManager.java @@ -21,11 +21,30 @@ import com.cloud.utils.component.Manager; import com.cloud.utils.component.PluggableService; import org.apache.cloudstack.api.BaremetalProvisionDoneNotificationCmd; +import org.apache.cloudstack.framework.config.ConfigKey; public interface BaremetalManager extends Manager, PluggableService { public static final String EchoSecurityGroupAgent = "EchoSecurityGroupAgent"; public static final String ExternalBaremetalSystemUrl = "ExternalBaremetalSystemUrl"; public static final String DO_PXE = "doPxe"; + ConfigKey BaremetalInternalStorageServer = new ConfigKey<>("Advanced", String.class, "baremetal.internal.storage.server.ip", null, + "the ip address of server that stores kickstart file, kernel, initrd, ISO for advanced networking baremetal provisioning", true); + + ConfigKey BaremetalProvisionDoneNotificationTimeout = new ConfigKey<>("Advanced", Integer.class, "baremetal.provision.done.notification.timeout", "1800", + "the max time to wait before treating a baremetal provision as failure if no provision done notification is not received, in secs", true); + + ConfigKey ExternalBaremetalResourceClassName = new ConfigKey<>("Advanced", String.class, "external.baremetal.resource.classname", null, + "class name for handling external baremetal resource", true); + + ConfigKey EnableBaremetalSecurityGroupAgentEcho = new ConfigKey<>("Advanced", Boolean.class, "enable.baremetal.securitygroup.agent.echo", "false", + "After starting provision process, periodcially echo security agent installed in the template. Treat provisioning as success only if echo successfully", true); + + ConfigKey BaremetalIpmiLanInterface = new ConfigKey<>("Advanced", String.class, "baremetal.ipmi.lan.interface", "default", + "option specified in -I option of ipmitool. candidates are: open/bmc/lipmi/lan/lanplus/free/imb, see ipmitool man page for details. default value 'default' means using default option of ipmitool", true); + + ConfigKey BaremetalIpmiRetryTimes = new ConfigKey<>("Advanced", Integer.class, "baremetal.ipmi.fail.retry", "5", + "ipmi interface will be temporary out of order after power operations(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure", true); + void notifyProvisionDone(BaremetalProvisionDoneNotificationCmd cmd); } diff --git a/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManagerImpl.java b/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManagerImpl.java index d90ea6c37312..3b8a8bed9bb8 100644 --- a/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManagerImpl.java +++ b/plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BaremetalManagerImpl.java @@ -32,6 +32,8 @@ import com.cloud.vm.VMInstanceVO; import com.cloud.vm.dao.VMInstanceDao; import org.apache.cloudstack.api.BaremetalProvisionDoneNotificationCmd; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.api.AddBaremetalHostCmd; @@ -44,7 +46,7 @@ import com.cloud.vm.VirtualMachine.Event; import com.cloud.vm.VirtualMachine.State; -public class BaremetalManagerImpl extends ManagerBase implements BaremetalManager, StateListener { +public class BaremetalManagerImpl extends ManagerBase implements BaremetalManager, StateListener, Configurable { @Inject protected HostDao _hostDao; @@ -151,4 +153,15 @@ public void notifyProvisionDone(BaremetalProvisionDoneNotificationCmd cmd) { logger.debug(String.format("received baremetal provision done notification for vm %s running on host %s [mac:%s, ip:%s]", vm, host, host.getPrivateMacAddress(), host.getPrivateIpAddress())); } + + @Override + public String getConfigComponentName() { + return BaremetalManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {BaremetalInternalStorageServer, BaremetalProvisionDoneNotificationTimeout, ExternalBaremetalResourceClassName, + EnableBaremetalSecurityGroupAgentEcho, BaremetalIpmiLanInterface, BaremetalIpmiRetryTimes}; + } } diff --git a/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManager.java b/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManager.java index 24356172a9e3..21661344f783 100644 --- a/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManager.java +++ b/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManager.java @@ -26,11 +26,16 @@ import org.apache.cloudstack.api.response.UcsBladeResponse; import org.apache.cloudstack.api.response.UcsManagerResponse; import org.apache.cloudstack.api.response.UcsProfileResponse; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.utils.component.Manager; import com.cloud.utils.component.PluggableService; public interface UcsManager extends Manager, PluggableService { + + ConfigKey UCSSyncBladeInterval = new ConfigKey<>("Advanced", Integer.class, "ucs.sync.blade.interval", "3600", + "the interval cloudstack sync with UCS manager for available blades in case user remove blades from chassis without notifying CloudStack", true); + UcsManagerResponse addUcsManager(AddUcsManagerCmd cmd); ListResponse listUcsProfiles(ListUcsProfileCmd cmd); diff --git a/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManagerImpl.java b/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManagerImpl.java index 6127ed012f35..2a5699f6bc30 100644 --- a/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManagerImpl.java +++ b/plugins/hypervisors/ucs/src/main/java/com/cloud/ucs/manager/UcsManagerImpl.java @@ -39,6 +39,8 @@ import org.apache.cloudstack.api.response.UcsBladeResponse; import org.apache.cloudstack.api.response.UcsManagerResponse; import org.apache.cloudstack.api.response.UcsProfileResponse; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.logging.log4j.Logger; @@ -67,7 +69,7 @@ import com.cloud.utils.xmlobject.XmlObject; import com.cloud.utils.xmlobject.XmlObjectParser; -public class UcsManagerImpl implements UcsManager { +public class UcsManagerImpl implements UcsManager, Configurable { protected Logger logger = LogManager.getLogger(getClass()); public static final Long COOKIE_TTL = TimeUnit.MILLISECONDS.convert(100L, TimeUnit.MINUTES); public static final Long COOKIE_REFRESH_TTL = TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES); @@ -509,4 +511,14 @@ public void deleteUcsManager(Long id) { } ucsDao.remove(id); } + + @Override + public String getConfigComponentName() { + return UcsManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {UCSSyncBladeInterval}; + } } diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java index 8be881b94940..8bc88281c2d5 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java @@ -61,6 +61,24 @@ public interface VmwareManager { "Specify the default network device type for user VMs, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3", true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.Select, "E1000,PCNet32,Vmxnet2,Vmxnet3"); + ConfigKey VmwareServiceConsole = new ConfigKey<>("Advanced", String.class, "vmware.service.console", "Service Console", + "Specify the service console network name(for ESX hosts)", true); + + ConfigKey VmwareManagementPortGroup = new ConfigKey<>("Advanced", String.class, "vmware.management.portgroup", "Management Network", + "Specify the management network name(for ESXi hosts)", true); + + ConfigKey VmwareAdditionalVncPortRangeStart = new ConfigKey<>("Advanced", Integer.class, "vmware.additional.vnc.portrange.start", "50000", + "Start port number of additional VNC port range", true); + + ConfigKey VmwareAdditionalVncPortRangeSize = new ConfigKey<>("Advanced", Integer.class, "vmware.additional.vnc.portrange.size", "1000", + "Start port number of additional VNC port range", true); + + ConfigKey VmwareRecycleHungWorker = new ConfigKey<>("Advanced", Boolean.class, "vmware.recycle.hung.wokervm", "false", + "Specify whether or not to recycle hung worker VMs", true); + + ConfigKey VmwareVcenterSessionTimeout = new ConfigKey<>("Advanced", Long.class, "vmware.vcenter.session.timeout", "1200", + "VMware client timeout in seconds", true); + String composeWorkerName(); String getSystemVMIsoFileNameOnDatastore(); diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 8052317817ad..15ded5936c5d 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -301,7 +301,8 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout, s_vmwareCleanupPortGroups, VMWARE_STATS_TIME_WINDOW, VmwareUserVmNicDeviceType}; + return new ConfigKey[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout, s_vmwareCleanupPortGroups, VMWARE_STATS_TIME_WINDOW, VmwareUserVmNicDeviceType, + VmwareServiceConsole, VmwareManagementPortGroup, VmwareAdditionalVncPortRangeStart, VmwareAdditionalVncPortRangeSize, VmwareRecycleHungWorker, VmwareVcenterSessionTimeout}; } @Override public boolean configure(String name, Map params) throws ConfigurationException { diff --git a/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManager.java b/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManager.java index a687c8113165..fd6c60710fa2 100644 --- a/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManager.java +++ b/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManager.java @@ -19,6 +19,7 @@ import java.util.List; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.NetworkRuleConflictException; @@ -31,6 +32,18 @@ public interface ElasticLoadBalancerManager { public static final int DEFAULT_ELB_VM_RAMSIZE = 128; // 512 MB public static final int DEFAULT_ELB_VM_CPU_MHZ = 256; // 500 MHz + ConfigKey ElasticLoadBalancerVmMemory = new ConfigKey<>("Advanced", Integer.class, "network.loadbalancer.basiczone.elb.vm.ram.size", "512", + "Memory in MB for the elastic load balancer vm", true); + + ConfigKey ElasticLoadBalancerVmCpuMhz = new ConfigKey<>("Advanced", Integer.class, "network.loadbalancer.basiczone.elb.vm.cpu.mhz", "128", + "CPU speed for the elastic load balancer vm", true); + + ConfigKey ElasticLoadBalancerVmNumVcpu = new ConfigKey<>("Advanced", Integer.class, "network.loadbalancer.basiczone.elb.vm.vcpu.num", "1", + "Number of VCPU for the elastic load balancer vm", true); + + ConfigKey ElasticLoadBalancerVmGcInterval = new ConfigKey<>("Advanced", Integer.class, "network.loadbalancer.basiczone.elb.gc.interval.minutes", "30", + "Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5", true); + public boolean applyLoadBalancerRules(Network network, List rules) throws ResourceUnavailableException; public LoadBalancer handleCreateLoadBalancerRule(CreateLoadBalancerRuleCmd lb, Account caller, long networkId) throws InsufficientAddressCapacityException, diff --git a/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java index 9dc083015c3b..c1bc46c1db8a 100644 --- a/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java +++ b/plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java @@ -33,6 +33,8 @@ import org.apache.cloudstack.api.command.user.loadbalancer.CreateLoadBalancerRuleCmd; import org.apache.cloudstack.config.ApiServiceConfiguration; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.userdata.UserDataManager; @@ -107,7 +109,7 @@ import static com.cloud.vm.VirtualMachineManager.SystemVmEnableUserData; @Component -public class ElasticLoadBalancerManagerImpl extends ManagerBase implements ElasticLoadBalancerManager, VirtualMachineGuru { +public class ElasticLoadBalancerManagerImpl extends ManagerBase implements ElasticLoadBalancerManager, VirtualMachineGuru, Configurable { @Inject private AgentManager _agentMgr; @@ -625,4 +627,14 @@ public void finalizeUnmanage(VirtualMachine vm) { public void expungeLbVmRefs(List vmIds, Long batchSize) { _elbVmMapDao.expungeByLbVmList(vmIds, batchSize); } + + @Override + public String getConfigComponentName() { + return ElasticLoadBalancerManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {ElasticLoadBalancerVmMemory, ElasticLoadBalancerVmCpuMhz, ElasticLoadBalancerVmNumVcpu, ElasticLoadBalancerVmGcInterval}; + } } diff --git a/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerElement.java index 096b400ee938..cf2538329959 100644 --- a/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerElement.java +++ b/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerElement.java @@ -32,6 +32,7 @@ import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; +import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice; import org.apache.cloudstack.region.gslb.GslbServiceProvider; @@ -1527,4 +1528,9 @@ public VirtualRouter stopNetscalerServiceVm(Long id, boolean forced, Account cal ResourceUnavailableException { return _netScalerVMManager.stopNetScalerVm(id, forced, callingAccount, callingUserId); } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {DefaultExternalLoadBalancerCapacity, EIPWithMultipleNetScalersEnabled, NCCCmdTimeOut}; + } } diff --git a/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerLoadBalancerElementService.java b/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerLoadBalancerElementService.java index 84f1fcecbff1..08103a930998 100644 --- a/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerLoadBalancerElementService.java +++ b/plugins/network-elements/netscaler/src/main/java/com/cloud/network/element/NetscalerLoadBalancerElementService.java @@ -19,6 +19,8 @@ import java.util.List; import java.util.Map; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.api.commands.AddNetscalerLoadBalancerCmd; import com.cloud.api.commands.ConfigureNetscalerLoadBalancerCmd; import com.cloud.api.commands.DeleteNetscalerControlCenterCmd; @@ -47,6 +49,12 @@ public interface NetscalerLoadBalancerElementService extends PluggableService { + ConfigKey EIPWithMultipleNetScalersEnabled = new ConfigKey<>("Advanced", Boolean.class, "eip.use.multiple.netscalers", "false", + "Should be set to true, if there will be multiple NetScaler devices providing EIP service in a zone", true); + + ConfigKey NCCCmdTimeOut = new ConfigKey<>("Advanced", Long.class, "ncc.command.timeout", "600000", + "Command Timeout Interval (in millisec)", true); + /** * lists all Netscaler Control Center user Details * @param ListNetscalerControlCenterCmd diff --git a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManager.java b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManager.java index cd881363ec3b..1c3382f187e3 100644 --- a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManager.java +++ b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManager.java @@ -16,12 +16,18 @@ // under the License. package com.cloud.network.ovs; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.host.Host; import com.cloud.network.Network; import com.cloud.utils.component.Manager; public interface OvsTunnelManager extends Manager { + ConfigKey OvsTunnelNetworkDefaultLabel = new ConfigKey<>("Network", String.class, + "sdn.ovs.controller.default.label", "cloud-public", + "Default network label to be used when fetching interface for GRE endpoints", true); + boolean isOvsTunnelEnabled(); /** diff --git a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java index 804f29c01b1e..0c16307a983e 100644 --- a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java +++ b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java @@ -26,6 +26,8 @@ import javax.naming.ConfigurationException; import javax.persistence.EntityExistsException; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.MessageSubscriber; @@ -91,7 +93,7 @@ import com.cloud.vm.dao.VMInstanceDao; @Component -public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManager, StateListener { +public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManager, StateListener, Configurable { // boolean _isEnabled; ScheduledExecutorService _executorPool; @@ -930,4 +932,14 @@ public Long doInTransaction(TransactionStatus status) { } } + + @Override + public String getConfigComponentName() { + return OvsTunnelManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {OvsTunnelNetworkDefaultLabel}; + } } diff --git a/server/src/main/java/com/cloud/alert/AlertManagerImpl.java b/server/src/main/java/com/cloud/alert/AlertManagerImpl.java index 27b445ba3769..1387ca66607b 100644 --- a/server/src/main/java/com/cloud/alert/AlertManagerImpl.java +++ b/server/src/main/java/com/cloud/alert/AlertManagerImpl.java @@ -893,7 +893,10 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { return new ConfigKey[] {CPUCapacityThreshold, MemoryCapacityThreshold, StorageAllocatedCapacityThreshold, StorageCapacityThreshold, AlertSmtpEnabledSecurityProtocols, - AlertSmtpUseStartTLS, Ipv6SubnetCapacityThreshold, AlertSmtpUseAuth, AllowedRepetitiveAlertTypes}; + AlertSmtpUseStartTLS, Ipv6SubnetCapacityThreshold, AlertSmtpUseAuth, AllowedRepetitiveAlertTypes, + AlertEmailAddresses, AlertEmailSender, AlertSMTPHost, AlertSMTPPort, AlertSMTPUsername, AlertSMTPPassword, CapacityCheckPeriod, + PublicIpCapacityThreshold, PrivateIpCapacityThreshold, SecondaryStorageCapacityThreshold, VlanCapacityThreshold, + DirectNetworkPublicIpCapacityThreshold, LocalStorageCapacityThreshold}; } @Override diff --git a/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManager.java b/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManager.java index 4e71d78fcbbd..09fad1212c62 100644 --- a/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManager.java +++ b/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManager.java @@ -97,6 +97,18 @@ public interface ConsoleProxyManager extends Manager, ConsoleProxyService { ConfigKey ConsoleProxyManagementLastState = new ConfigKey(ConfigKey.CATEGORY_ADVANCED, String.class, "consoleproxy.management.state.last", com.cloud.consoleproxy.ConsoleProxyManagementState.Auto.toString(), "last console proxy service management state", false, ConfigKey.Kind.Select, consoleProxyManagementStates); + ConfigKey ConsoleProxyVmRamSize = new ConfigKey<>("Advanced", Integer.class, "console.ram.size", String.valueOf(DEFAULT_PROXY_VM_RAMSIZE), + "Console proxy VM default RAM size (in MB)", true); + + ConfigKey ConsoleProxyVmCpuMhz = new ConfigKey<>("Advanced", Integer.class, "console.cpu.mhz", String.valueOf(DEFAULT_PROXY_VM_CPUMHZ), + "Console proxy VM default CPU speed (in MHz)", true); + + ConfigKey ConsoleProxyStaticPublicIp = new ConfigKey<>("Advanced", String.class, "consoleproxy.static.publicIp", null, + "Public IP address for a static console proxy VM. Unset disables static console proxy mode.", true); + + ConfigKey ConsoleProxyStaticPort = new ConfigKey<>("Advanced", Integer.class, "consoleproxy.static.port", null, + "Port to use for a static console proxy VM. Unset falls back to a caller-determined default.", true); + ConfigKey ConsoleProxyVmUserData = new ConfigKey<>(String.class, "console.proxy.vm.userdata", ConfigKey.CATEGORY_ADVANCED, "", "UUID for user data for console proxy VMs. This works only when systemvm.userdata.enabled is set to true", diff --git a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java index 4c062b1eaff1..d1ce668e68ec 100644 --- a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -2130,7 +2130,7 @@ public static String logDeploymentWithoutException(VirtualMachine vm, Deployment } @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {allowRouterOnDisabledResource, allowAdminVmOnDisabledResource}; + return new ConfigKey[] {allowRouterOnDisabledResource, allowAdminVmOnDisabledResource, HostReservationReleasePeriod, VmDeploymentPlanner}; } @Override diff --git a/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java b/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java index 3aab852ba7fc..ae58b99b5467 100644 --- a/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java @@ -694,6 +694,7 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {ClusterCPUCapacityDisableThreshold, ClusterMemoryCapacityDisableThreshold, ClusterThresholdEnabled, VmAllocationAlgorithm}; + return new ConfigKey[] {ClusterCPUCapacityDisableThreshold, ClusterMemoryCapacityDisableThreshold, ClusterThresholdEnabled, VmAllocationAlgorithm, + ApplyAllocationAlgorithmToPods, HostCapacityTypeToOrderClusters, VmUserDispersionWeight, ImplicitHostTags}; } } diff --git a/server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java index 07d51c5deb30..da2d8fe7d9a5 100644 --- a/server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -1430,7 +1430,7 @@ public String getConfigComponentName() { public ConfigKey[] getConfigKeys() { return new ConfigKey[] {TimeBetweenCleanup, MigrationMaxRetries, TimeToSleep, TimeBetweenFailures, StopRetryInterval, RestartRetryInterval, MigrateRetryInterval, InvestigateRetryInterval, - HAWorkers, ForceHA, VmHaEnabled, VmHaAlertsEnabled, KvmHAFenceHostIfHeartbeatFailsOnStorage}; + HAWorkers, ForceHA, VmHaEnabled, VmHaAlertsEnabled, KvmHAFenceHostIfHeartbeatFailsOnStorage, HaTag}; } @Override diff --git a/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManager.java b/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManager.java index dcf33e417a63..b8a62df173b6 100644 --- a/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManager.java +++ b/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManager.java @@ -18,6 +18,7 @@ import java.util.List; +import org.apache.cloudstack.framework.config.ConfigKey; import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.host.Host; @@ -34,6 +35,9 @@ public interface ExternalFirewallDeviceManager extends Manager { + ConfigKey DefaultExternalFirewallCapacity = new ConfigKey<>("Advanced", Integer.class, "external.firewall.default.capacity", "50", + "default number of networks permitted per external load firewall device", true); + /** * adds a firewall device in to a physical network * @param physicalNetworkId physical network id of the network in to which device to be added diff --git a/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManagerImpl.java index ca108749f012..34f724c702af 100644 --- a/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManagerImpl.java +++ b/server/src/main/java/com/cloud/network/ExternalFirewallDeviceManagerImpl.java @@ -28,6 +28,8 @@ import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.response.ExternalFirewallResponse; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice; @@ -116,7 +118,7 @@ import com.cloud.vm.dao.DomainRouterDao; import com.cloud.vm.dao.NicDao; -public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase implements ExternalFirewallDeviceManager, ResourceStateAdapter { +public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase implements ExternalFirewallDeviceManager, ResourceStateAdapter, Configurable { @Inject HostDao _hostDao; @@ -835,4 +837,14 @@ public boolean applyPortForwardingRules(Network network, List[] getConfigKeys() { + return new ConfigKey[] {DefaultExternalFirewallCapacity}; + } } diff --git a/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManager.java b/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManager.java index 850d0d7cb036..327857d7b9fa 100644 --- a/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManager.java +++ b/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManager.java @@ -18,6 +18,8 @@ import java.util.List; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.agent.api.to.LoadBalancerTO; import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.ResourceUnavailableException; @@ -36,6 +38,9 @@ public interface ExternalLoadBalancerDeviceManager extends Manager { public static final int DEFAULT_LOAD_BALANCER_CAPACITY = 50; + ConfigKey DefaultExternalLoadBalancerCapacity = new ConfigKey<>("Advanced", Integer.class, "external.lb.default.capacity", "50", + "default number of networks permitted per external load balancer device", true); + /** * adds a load balancer device in to a physical network * @param physicalNetworkId physical network id of the network in to which device to be added diff --git a/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java index f5031dc56675..280e77dc25c0 100644 --- a/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java +++ b/server/src/main/java/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java @@ -31,6 +31,8 @@ import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.response.ExternalLoadBalancerResponse; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice; @@ -138,7 +140,7 @@ import com.cloud.vm.dao.NicDao; import com.cloud.vm.dao.VMInstanceDao; -public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase implements ExternalLoadBalancerDeviceManager, ResourceStateAdapter { +public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase implements ExternalLoadBalancerDeviceManager, ResourceStateAdapter, Configurable { @Inject NetworkExternalLoadBalancerDao _networkExternalLBDao; @@ -1303,4 +1305,14 @@ private NicVO getPlaceholderNic(Network network) { return null; } + @Override + public String getConfigComponentName() { + return ExternalLoadBalancerDeviceManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {DefaultExternalLoadBalancerCapacity}; + } + } diff --git a/server/src/main/java/com/cloud/network/NetworkModelImpl.java b/server/src/main/java/com/cloud/network/NetworkModelImpl.java index c5442ec38cf1..79a0a1112f84 100644 --- a/server/src/main/java/com/cloud/network/NetworkModelImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkModelImpl.java @@ -3012,7 +3012,8 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {MACIdentifier, AdminIsAllowedToDeployAnywhere}; + return new ConfigKey[] {MACIdentifier, AdminIsAllowedToDeployAnywhere, SecurityGroupDefaultAdding, CloudIdentifier, + SubDomainNetworkAccess, ExecuteInSequenceNetworkElementCommands, ExternalNetworkStatsInterval, NetworkIPv6SearchRetryMax}; } @Override diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java index 2853fa96330d..4f69125575e1 100644 --- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java @@ -6313,7 +6313,9 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {AllowDuplicateNetworkName, AllowEmptyStartEndIpAddress, AllowUsersToMakeNetworksRedundant, VRPrivateInterfaceMtu, VRPublicInterfaceMtu, AllowUsersToSpecifyVRMtu}; + return new ConfigKey[] {AllowDuplicateNetworkName, AllowEmptyStartEndIpAddress, AllowUsersToMakeNetworksRedundant, VRPrivateInterfaceMtu, VRPublicInterfaceMtu, AllowUsersToSpecifyVRMtu, + GuestVlanBits, MaxNumberOfSecondaryIPsPerNIC, XenServerPublicNetwork, XenServerGuestNetwork, XenServerStorageNetwork1, XenServerStorageNetwork2, XenServerPrivateNetwork, + NetworkGuestCidrLimit}; } public boolean isDefaultAcl(Long aclId) { diff --git a/server/src/main/java/com/cloud/network/NetworkUsageManagerImpl.java b/server/src/main/java/com/cloud/network/NetworkUsageManagerImpl.java index 0aee5f234969..ac1133c734af 100644 --- a/server/src/main/java/com/cloud/network/NetworkUsageManagerImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkUsageManagerImpl.java @@ -33,6 +33,8 @@ import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import com.cloud.agent.AgentManager; @@ -91,7 +93,7 @@ import com.cloud.utils.net.MacAddress; @Component -public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsageService, NetworkUsageManager, ResourceStateAdapter { +public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsageService, NetworkUsageManager, ResourceStateAdapter, Configurable { public enum NetworkUsageResourceName { TrafficSentinel; } @@ -562,4 +564,14 @@ public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForc } + @Override + public String getConfigComponentName() { + return NetworkUsageService.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {DirectNetworkStatsInterval, TrafficSentinelIncludeZones, TrafficSentinelExcludeZones}; + } + } diff --git a/server/src/main/java/com/cloud/network/lb/LBHealthCheckManager.java b/server/src/main/java/com/cloud/network/lb/LBHealthCheckManager.java index 315184d580dc..1032701375cc 100644 --- a/server/src/main/java/com/cloud/network/lb/LBHealthCheckManager.java +++ b/server/src/main/java/com/cloud/network/lb/LBHealthCheckManager.java @@ -16,10 +16,15 @@ // under the License. package com.cloud.network.lb; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.network.rules.LoadBalancerContainer.Scheme; public interface LBHealthCheckManager { + ConfigKey LBHealthCheck = new ConfigKey<>("Advanced", String.class, "healthcheck.update.interval", "600", + "Time Interval to fetch the LB health check states (in sec)", true); + void updateLBHealthCheck(Scheme scheme); } diff --git a/server/src/main/java/com/cloud/network/lb/LBHealthCheckManagerImpl.java b/server/src/main/java/com/cloud/network/lb/LBHealthCheckManagerImpl.java index b9d687e66b41..3568c53f4960 100644 --- a/server/src/main/java/com/cloud/network/lb/LBHealthCheckManagerImpl.java +++ b/server/src/main/java/com/cloud/network/lb/LBHealthCheckManagerImpl.java @@ -28,6 +28,8 @@ import org.springframework.stereotype.Component; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; @@ -40,7 +42,7 @@ import com.cloud.utils.concurrency.NamedThreadFactory; @Component -public class LBHealthCheckManagerImpl extends ManagerBase implements LBHealthCheckManager, Manager { +public class LBHealthCheckManagerImpl extends ManagerBase implements LBHealthCheckManager, Manager, Configurable { @Inject ConfigurationDao _configDao; @@ -106,4 +108,14 @@ public void updateLBHealthCheck(Scheme scheme) { logger.debug("LB HealthCheck Manager is running and getting the updates from LB providers and updating service status"); } + @Override + public String getConfigComponentName() { + return LBHealthCheckManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {LBHealthCheck}; + } + } diff --git a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManager.java b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManager.java index 8ef77d3fb32f..ecd924c8347a 100644 --- a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManager.java +++ b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManager.java @@ -64,6 +64,9 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA ConfigKey RouterTemplateOvm3 = new ConfigKey<>(String.class, RouterTemplateOvm3CK, "Advanced", "SystemVM Template (Ovm3)", "Name of the default router template on Ovm3.", true, ConfigKey.Scope.Zone, null); + ConfigKey RouterRamSize = new ConfigKey<>("Hidden", Integer.class, "router.ram.size", "512", + "Default RAM for router VM (in MB).", true); + ConfigKey VirtualRouterUserData = new ConfigKey<>(String.class, "virtual.router.userdata", ConfigKey.CATEGORY_ADVANCED, "", "UUID for user data of VR, VPC VR, internal LB, and elastic LB. This works only when systemvm.userdata.enabled is set to true", @@ -73,6 +76,12 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA ConfigKey SetServiceMonitor = new ConfigKey<>(Boolean.class, SetServiceMonitorCK, "Advanced", "true", "service monitoring in router enable/disable option, default true", true, ConfigKey.Scope.Zone, null); + ConfigKey NetworkRouterRpFilter = new ConfigKey<>("Network", Boolean.class, "network.disable.rpfilter", "true", + "disable rp_filter on Domain Router VM public interfaces.", true); + + ConfigKey EnableServiceMonitoring = new ConfigKey<>("Network", Boolean.class, "network.router.enableserviceMonitoring", "false", + "service monitoring in router enable/disable option, default false", true); + ConfigKey RouterAlertsCheckInterval = new ConfigKey<>(Integer.class, RouterAlertsCheckIntervalCK, "Advanced", "1800", "Interval (in seconds) to check for alerts in Virtual Router.", false, ConfigKey.Scope.Global, null); ConfigKey RouterVersionCheckEnabled = new ConfigKey<>("Advanced", Boolean.class, "router.version.check", "true", @@ -131,12 +140,40 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA ConfigKey RemoveControlIpOnStop = new ConfigKey<>(Boolean.class, RemoveControlIpOnStopCK, "Advanced", "true", "on stopping routers and system VMs the IP will be released to preserve IPv4 space.", true, ConfigKey.Scope.Zone, null); + ConfigKey RouterStatsInterval = new ConfigKey<>("Advanced", Integer.class, "router.stats.interval", "300", + "Interval (in seconds) to report router statistics.", true); + + ConfigKey RouterCheckInterval = new ConfigKey<>("Advanced", Integer.class, "router.check.interval", "30", + "Interval (in seconds) to report redundant router status.", true); + + ConfigKey RouterCheckPoolSize = new ConfigKey<>("Advanced", Integer.class, "router.check.poolsize", "10", + "Numbers of threads using to check redundant router status.", true); + + ConfigKey RouterExtraPublicNics = new ConfigKey<>("Advanced", Integer.class, "router.extra.public.nics", "2", + "specify extra public nics used for virtual router(up to 5)", true); + + ConfigKey DnsBasicZoneUpdates = new ConfigKey<>("Advanced", String.class, "network.dns.basiczone.updates", "all", + "This parameter can take 2 values: all (default) and pod. It defines if DHCP/DNS requests have to be send to all dhcp servers in cloudstack, or only to the one in the same pod", + true, ConfigKey.Kind.Select, "all,pod"); + + ConfigKey RedundantRouterVrrpInterval = new ConfigKey<>("Advanced", Integer.class, "router.redundant.vrrp.interval", "1", + "seconds between VRRP broadcast. It would 3 times broadcast fail to trigger fail-over mechanism of redundant router", true); + + ConfigKey DirectAttachNetworkEnabled = new ConfigKey<>("Advanced", Boolean.class, "direct.attach.network.externalIpAllocator.enabled", "false", + "Direct-attach VMs using external DHCP server", true); + + ConfigKey DirectAttachNetworkExternalAPIURL = new ConfigKey<>("Advanced", String.class, "direct.attach.network.externalIpAllocator.url", null, + "Direct-attach VMs using external DHCP server (API url)", true); + int DEFAULT_ROUTER_VM_RAMSIZE = 256; // 256M int DEFAULT_ROUTER_CPU_MHZ = 500; // 500 MHz boolean USE_POD_VLAN = false; int DEFAULT_PRIORITY = 100; int DEFAULT_DELTA = 2; + ConfigKey RouterCpuMHz = new ConfigKey<>("Advanced", Integer.class, "router.cpu.mhz", String.valueOf(DEFAULT_ROUTER_CPU_MHZ), + "Default CPU speed (MHz) for router VM.", true); + boolean startRemoteAccessVpn(Network network, RemoteAccessVpn vpn, List routers) throws ResourceUnavailableException; diff --git a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index fe167b7e7e76..de793b5e6106 100644 --- a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -3393,7 +3393,19 @@ public ConfigKey[] getConfigKeys() { ExposeDnsAndBootpServer, RouterLogrotateFrequency, RemoveControlIpOnStop, - VirtualRouterUserData + VirtualRouterUserData, + NetworkRouterRpFilter, + EnableServiceMonitoring, + RouterRamSize, + RouterCpuMHz, + RouterStatsInterval, + RouterCheckInterval, + RouterCheckPoolSize, + RouterExtraPublicNics, + DnsBasicZoneUpdates, + RedundantRouterVrrpInterval, + DirectAttachNetworkEnabled, + DirectAttachNetworkExternalAPIURL }; } diff --git a/server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl.java index df8cb79f8723..72ca64b41099 100644 --- a/server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl.java +++ b/server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl.java @@ -48,6 +48,8 @@ import org.apache.cloudstack.api.command.user.securitygroup.UpdateSecurityGroupCmd; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.PublishScope; @@ -124,7 +126,7 @@ import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.VMInstanceDao; -public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGroupManager, SecurityGroupService, StateListener { +public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGroupManager, SecurityGroupService, StateListener, Configurable { @Inject SecurityGroupDao _securityGroupDao; @@ -1488,4 +1490,14 @@ public boolean securityGroupRulesForVmSecIp(long nicId, String secondaryIp, bool return true; } + + @Override + public String getConfigComponentName() { + return SecurityGroupManager.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {SecurityGroupWorkCleanupInterval, SecurityGroupWorkerThreads, SecurityGroupWorkGlobalLockTimeout, SecurityGroupWorkPerAgentMaxQueueSize}; + } } diff --git a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java index 1f5fe7382fc5..22f147353b4b 100644 --- a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java @@ -3723,7 +3723,9 @@ public String getConfigComponentName() { public ConfigKey[] getConfigKeys() { return new ConfigKey[]{ VpcTierNamePrepend, - VpcTierNamePrependDelimiter + VpcTierNamePrependDelimiter, + VpcCleanupInterval, + VpcMaxNetworks }; } diff --git a/server/src/main/java/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/main/java/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java index 8adb33f2550c..59da95e91ac9 100644 --- a/server/src/main/java/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java +++ b/server/src/main/java/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java @@ -865,7 +865,7 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {RemoteAccessVpnClientIpRange}; + return new ConfigKey[] {RemoteAccessVpnClientIpRange, RemoteAccessVpnPskLength, RemoteAccessVpnUserLimit}; } public List getVpnServiceProviders() { diff --git a/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManager.java b/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManager.java index 9cf604f85070..3dc47d68aa99 100644 --- a/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManager.java +++ b/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManager.java @@ -19,11 +19,22 @@ import java.util.List; import java.util.Set; +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.network.Site2SiteCustomerGateway; import com.cloud.network.dao.Site2SiteVpnConnectionVO; import com.cloud.vm.DomainRouterVO; public interface Site2SiteVpnManager extends Site2SiteVpnService { + + ConfigKey Site2SiteVpnConnectionPerVpnGatewayLimit = new ConfigKey<>("Network", Integer.class, + "site2site.vpn.vpngateway.connection.limit", "4", + "The maximum number of VPN connection per VPN gateway", true); + + ConfigKey Site2SiteVpnSubnetsPerCustomerGatewayLimit = new ConfigKey<>("Network", Integer.class, + "site2site.vpn.customergateway.subnets.limit", "10", + "The maximum number of subnets per customer gateway", true); + Set getExcludedVpnGatewayParameters(Site2SiteCustomerGateway customerGw); Set getObsoleteVpnGatewayParameters(Site2SiteCustomerGateway customerGw); diff --git a/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java index 666255b7b432..5d3211d9fb6c 100644 --- a/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java +++ b/server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java @@ -1187,7 +1187,7 @@ public ConfigKey[] getConfigKeys() { return new ConfigKey[] { VpnCustomerGatewayExcludedEncryptionAlgorithms, VpnCustomerGatewayExcludedHashingAlgorithms, VpnCustomerGatewayExcludedIkeVersions, VpnCustomerGatewayExcludedDhGroup, VpnCustomerGatewayObsoleteEncryptionAlgorithms, VpnCustomerGatewayObsoleteHashingAlgorithms, VpnCustomerGatewayObsoleteIkeVersions, VpnCustomerGatewayObsoleteDhGroup, - VpnCustomerGatewayObsoleteCheckInterval}; + VpnCustomerGatewayObsoleteCheckInterval, Site2SiteVpnConnectionPerVpnGatewayLimit, Site2SiteVpnSubnetsPerCustomerGatewayLimit}; } protected class CheckVpnCustomerGatewayObsoleteParametersTask extends ManagedContextRunnable { diff --git a/server/src/main/java/com/cloud/projects/ProjectManager.java b/server/src/main/java/com/cloud/projects/ProjectManager.java index 17a443befaec..c0a714e8dd3b 100644 --- a/server/src/main/java/com/cloud/projects/ProjectManager.java +++ b/server/src/main/java/com/cloud/projects/ProjectManager.java @@ -32,6 +32,38 @@ public interface ProjectManager extends ProjectService { public static final ConfigKey ProjectSmtpUseAuth = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Boolean.class, "project.smtp.useAuth", "false", "If true, use SMTP authentication when sending emails", false, ConfigKey.Scope.ManagementServer); + ConfigKey ProjectInviteRequired = new ConfigKey<>("Project Defaults", Boolean.class, + "project.invite.required", "false", + "If invitation confirmation is required when add account to project. Default value is false", true); + + ConfigKey ProjectInvitationExpirationTime = new ConfigKey<>("Project Defaults", Long.class, + "project.invite.timeout", "86400", + "Invitation expiration time (in seconds). Default is 1 day - 86400 seconds", true); + + ConfigKey AllowUserToCreateProject = new ConfigKey<>("Project Defaults", Boolean.class, + "allow.user.create.projects", "true", + "If regular user can create a project; true by default", true); + + ConfigKey ProjectEmailSender = new ConfigKey<>("Project Defaults", String.class, + "project.email.sender", null, + "Sender of project invitation email (will be in the From header of the email)", true); + + ConfigKey ProjectSMTPHost = new ConfigKey<>("Project Defaults", String.class, + "project.smtp.host", null, + "SMTP hostname used for sending out email project invitations", true); + + ConfigKey ProjectSMTPPort = new ConfigKey<>("Project Defaults", Integer.class, + "project.smtp.port", "465", + "Port the SMTP server is listening on", true); + + ConfigKey ProjectSMTPUsername = new ConfigKey<>("Project Defaults", String.class, + "project.smtp.username", null, + "Username for SMTP authentication (applies only if project.smtp.useAuth is true)", true); + + ConfigKey ProjectSMTPPassword = new ConfigKey<>("Secure", String.class, + "project.smtp.password", null, + "Password for SMTP authentication (applies only if project.smtp.useAuth is true)", true); + boolean canAccessProjectAccount(Account caller, long accountId); boolean canModifyProjectAccount(Account caller, long accountId); diff --git a/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java b/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java index 9ba5402443ef..fe9a919acb62 100644 --- a/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java +++ b/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java @@ -1497,7 +1497,9 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {ProjectSmtpEnabledSecurityProtocols, ProjectSmtpUseStartTLS, ProjectSmtpUseAuth}; + return new ConfigKey[] {ProjectSmtpEnabledSecurityProtocols, ProjectSmtpUseStartTLS, ProjectSmtpUseAuth, + ProjectInviteRequired, ProjectInvitationExpirationTime, AllowUserToCreateProject, ProjectEmailSender, + ProjectSMTPHost, ProjectSMTPPort, ProjectSMTPUsername, ProjectSMTPPassword}; } protected void updateProjectNameAndDisplayText(final ProjectVO project, String name, String displayText) { diff --git a/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java index a902915b93c6..385d2b30a501 100644 --- a/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java +++ b/server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java @@ -2410,7 +2410,38 @@ public ConfigKey[] getConfigKeys() { DefaultMaxDomainProjects, DefaultMaxAccountGpus, DefaultMaxDomainGpus, - DefaultMaxProjectGpus + DefaultMaxProjectGpus, + DefaultMaxAccountUserVms, + DefaultMaxAccountPublicIPs, + DefaultMaxAccountTemplates, + DefaultMaxAccountSnapshots, + DefaultMaxAccountVolumes, + DefaultMaxAccountNetworks, + DefaultMaxAccountVpcs, + DefaultMaxAccountCpus, + DefaultMaxAccountMemory, + DefaultMaxAccountPrimaryStorage, + DefaultMaxDomainUserVms, + DefaultMaxDomainPublicIPs, + DefaultMaxDomainTemplates, + DefaultMaxDomainSnapshots, + DefaultMaxDomainVolumes, + DefaultMaxDomainNetworks, + DefaultMaxDomainVpcs, + DefaultMaxDomainCpus, + DefaultMaxDomainMemory, + DefaultMaxDomainPrimaryStorage, + DefaultMaxDomainSecondaryStorage, + DefaultMaxProjectUserVms, + DefaultMaxProjectPublicIPs, + DefaultMaxProjectTemplates, + DefaultMaxProjectSnapshots, + DefaultMaxProjectVolumes, + DefaultMaxProjectNetworks, + DefaultMaxProjectVpcs, + DefaultMaxProjectCpus, + DefaultMaxProjectMemory, + DefaultMaxProjectPrimaryStorage }; } diff --git a/server/src/main/java/com/cloud/server/ManagementServer.java b/server/src/main/java/com/cloud/server/ManagementServer.java index 3932006c2924..3b3a27af5d6e 100644 --- a/server/src/main/java/com/cloud/server/ManagementServer.java +++ b/server/src/main/java/com/cloud/server/ManagementServer.java @@ -16,7 +16,12 @@ // under the License. package com.cloud.server; +import java.util.UUID; + +import org.apache.cloudstack.framework.config.ConfigKey; + import com.cloud.agent.api.Answer; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.host.DetailVO; import com.cloud.host.Host; import com.cloud.host.HostVO; @@ -31,6 +36,187 @@ */ public interface ManagementServer extends ManagementService, PluggableService { + ConfigKey customCsIdentifier = new ConfigKey<>("Advanced", String.class, "custom.cs.identifier", + UUID.randomUUID().toString().split("-")[0].substring(4), "Custom identifier for the cloudstack installation", true, ConfigKey.Scope.Global); + + ConfigKey exposeCloudStackVersionInApiXmlResponse = new ConfigKey<>("Advanced", Boolean.class, "expose.cloudstack.version.api.xml.response", "true", + "Indicates whether ACS version should appear in the root element of an API XML response.", true, ConfigKey.Scope.Global); + + ConfigKey ElasticLoadBalancerEnabled = new ConfigKey<>("Advanced", String.class, "network.loadbalancer.basiczone.elb.enabled", "false", + "Whether the load balancing service is enabled for basic zones", true); + + ConfigKey ElasticLoadBalancerNetwork = new ConfigKey<>("Advanced", String.class, "network.loadbalancer.basiczone.elb.network", "guest", + "Whether the elastic load balancing service public ips are taken from the public or guest network", true); + + ConfigKey ApiLimitEnabled = new ConfigKey<>("Advanced", Boolean.class, "api.throttling.enabled", "false", "Enable/disable Api rate limit", true); + + ConfigKey ApiLimitInterval = new ConfigKey<>("Advanced", Integer.class, "api.throttling.interval", "1", "Time interval (in seconds) to reset API count", true); + + ConfigKey ApiLimitMax = new ConfigKey<>("Advanced", Integer.class, "api.throttling.max", "25", "Max allowed number of APIs within fixed interval", true); + + ConfigKey OvmPublicNetwork = new ConfigKey<>("Hidden", String.class, + "ovm.public.network.device", null, + "Specify the public bridge on host for public network", true); + + ConfigKey OvmPrivateNetwork = new ConfigKey<>("Hidden", String.class, + "ovm.private.network.device", null, + "Specify the private bridge on host for private network", true); + + ConfigKey OvmGuestNetwork = new ConfigKey<>("Hidden", String.class, + "ovm.guest.network.device", null, + "Specify the private bridge on host for private network", true); + + ConfigKey Ovm3PublicNetwork = new ConfigKey<>("Hidden", String.class, + "ovm3.public.network.device", null, + "Specify the public bridge on host for public network", true); + + ConfigKey Ovm3PrivateNetwork = new ConfigKey<>("Hidden", String.class, + "ovm3.private.network.device", null, + "Specify the private bridge on host for private network", true); + + ConfigKey Ovm3GuestNetwork = new ConfigKey<>("Hidden", String.class, + "ovm3.guest.network.device", null, + "Specify the guest bridge on host for guest network", true); + + ConfigKey Ovm3StorageNetwork = new ConfigKey<>("Hidden", String.class, + "ovm3.storage.network.device", null, + "Specify the storage bridge on host for storage network", true); + + ConfigKey KvmPublicNetwork = new ConfigKey<>("Hidden", String.class, + "kvm.public.network.device", null, + "Specify the public bridge on host for public network", true); + + ConfigKey KvmPrivateNetwork = new ConfigKey<>("Hidden", String.class, + "kvm.private.network.device", null, + "Specify the private bridge on host for private network", true); + + ConfigKey KvmGuestNetwork = new ConfigKey<>("Hidden", String.class, + "kvm.guest.network.device", null, + "Specify the private bridge on host for private network", true); + + ConfigKey PublishActionEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.action.events", "true", + "enable or disable publishing of action events on the event bus", true); + + ConfigKey PublishAlertEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.alert.events", "true", + "enable or disable publishing of alert events on the event bus", true); + + ConfigKey PublishResourceStateEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.resource.state.events", "true", + "enable or disable publishing of alert events on the event bus", true); + + ConfigKey PublishUsageEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.usage.events", "true", + "enable or disable publishing of usage events on the event bus", true); + + ConfigKey EventPurgeInterval = new ConfigKey<>("Advanced", Integer.class, "event.purge.interval", "86400", + "The interval (in seconds) to wait before running the event purge thread", true); + + ConfigKey LinkLocalIpNums = new ConfigKey<>("Advanced", Integer.class, "linkLocalIp.nums", "10", + "The number of link local ip that needed by domR(in power of 2)", true); + + ConfigKey DefaultPageSize = new ConfigKey<>("Advanced", Long.class, "default.page.size", "500", + "Default page size for API list* commands", true); + + ConfigKey CheckPodCIDRs = new ConfigKey<>("Advanced", Boolean.class, "check.pod.cidrs", "true", + "If true, different pods must belong to different CIDR subnets.", true); + + ConfigKey MulticastThrottlingRate = new ConfigKey<>("Advanced", Integer.class, "multicast.throttling.rate", "10", + "Default multicast rate in megabits per second allowed.", true); + + ConfigKey DeveloperMode = new ConfigKey<>("Advanced", Boolean.class, "developer", "false", + "Whether the management server is running in developer mode.", false); + + ConfigKey SshPublicKey = new ConfigKey<>("Hidden", String.class, "ssh.publickey", null, + "Public key for the entire CloudStack, generated once and stored on first management server start.", false); + + ConfigKey SshPrivateKey = new ConfigKey<>("Hidden", String.class, "ssh.privatekey", null, + "Private key for the entire CloudStack, generated once and stored on first management server start.", false); + + ConfigKey SystemVMPassword = new ConfigKey<>("Secure", String.class, "system.vm.password", null, + "Randomly generated password for system vm, set once and stored on first management server start.", false); + + ConfigKey HypervisorList = new ConfigKey<>("Advanced", String.class, "hypervisor.list", + HypervisorType.KVM + "," + HypervisorType.VMware + "," + HypervisorType.XenServer + "," + HypervisorType.Hyperv + "," + + HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3 + "," + HypervisorType.External, + "The list of hypervisors that this deployment will use.", true, ConfigKey.Kind.CSV, null); + + ConfigKey ManagementNetwork = new ConfigKey<>("Advanced", String.class, "management.network.cidr", null, + "The cidr of management server network", true); + + ConfigKey EventPurgeDelay = new ConfigKey<>("Advanced", Integer.class, "event.purge.delay", "15", + "Events older than specified number days will be purged. Set this value to 0 to never delete events", true); + + ConfigKey AlertPurgeInterval = new ConfigKey<>("Advanced", Integer.class, "alert.purge.interval", "86400", + "The interval (in seconds) to wait before running the alert purge thread", true); + + ConfigKey AlertPurgeDelay = new ConfigKey<>("Advanced", Integer.class, "alert.purge.delay", "0", + "Alerts older than specified number days will be purged. Set this value to 0 to never delete alerts", true); + + ConfigKey ControlCidr = new ConfigKey<>("Advanced", String.class, "control.cidr", "169.254.0.0/16", //NOSONAR: RFC 3927 link-local block, not a real/routable address + "Changes the cidr for the control network traffic. Defaults to using link local. Must be unique within pods", true); + + ConfigKey ControlGateway = new ConfigKey<>("Advanced", String.class, "control.gateway", "169.254.0.1", //NOSONAR: RFC 3927 link-local block, not a real/routable address + "gateway for the control network traffic", true); + + ConfigKey DetailBatchQuerySize = new ConfigKey<>("Advanced", Integer.class, "detail.batch.query.size", "2000", + "Default entity detail batch query size for listing", true); + + ConfigKey S3EnableRRS = new ConfigKey<>("Advanced", Boolean.class, "s3.rrs.enabled", "false", + "enable s3 reduced redundancy storage", true); + + ConfigKey S3MaxSingleUploadSize = new ConfigKey<>("Advanced", Integer.class, "s3.singleupload.max.size", "5", + "The maximum size limit for S3 single part upload API(in GB). If it is set to 0, then it means always use multi-part upload to upload object to S3. " + + "If it is set to -1, then it means always use single-part upload to upload object to S3. ", true); + + ConfigKey CloudDnsName = new ConfigKey<>("Advanced", String.class, "cloud.dns.name", null, + "DNS name of the cloud for the GSLB service", true); + + ConfigKey InternalLbVmServiceOfferingId = new ConfigKey<>("Advanced", String.class, "internallbvm.service.offering", null, + "Uuid of the service offering used by internal lb vm; if NULL - default system internal lb offering will be used", true); + + ConfigKey RouterAggregationCommandEachTimeout = new ConfigKey<>("Advanced", Integer.class, "router.aggregation.command.each.timeout", "600", + "timeout in seconds for each Virtual Router command being aggregated. The final aggregation command timeout would be determined by this timeout * commands counts ", true); + + ConfigKey VmwareRootDiskControllerType = new ConfigKey<>("Advanced", String.class, "vmware.root.disk.controller", "ide", + "Specify the default disk controller for root volumes, valid values are scsi, ide, osdefault. Please check documentation for more details on each of these values.", + true, ConfigKey.Kind.Select, "scsi,ide,osdefault"); + + ConfigKey VmwareSystemVmNicDeviceType = new ConfigKey<>("Advanced", String.class, "vmware.systemvm.nic.device.type", "E1000", + "Specify the default network device type for system VMs, valid values are E1000, PCNet32, Vmxnet2, Vmxnet3", + true, ConfigKey.Kind.Select, "E1000,PCNet32,Vmxnet2,Vmxnet3"); + + ConfigKey VmwareUseNexusVSwitch = new ConfigKey<>("Network", Boolean.class, "vmware.use.nexus.vswitch", "false", + "Enable/Disable Cisco Nexus 1000v vSwitch in VMware environment", true); + + ConfigKey VmwareUseDVSwitch = new ConfigKey<>("Network", Boolean.class, "vmware.use.dvswitch", "false", + "Enable/Disable Nexus/Vmware dvSwitch in VMware environment", true); + + ConfigKey XenServerSetupMultipath = new ConfigKey<>("Advanced", String.class, "xenserver.setup.multipath", "false", + "Setup the host to do multipath", true); + + ConfigKey XenServerHeartBeatTimeout = new ConfigKey<>("Advanced", Integer.class, "xenserver.heartbeat.timeout", "120", + "heartbeat timeout to use when implementing XenServer Self Fencing", true); + + ConfigKey XenServerHeartBeatInterval = new ConfigKey<>("Advanced", Integer.class, "xenserver.heartbeat.interval", "60", + "heartbeat interval to use when checking before XenServer Self Fencing", true); + + ConfigKey XenServerPVdriverVersion = new ConfigKey<>("Advanced", String.class, "xenserver.pvdriver.version", "xenserver61", + "default Xen PV driver version for registered template, valid value:xenserver56,xenserver61 ", + true, ConfigKey.Kind.Select, "xenserver56,xenserver61"); + + ConfigKey Ovm3HeartBeatTimeout = new ConfigKey<>("Advanced", Integer.class, "ovm3.heartbeat.timeout", "120", + "timeout used for primary storage check, upon timeout a panic is triggered.", true); + + ConfigKey Ovm3HeartBeatInterval = new ConfigKey<>("Advanced", Integer.class, "ovm3.heartbeat.interval", "1", + "interval used to check primary storage availability.", true); + + ConfigKey BaremetalProvisionDoneNotificationEnabled = new ConfigKey<>("Advanced", Boolean.class, "baremetal.provision.done.notification.enabled", "true", + "whether to enable baremetal provison done notification", true); + + ConfigKey BaremetalProvisionDoneNotificationPort = new ConfigKey<>("Advanced", Integer.class, "baremetal.provision.done.notification.port", "8080", + "the port that listens baremetal provision done notification. Should be the same to port management server listening on for now. Please change it to management server port if it's not default 8080", true); + + ConfigKey ExternalBaremetalSystemUrl = new ConfigKey<>("Advanced", String.class, "external.baremetal.system.url", null, + "url of external baremetal system that CloudStack will talk to", true); + /** * returns the instance id of this management server. * diff --git a/server/src/main/java/com/cloud/server/ManagementServerImpl.java b/server/src/main/java/com/cloud/server/ManagementServerImpl.java index e48cf112806a..5f9a3f0dd26d 100644 --- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java +++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java @@ -31,7 +31,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.UUID; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -893,8 +892,6 @@ public class ManagementServerImpl extends MutualExclusiveIdsManagerBase implemen static final ConfigKey vmPasswordLength = new ConfigKey<>("Advanced", Integer.class, "vm.password.length", "6", "Specifies the length of a randomly generated password", false); static final ConfigKey sshKeyLength = new ConfigKey<>("Advanced", Integer.class, "ssh.key.length", "2048", "Specifies custom SSH key length (bit)", true, ConfigKey.Scope.Global); static final ConfigKey humanReadableSizes = new ConfigKey<>("Advanced", Boolean.class, "display.human.readable.sizes", "true", "Enables outputting human readable byte sizes to logs and usage records.", false, ConfigKey.Scope.Global); - public static final ConfigKey customCsIdentifier = new ConfigKey<>("Advanced", String.class, "custom.cs.identifier", UUID.randomUUID().toString().split("-")[0].substring(4), "Custom identifier for the cloudstack installation", true, ConfigKey.Scope.Global); - public static final ConfigKey exposeCloudStackVersionInApiXmlResponse = new ConfigKey<>("Advanced", Boolean.class, "expose.cloudstack.version.api.xml.response", "true", "Indicates whether ACS version should appear in the root element of an API XML response.", true, ConfigKey.Scope.Global); public static final ConfigKey exposeCloudStackVersionInApiListCapabilities = new ConfigKey<>("Advanced", Boolean.class, "expose.cloudstack.version.api.list.capabilities", "true", "Indicates whether ACS version should show in the listCapabilities API.", true, ConfigKey.Scope.Global); private static final VirtualMachine.Type []systemVmTypes = { VirtualMachine.Type.SecondaryStorageVm, VirtualMachine.Type.ConsoleProxy}; @@ -4449,7 +4446,18 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {exposeCloudStackVersionInApiXmlResponse, exposeCloudStackVersionInApiListCapabilities, vmPasswordLength, sshKeyLength, humanReadableSizes, customCsIdentifier}; + return new ConfigKey[] {exposeCloudStackVersionInApiXmlResponse, exposeCloudStackVersionInApiListCapabilities, vmPasswordLength, sshKeyLength, humanReadableSizes, customCsIdentifier, + OvmPublicNetwork, OvmPrivateNetwork, OvmGuestNetwork, Ovm3PublicNetwork, Ovm3PrivateNetwork, Ovm3GuestNetwork, Ovm3StorageNetwork, + KvmPublicNetwork, KvmPrivateNetwork, KvmGuestNetwork, ElasticLoadBalancerEnabled, ElasticLoadBalancerNetwork, + ApiLimitEnabled, ApiLimitInterval, ApiLimitMax, + PublishActionEvent, PublishAlertEvent, PublishResourceStateEvent, PublishUsageEvent, + EventPurgeInterval, LinkLocalIpNums, HypervisorList, ManagementNetwork, EventPurgeDelay, + AlertPurgeInterval, AlertPurgeDelay, ControlCidr, ControlGateway, DetailBatchQuerySize, DefaultPageSize, CheckPodCIDRs, + S3EnableRRS, S3MaxSingleUploadSize, CloudDnsName, InternalLbVmServiceOfferingId, RouterAggregationCommandEachTimeout, + VmwareRootDiskControllerType, VmwareSystemVmNicDeviceType, VmwareUseNexusVSwitch, VmwareUseDVSwitch, + XenServerSetupMultipath, XenServerHeartBeatTimeout, XenServerHeartBeatInterval, XenServerPVdriverVersion, + Ovm3HeartBeatTimeout, Ovm3HeartBeatInterval, + BaremetalProvisionDoneNotificationEnabled, BaremetalProvisionDoneNotificationPort, ExternalBaremetalSystemUrl}; } protected class EventPurgeTask extends ManagedContextRunnable { diff --git a/server/src/main/java/com/cloud/server/StatsCollector.java b/server/src/main/java/com/cloud/server/StatsCollector.java index 456792d14b75..f4ad46272f20 100644 --- a/server/src/main/java/com/cloud/server/StatsCollector.java +++ b/server/src/main/java/com/cloud/server/StatsCollector.java @@ -283,6 +283,14 @@ public String toString() { private static final ConfigKey StatsTimeout = new ConfigKey<>("Advanced", Integer.class, "stats.timeout", "60000", "The timeout for stats call in milli seconds.", true, ConfigKey.Scope.Cluster); + public static final ConfigKey StorageStatsInterval = new ConfigKey<>("Storage", Long.class, "storage.stats.interval", "60000", + "The interval (in milliseconds) when storage stats (per host) are retrieved from agents.", true); + public static final ConfigKey HostStatsInterval = new ConfigKey<>("Advanced", Integer.class, "host.stats.interval", "60000", + "The interval (in milliseconds) when host stats are retrieved from agents.", true); + public static final ConfigKey VmStatsInterval = new ConfigKey<>("Advanced", Integer.class, "vm.stats.interval", "60000", + "The interval (in milliseconds) when vm stats are retrieved from agents.", true); + public static final ConfigKey VolumeStatsInterval = new ConfigKey<>("Advanced", Integer.class, "volume.stats.interval", "60000", + "Interval (in milliseconds) to report volume statistics.", true); private static final ConfigKey statsOutputUri = new ConfigKey<>("Advanced", String.class, "stats.output.uri", "", "URI to send StatsCollector statistics to. The collector is defined on the URI scheme. Example: graphite://graphite-hostaddress:port or influxdb://influxdb-hostaddress/dbname. Note that the port is optional, if not added the default port for the respective collector (graphite or influxdb) will be used. Additionally, the database name '/dbname' is also optional; default db name is 'cloudstack'. You must create and configure the database if using influxdb.", true); @@ -2247,7 +2255,8 @@ public ConfigKey[] getConfigKeys() { vmStatsIncrementMetrics, vmStatsMaxRetentionTime, vmStatsCollectUserVMOnly, vmDiskStatsRetentionEnabled, vmDiskStatsMaxRetentionTime, MANAGEMENT_SERVER_STATUS_COLLECTION_INTERVAL, DATABASE_SERVER_STATUS_COLLECTION_INTERVAL, - DATABASE_SERVER_LOAD_HISTORY_RETENTION_NUMBER}; + DATABASE_SERVER_LOAD_HISTORY_RETENTION_NUMBER, + StorageStatsInterval, HostStatsInterval, VmStatsInterval, VolumeStatsInterval}; } public double getImageStoreCapacityThreshold() { diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java index 38ddd52d4a08..fa5079624681 100644 --- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java @@ -4654,7 +4654,12 @@ public ConfigKey[] getConfigKeys() { StoragePoolHostConnectWorkers, ObjectStorageCapacityThreshold, COPY_TEMPLATES_FROM_OTHER_SECONDARY_STORAGES, - AgentMaxDataMigrationWaitTime + AgentMaxDataMigrationWaitTime, + VmDiskThrottlingIopsReadRate, + VmDiskThrottlingIopsWriteRate, + VmDiskThrottlingBytesReadRate, + VmDiskThrottlingBytesWriteRate, + ExpungeWorkers }; } diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index 8674014addd7..2f63df4721c9 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -5786,7 +5786,11 @@ public ConfigKey[] getConfigKeys() { MatchStoragePoolTagsWithDiskOffering, UseHttpsToUpload, WaitDetachDevice, - AllowCheckAndRepairVolume + AllowCheckAndRepairVolume, + CopyVolumeWait, + CreateVolumeFromSnapshotWait, + MaxUploadVolumeSize, + StoragePoolMaxWaitSeconds }; } } diff --git a/server/src/main/java/com/cloud/storage/secondary/SecondaryStorageVmManager.java b/server/src/main/java/com/cloud/storage/secondary/SecondaryStorageVmManager.java index 599e8c171c51..d7fb02885092 100644 --- a/server/src/main/java/com/cloud/storage/secondary/SecondaryStorageVmManager.java +++ b/server/src/main/java/com/cloud/storage/secondary/SecondaryStorageVmManager.java @@ -50,9 +50,53 @@ public interface SecondaryStorageVmManager extends Manager { true, ConfigKey.Scope.Zone, null, "User Data for SSVMs", null, ConfigKey.GROUP_SYSTEM_VMS, ConfigKey.SUBGROUP_SEC_STORAGE_VM); + ConfigKey UseSecondaryStorageVm = new ConfigKey<>("Hidden", Boolean.class, "secondary.storage.vm", "false", + "Deploys a VM per zone to manage secondary storage if true, otherwise secondary storage is mounted on management server", true); + + ConfigKey MountParent = new ConfigKey<>("Advanced", String.class, "mount.parent", "/var/cloudstack/mnt", + "The mount point on the Management Server for Secondary Storage.", true); + + ConfigKey SystemVMAutoReserveCapacity = new ConfigKey<>("Advanced", Boolean.class, "system.vm.auto.reserve.capacity", "true", + "Indicates whether or not to automatically reserve system VM standby capacity.", true); + + ConfigKey SystemVMRandomPassword = new ConfigKey<>("Advanced", Boolean.class, "system.vm.random.password", "false", + "Randomize system vm password the first time management server starts", true); + + ConfigKey MaxTemplateAndIsoSize = new ConfigKey<>("Advanced", Long.class, "max.template.iso.size", "50", + "The maximum size for a downloaded template or ISO (in GB).", true); + + ConfigKey SecStorageAllowedInternalDownloadSites = new ConfigKey<>("Advanced", String.class, "secstorage.allowed.internal.sites", null, + "Comma separated list of cidrs internal to the datacenter that can host template download servers, please note 0.0.0.0 is not a valid site", true); + + ConfigKey SecStorageEncryptCopy = new ConfigKey<>("Advanced", Boolean.class, "secstorage.encrypt.copy", "false", + "Use SSL method used to encrypt copy traffic between zones. Also ensures that the certificate assigned to the zone is used when generating links for external access.", true); + + ConfigKey SecStorageSecureCopyCert = new ConfigKey<>("Advanced", String.class, "secstorage.ssl.cert.domain", "", + "SSL certificate used to encrypt copy traffic between zones", true); + + ConfigKey SecStorageCopyPassword = new ConfigKey<>("Hidden", String.class, "secstorage.copy.password", null, + "Password used to authenticate zone-to-zone template copy requests", true); + + ConfigKey ExtractURLCleanUpInterval = new ConfigKey<>("Advanced", Integer.class, "extract.url.cleanup.interval", "7200", + "The interval (in seconds) to wait before cleaning up the extract URL's ", true); + + ConfigKey DisableExtraction = new ConfigKey<>("Advanced", Boolean.class, "disable.extraction", "false", + "Flag for disabling extraction of Templates, ISOs, Snapshots and volumes", true); + + ConfigKey ExtractURLExpirationInterval = new ConfigKey<>("Advanced", Integer.class, "extract.url.expiration.interval", "14400", + "The life of an extract URL after which it is deleted ", true); + + ConfigKey SecondaryStorageServiceOffering = new ConfigKey<>("Advanced", String.class, "secstorage.service.offering", null, + "Uuid of the service offering used by secondary storage; if NULL - system offering will be used", true); public static final int DEFAULT_SS_VM_RAMSIZE = 512; // 512M public static final int DEFAULT_SS_VM_CPUMHZ = 500; // 500 MHz + + ConfigKey SecStorageVmRamSize = new ConfigKey<>("Advanced", Integer.class, "ssvm.ram.size", String.valueOf(DEFAULT_SS_VM_RAMSIZE), + "Secondary storage VM default RAM size (in MB)", true); + + ConfigKey SecStorageVmCpuMhz = new ConfigKey<>("Advanced", Integer.class, "ssvm.cpu.mhz", String.valueOf(DEFAULT_SS_VM_CPUMHZ), + "Secondary storage VM default CPU speed (in MHz)", true); public static final int DEFAULT_SS_VM_MTUSIZE = 1500; public static final int DEFAULT_SS_VM_CAPACITY = 50; // max command execution session per SSVM public static final int DEFAULT_MIGRATE_SS_VM_CAPACITY = 2; // number of concurrent migrate operations to happen per SSVM diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java index 6fcf124a961d..fe2e9bdb7199 100644 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java @@ -72,6 +72,15 @@ public interface SnapshotManager extends Configurable { "For snapshot copy to another primary storage in a different zone. This is supported only for StorPool storage for now.", true, ConfigKey.Scope.StoragePool, null); + ConfigKey BackupSnapshotWait = new ConfigKey<>("Storage", Integer.class, "backup.snapshot.wait", "21600", + "In second, timeout for BackupSnapshotCommand", true); + + ConfigKey TotalRetries = new ConfigKey<>("Storage", Integer.class, "total.retries", "4", + "The number of times each command sent to a host should be retried in case of failure.", true); + + ConfigKey SnapshotPollInterval = new ConfigKey<>("Snapshots", Integer.class, "snapshot.poll.interval", "300", + "The time interval in seconds when the management server polls for snapshots to be scheduled.", true); + void deletePoliciesForVolume(Long volumeId); /** diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 2d23e22a0152..8e39976cac24 100755 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -310,7 +310,8 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { return new ConfigKey[] {BackupRetryAttempts, BackupRetryInterval, SnapshotHourlyMax, SnapshotDailyMax, SnapshotMonthlyMax, SnapshotWeeklyMax, usageSnapshotSelection, - SnapshotInfo.BackupSnapshotAfterTakingSnapshot, VmStorageSnapshotKvm, kvmIncrementalSnapshot, snapshotDeltaMax, snapshotShowChainSize, UseStorageReplication, KVMSnapshotEnabled}; + SnapshotInfo.BackupSnapshotAfterTakingSnapshot, VmStorageSnapshotKvm, kvmIncrementalSnapshot, snapshotDeltaMax, snapshotShowChainSize, UseStorageReplication, KVMSnapshotEnabled, + BackupSnapshotWait, TotalRetries, SnapshotPollInterval}; } @Override diff --git a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java index 873afff01c87..5ed09be6e169 100755 --- a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java @@ -2763,7 +2763,9 @@ public ConfigKey[] getConfigKeys() { TemplateDeleteFromPrimaryStorage, PublicTemplateSecStorageCopy, PrivateTemplateSecStorageCopy, - VmIsoMaxCount}; + VmIsoMaxCount, + CreatePrivateTemplateFromSnapshotWait, + SSVMPSK}; } public List getTemplateAdapters() { diff --git a/server/src/main/java/com/cloud/usage/UsageServiceImpl.java b/server/src/main/java/com/cloud/usage/UsageServiceImpl.java index de8d4633d224..d0a4a0bac8ba 100644 --- a/server/src/main/java/com/cloud/usage/UsageServiceImpl.java +++ b/server/src/main/java/com/cloud/usage/UsageServiceImpl.java @@ -30,6 +30,8 @@ import org.apache.cloudstack.api.command.admin.usage.ListUsageRecordsCmd; import org.apache.cloudstack.api.command.admin.usage.RemoveRawUsageRecordsCmd; import org.apache.cloudstack.context.CallContext; +import org.apache.cloudstack.framework.config.ConfigKey; +import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.usage.Usage; import org.apache.cloudstack.usage.UsageService; @@ -85,7 +87,7 @@ import com.cloud.vm.dao.VMInstanceDao; @Component -public class UsageServiceImpl extends ManagerBase implements UsageService, Manager { +public class UsageServiceImpl extends ManagerBase implements UsageService, Manager, Configurable { //ToDo: Move implementation to ManagaerImpl @@ -500,4 +502,15 @@ public boolean removeRawUsageRecords(RemoveRawUsageRecordsCmd cmd) throws Invali _usageDao.expungeAllOlderThan(interval, ConfigurationManagerImpl.DELETE_QUERY_BATCH_SIZE.value()); return true; } + + @Override + public String getConfigComponentName() { + return UsageService.class.getSimpleName(); + } + + @Override + public ConfigKey[] getConfigKeys() { + return new ConfigKey[] {UsageAggregationTimezone, UsageExecutionTimezone, UsageSanityCheckInterval, + UsageStatsJobAggregationRange, UsageStatsJobExecTime, EnableUsageServer}; + } } diff --git a/server/src/main/java/com/cloud/user/AccountManager.java b/server/src/main/java/com/cloud/user/AccountManager.java index 054880d45b4d..468dd68cf920 100644 --- a/server/src/main/java/com/cloud/user/AccountManager.java +++ b/server/src/main/java/com/cloud/user/AccountManager.java @@ -192,6 +192,18 @@ void buildACLViewSearchCriteria(SearchCriteria s ConfigKey UseSecretKeyInResponse = new ConfigKey("Advanced", Boolean.class, "use.secret.key.in.response", "false", "This parameter allows the users to enable or disable of showing secret key as a part of response for various APIs. By default it is set to false.", true); + ConfigKey SSOKey = new ConfigKey<>("Secure", String.class, "security.singlesignon.key", null, + "A Single Sign-On key used for logging into the cloud", true); + + ConfigKey AccountCleanupInterval = new ConfigKey<>("Advanced", Integer.class, "account.cleanup.interval", "86400", + "The interval (in seconds) between cleanup for removed accounts", true); + + ConfigKey IncorrectLoginAttemptsAllowed = new ConfigKey<>("Advanced", Integer.class, "incorrect.login.attempts.allowed", "5", + "Incorrect login attempts allowed before the user is disabled (when value > 0). If value <=0 users are not disabled after failed login attempts", true); + + ConfigKey SSOAuthTolerance = new ConfigKey<>("Advanced", Long.class, "security.singlesignon.tolerance.millis", "300000", + "The allowable clock difference in milliseconds between when an SSO login request is made and when it is received.", true); + boolean moveUser(long id, Long domainId, Account newAccount) throws ResourceAllocationException; UserTwoFactorAuthenticator getUserTwoFactorAuthenticator(final Long domainId, final Long userAccountId); diff --git a/server/src/main/java/com/cloud/user/AccountManagerImpl.java b/server/src/main/java/com/cloud/user/AccountManagerImpl.java index c06228e44f9d..18994b796775 100644 --- a/server/src/main/java/com/cloud/user/AccountManagerImpl.java +++ b/server/src/main/java/com/cloud/user/AccountManagerImpl.java @@ -4205,7 +4205,8 @@ public String getConfigComponentName() { public ConfigKey[] getConfigKeys() { return new ConfigKey[] {UseSecretKeyInResponse, enableUserTwoFactorAuthentication, userTwoFactorAuthenticationDefaultProvider, mandateUserTwoFactorAuthentication, userTwoFactorAuthenticationIssuer, apiKeyAccess, - userAllowMultipleAccounts, listOfRoleTypesAllowedForOperationsOfSameRoleType, allowOperationsOnUsersInSameAccount}; + userAllowMultipleAccounts, listOfRoleTypesAllowedForOperationsOfSameRoleType, allowOperationsOnUsersInSameAccount, SSOKey, + AccountCleanupInterval, IncorrectLoginAttemptsAllowed, SSOAuthTolerance}; } public List getUserTwoFactorAuthenticationProviders() { diff --git a/server/src/main/java/com/cloud/vm/UserVmManager.java b/server/src/main/java/com/cloud/vm/UserVmManager.java index d0fb9ff9f72e..de6e9584bf6c 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManager.java +++ b/server/src/main/java/com/cloud/vm/UserVmManager.java @@ -123,6 +123,21 @@ public interface UserVmManager extends UserVmService { "For a password enabled template, whether to generate a new password and expose it in the API response when creating/restoring an Instance from a backup. " + "Can be overridden per call with the createVMFromBackup API's resetpassword parameter.", true, ConfigKey.Scope.Zone); + ConfigKey ExpungeDelay = new ConfigKey<>("Advanced", Integer.class, "expunge.delay", "86400", + "Determines how long (in seconds) to wait before actually expunging destroyed vm. The default value = the default value of expunge.interval", true); + + ConfigKey ExpungeInterval = new ConfigKey<>("Advanced", Integer.class, "expunge.interval", "86400", + "The interval (in seconds) to wait before running the expunge thread.", true); + + ConfigKey ScaleRetry = new ConfigKey<>("Advanced", Integer.class, "scale.retry", "2", + "Number of times to retry scaling up the vm", true); + + ConfigKey SetVmInternalNameUsingDisplayName = new ConfigKey<>("Advanced", Boolean.class, "vm.instancename.flag", "false", + "If set to true, will set guest VM's name as it appears on the hypervisor, to its hostname. The flag is supported for VMware hypervisor only", true); + + ConfigKey CapacitySkipcountingHours = new ConfigKey<>("Advanced", Integer.class, "capacity.skipcounting.hours", "3600", + "Time (in seconds) to wait before release VM's cpu and memory when VM in stopped state", true); + static final int MAX_USER_DATA_LENGTH_BYTES = 2048; public static final String CKS_NODE = "cksnode"; diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index d93dae9ebdec..bd9c3b9fcb82 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -9750,7 +9750,8 @@ public ConfigKey[] getConfigKeys() { KvmAdditionalConfigAllowList, XenServerAdditionalConfigAllowList, VmwareAdditionalConfigAllowList, DestroyRootVolumeOnVmDestruction, EnforceStrictResourceLimitHostTagCheck, StrictHostTags, AllowUserForceStopVm, VmDistinctHostNameScope, VmwareAdditionalDetailsFromOvaEnabled, VmwareAllowedAdditionalDetailsFromOva, AllowDifferentHostTagsOfferingsForVmScale, - AutoMigrateVmOnLiveScaleInsufficientCapacity, EnforceResourceLimitOnValidationVm, ResetPasswordOnRestoreFromBackup}; + AutoMigrateVmOnLiveScaleInsufficientCapacity, EnforceResourceLimitOnValidationVm, ExpungeDelay, ExpungeInterval, ScaleRetry, + SetVmInternalNameUsingDisplayName, CapacitySkipcountingHours, ResetPasswordOnRestoreFromBackup}; } @Override diff --git a/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java index e232b980b333..bef33fc3bf92 100644 --- a/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java @@ -1467,6 +1467,6 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { - return new ConfigKey[] {VMSnapshotExpireInterval, VMSnapshotMax}; + return new ConfigKey[] {VMSnapshotExpireInterval, VMSnapshotMax, VMSnapshotCreateWait}; } } diff --git a/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java b/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java index 9d4c73111595..af9f7875e7ed 100644 --- a/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java +++ b/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java @@ -1550,7 +1550,10 @@ public String getConfigComponentName() { @Override public ConfigKey[] getConfigKeys() { return new ConfigKey[] {NTPServerConfig, MaxNumberOfSsvmsForMigration, SecondaryStorageCapacityScanInterval, - SecondaryStorageVmUserData}; + SecondaryStorageVmUserData, UseSecondaryStorageVm, MountParent, SystemVMAutoReserveCapacity, + SystemVMRandomPassword, MaxTemplateAndIsoSize, SecStorageAllowedInternalDownloadSites, + SecStorageEncryptCopy, SecStorageSecureCopyCert, ExtractURLCleanUpInterval, DisableExtraction, + ExtractURLExpirationInterval, SecondaryStorageServiceOffering}; } } From 86803e822bead0d0c5540ef12c38fe61e423aae4 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 23 Oct 2026 16:57:21 +0200 Subject: [PATCH 2/2] fix config descriptions and the NetworkLBHaproxyStatsVisibility name Co-Authored-By: Claude Opus 5.5 --- api/src/main/java/com/cloud/storage/VolumeApiService.java | 4 ++-- .../orchestration/service/NetworkOrchestrationService.java | 2 +- .../src/main/java/com/cloud/template/TemplateManager.java | 2 +- .../main/java/com/cloud/vm/snapshot/VMSnapshotManager.java | 2 +- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 2 +- server/src/main/java/com/cloud/server/ManagementServer.java | 2 +- .../main/java/com/cloud/storage/snapshot/SnapshotManager.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/src/main/java/com/cloud/storage/VolumeApiService.java b/api/src/main/java/com/cloud/storage/VolumeApiService.java index 904ab5b9bc9c..560bc163e3e3 100644 --- a/api/src/main/java/com/cloud/storage/VolumeApiService.java +++ b/api/src/main/java/com/cloud/storage/VolumeApiService.java @@ -62,10 +62,10 @@ public interface VolumeApiService { ConfigKey.Scope.Zone); ConfigKey CopyVolumeWait = new ConfigKey<>("Storage", Integer.class, "copy.volume.wait", "10800", - "In second, timeout for copy volume command", true); + "Timeout (in seconds) for the copy volume command", true); ConfigKey CreateVolumeFromSnapshotWait = new ConfigKey<>("Storage", Integer.class, "create.volume.from.snapshot.wait", "10800", - "In second, timeout for creating volume from snapshot", true); + "Timeout (in seconds) for creating a volume from a snapshot", true); ConfigKey MaxUploadVolumeSize = new ConfigKey<>("Storage", Long.class, "storage.max.volume.upload.size", "500", "The maximum size for a uploaded volume(in GB).", true); diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java index 992f4adea831..4a4f3803ba9e 100644 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java +++ b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java @@ -138,7 +138,7 @@ public interface NetworkOrchestrationService { ConfigKey VmNetworkThrottlingRate = new ConfigKey("Network", Integer.class, "vm.network.throttling.rate", "200", "Default data transfer rate in megabits per second allowed in User vm's default network.", true, ConfigKey.Scope.Zone); - ConfigKey NetworkLBHaproxyStatsVisbility = new ConfigKey<>("Network", String.class, + ConfigKey NetworkLBHaproxyStatsVisibility = new ConfigKey<>("Network", String.class, "network.loadbalancer.haproxy.stats.visibility", "global", "Load Balancer(haproxy) stats visibility, the value can be one of the following six parameters : global,guest-network,link-local,disabled,all,default", true, ConfigKey.Kind.Select, "global,guest-network,link-local,disabled,all,default"); diff --git a/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java b/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java index e89b97e6a3e9..372ae98364b2 100644 --- a/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java +++ b/engine/components-api/src/main/java/com/cloud/template/TemplateManager.java @@ -90,7 +90,7 @@ public interface TemplateManager { ConfigKey CreatePrivateTemplateFromSnapshotWait = new ConfigKey<>("Storage", Integer.class, "create.private.template.from.snapshot.wait", "10800", - "In second, timeout for CreatePrivateTemplateFromSnapshotCommand", true); + "Timeout (in seconds) for CreatePrivateTemplateFromSnapshotCommand", true); // KVM/libvirt maps deviceSeq=3 to hdc (hda/hdb are taken by the root volume on i440fx/IDE). // user_vm.iso_id has always pointed at this slot; additional cdroms live in vm_iso_map. diff --git a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java index 24c165db268f..6e33e0c47f6f 100644 --- a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java +++ b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java @@ -34,7 +34,7 @@ public interface VMSnapshotManager extends VMSnapshotService, Manager { ConfigKey VMSnapshotMax = new ConfigKey("Advanced", Integer.class, "vmsnapshot.max", "10", "Maximum VM snapshots for a single VM", true, ConfigKey.Scope.Account); ConfigKey VMSnapshotCreateWait = new ConfigKey<>("Advanced", Integer.class, "vmsnapshot.create.wait", "1800", - "In second, timeout for create vm snapshot", true); + "Timeout (in seconds) for VM snapshot creation", true); /** * Delete all VM snapshots belonging to one VM diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 4fcdb0596fe4..88968fa9931c 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -5117,7 +5117,7 @@ public ConfigKey[] getConfigKeys() { GuestDomainSuffix, NetworkThrottlingRate, VmNetworkThrottlingRate, MinVRVersion, DhcpLeaseTimeout, PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled, TUNGSTEN_ENABLED, NSX_ENABLED, NETRIS_ENABLED, NETWORK_LB_HAPROXY_MAX_CONN, - NETWORK_LB_HAPROXY_IDLE_TIMEOUT, NetworkLBHaproxyStatsVisbility, NetworkLBHaproxyStatsUri, + NETWORK_LB_HAPROXY_IDLE_TIMEOUT, NetworkLBHaproxyStatsVisibility, NetworkLBHaproxyStatsUri, NetworkLBHaproxyStatsAuth, NetworkLBHaproxyStatsPort}; } } diff --git a/server/src/main/java/com/cloud/server/ManagementServer.java b/server/src/main/java/com/cloud/server/ManagementServer.java index 3b3a27af5d6e..d427998ffb88 100644 --- a/server/src/main/java/com/cloud/server/ManagementServer.java +++ b/server/src/main/java/com/cloud/server/ManagementServer.java @@ -101,7 +101,7 @@ public interface ManagementServer extends ManagementService, PluggableService { "enable or disable publishing of alert events on the event bus", true); ConfigKey PublishResourceStateEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.resource.state.events", "true", - "enable or disable publishing of alert events on the event bus", true); + "enable or disable publishing of resource state events on the event bus", true); ConfigKey PublishUsageEvent = new ConfigKey<>("Advanced", Boolean.class, "publish.usage.events", "true", "enable or disable publishing of usage events on the event bus", true); diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java index fe2e9bdb7199..8e45a706d65e 100644 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java @@ -73,7 +73,7 @@ public interface SnapshotManager extends Configurable { true, ConfigKey.Scope.StoragePool, null); ConfigKey BackupSnapshotWait = new ConfigKey<>("Storage", Integer.class, "backup.snapshot.wait", "21600", - "In second, timeout for BackupSnapshotCommand", true); + "Timeout (in seconds) for BackupSnapshotCommand", true); ConfigKey TotalRetries = new ConfigKey<>("Storage", Integer.class, "total.retries", "4", "The number of times each command sent to a host should be retried in case of failure.", true);