cloudstack/test/integration/smoke
Vishesh ea90848429
Feature: Add support for DRS in a Cluster (#7723)
This pull request (PR) implements a Distributed Resource Scheduler (DRS) for a CloudStack cluster. The primary objective of this feature is to enable automatic resource optimization and workload balancing within the cluster by live migrating the VMs as per configuration.
Administrators can also execute DRS manually for a cluster, using the UI or the API.
Adds support for two algorithms - condensed & balanced. Algorithms are pluggable allowing ACS Administrators to have customized control over scheduling.

Implementation
There are three top level components:

    Scheduler
    A timer task which:

    Generate DRS plan for clusters
    Process DRS plan
    Remove old DRS plan records

    DRS Execution
    We go through each VM in the cluster and use the specified algorithm to check if DRS is required and to calculate cost, benefit & improvement of migrating that VM to another host in the cluster. On the basis of cost, benefit & improvement, the best migration is selected for the current iteration and the VM is migrated. The maximum number of iterations (live migrations) possible on the cluster is defined by drs.iterations which is defined as a percentage (as a value between 0 and 1) of total number of workloads.

    Algorithm
    Every algorithms implements two methods:
        needsDrs - to check if drs is required for cluster
        getMetrics - to calculate cost, benefit & improvement of a migrating a VM to another host.

Algorithms

    Condensed - Packs all the VMs on minimum number of hosts in the cluster.
    Balanced - Distributes the VMs evenly across hosts in the cluster.
    Algorithms use drs.level to decide the amount of imbalance to allow in the cluster.

APIs Added

listClusterDrsPlan

    id - ID of the DRS plan to list
    clusterid - to list plans for a cluster id

generateClusterDrsPlan

    id - cluster id
    iterations - The maximum number of iterations in a DRS job defined as a percentage (as a value between 0 and 1) of total number of workloads. Defaults to value of cluster's drs.iterations setting.

executeClusterDrsPlan

    id - ID of the cluster for which DRS plan is to be executed.
    migrateto - This parameter specifies the mapping between a vm and a host to migrate that VM. Format of this parameter: migrateto[vm-index].vm=<uuid>&migrateto[vm-index].host=<uuid>.

Config Keys Added

    ClusterDrsPlanExpireInterval
    Key drs.plan.expire.interval
    Scope Global
    Default Value 30 days
    Description The interval in days after which old DRS records will be cleaned up.

    ClusterDrsEnabled
    Key drs.automatic.enable
    Scope Cluster
    Default Value false
    Description Enable/disable automatic DRS on a cluster.

    ClusterDrsInterval
    Key drs.automatic.interval
    Scope Cluster
    Default Value 60 minutes
    Description The interval in minutes after which a periodic background thread will schedule DRS for a cluster.

    ClusterDrsIterations
    Key drs.max.migrations
    Scope Cluster
    Default Value 50
    Description Maximum number of live migrations in a DRS execution.

    ClusterDrsAlgorithm
    Key drs.algorithm
    Scope Cluster
    Default Value condensed
    Description DRS algorithm to execute on the cluster. This PR implements two algorithms - balanced & condensed.

    ClusterDrsLevel
    Key drs.imbalance
    Scope Cluster
    Default Value 0.5
    Description Percentage (as a value between 0.0 and 1.0) of imbalance allowed in the cluster. 1.0 means no imbalance
    is allowed and 0.0 means imbalance is allowed.

    ClusterDrsMetric
    Key drs.imbalance.metric
    Scope Cluster
    Default Value memory
    Description The cluster imbalance metric to use when checking the drs.imbalance.threshold. Possible values are memory and cpu.
2023-10-26 11:48:18 +05:30
..
__init__.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_2fa.py User two factor authentication (#6924) 2023-02-13 09:14:17 +01:00
test_accounts.py Fix spelling (#7087) 2023-01-16 10:56:07 +01:00
test_affinity_groups.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_affinity_groups_projects.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_annotations.py Allow admin/users to add comments to Management Servers (#7379) 2023-04-18 14:16:55 +05:30
test_async_job.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_attach_multiple_volumes.py test,xcp-ng: fix tests for VM PV driver issue (#6549) 2022-08-09 12:44:27 +05:30
test_backup_recovery_dummy.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_certauthority_root.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_cluster_drs.py Feature: Add support for DRS in a Cluster (#7723) 2023-10-26 11:48:18 +05:30
test_console_endpoint.py console: Console access enhancements (#6577) 2022-09-14 12:39:59 +05:30
test_create_list_domain_account_project.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_create_network.py Make displayText in createNetwork optional (#7112) 2023-02-08 14:41:59 +01:00
test_deploy_vgpu_enabled_vm.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_deploy_virtio_scsi_vm.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_deploy_vm_extra_config_data.py integration test fixes for 4.18 (#7190) 2023-02-14 08:20:11 +01:00
test_deploy_vm_iso.py CLOUDSTACK-10013: Fixes based on code review and test failures 2017-12-23 17:51:42 +05:30
test_deploy_vm_iso_uefi.py Adding support for RHEL8 binary-compatible variants (#5158) 2021-08-18 10:03:03 +02:00
test_deploy_vm_root_resize.py VM Autoscaling with virtual router (#6571) 2022-12-05 15:23:03 +01:00
test_deploy_vm_with_userdata.py Fix spelling (#6898) 2022-12-13 14:58:14 +01:00
test_deploy_vms_in_parallel.py Resource reservation framework (#6694) 2022-09-16 15:44:35 +05:30
test_deploy_vms_with_varied_deploymentplanners.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_diagnostics.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_direct_download.py Direct download certificates additions and improvements (#6104) 2022-04-11 22:57:23 -03:00
test_disk_offerings.py kvm: volume encryption feature (#6522) 2022-09-27 10:20:59 +05:30
test_disk_provisioning_types.py Added disk provisioning type support for VMWare (#4640) 2021-07-16 22:37:42 -03:00
test_domain_disk_offerings.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_domain_network_offerings.py tests: Fix test failures for Local storage and Basic zones (#5106) 2021-07-01 09:45:21 +05:30
test_domain_service_offerings.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_domain_vpc_offerings.py tests: Fix test failures for Local storage and Basic zones (#5106) 2021-07-01 09:45:21 +05:30
test_dynamicroles.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_enable_account_settings_for_domain.py Enable account settings to be visible under domain settings (#4215) 2021-09-29 10:29:20 +02:00
test_enable_role_based_users_in_projects.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_events_resource.py VM.CREATE/VOLUME.DELETE/VOLUME.DESTROY not being emitted (#7760) 2023-08-07 10:18:17 +05:30
test_gateway_on_shared_networks.py Gateways after Nic update on Shared Network tests (#6355) 2022-05-05 19:53:31 -03:00
test_global_settings.py Improve global settings UI to be more intuitive/logical (#5797) 2023-01-31 11:23:43 +01:00
test_guest_os.py Guest os mappings improvements (#6979) 2023-06-27 13:49:20 +05:30
test_guest_vlan_range.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_host_control_state.py Auto Enable/Disable KVM hosts (#7170) 2023-04-04 17:03:37 +05:30
test_host_maintenance.py packaging: Adding Centos8, Ubuntu 20.04, XCPNG8.1 Support (#4068) 2020-08-17 16:28:30 +05:30
test_hostha_kvm.py Adding support for RHEL8 binary-compatible variants (#5158) 2021-08-18 10:03:03 +02:00
test_hostha_simulator.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_human_readable_logs.py Changed test failure to warning (#4264) 2020-08-25 15:29:59 +05:30
test_internal_lb.py VMware: add support for 8.0b (8.0.0.2), 8.0c (8.0.0.3) (#7380) 2023-08-17 10:42:42 +02:00
test_ipv6_infra.py test: add, refactor ipv6 network, vpc tests (#6338) 2022-07-12 12:54:53 +05:30
test_iso.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_kubernetes_clusters.py Merge release branch 4.18 to main 2023-08-10 14:50:46 +02:00
test_kubernetes_supported_versions.py test: upgrade kubernetes versions to 1.25.0/1.26.0 (#7685) 2023-08-10 09:48:08 +02:00
test_list_ids_parameter.py xen: Fix volume snapshot deletion when it has child snapshots (#6296) 2022-04-22 14:36:08 -03:00
test_loadbalance.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_login.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_metrics_api.py ui,server,api: resource metrics improvements (#6803) 2023-01-30 09:48:03 +01:00
test_migration.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_multipleips_per_nic.py CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate 2017-12-23 09:22:44 +05:30
test_nested_virtualization.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_network.py Possibility to choose the source NAT IP address on a isolated network or VPC (#6442) 2023-06-09 14:51:53 +02:00
test_network_acl.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_network_ipv6.py test: use normal user for createing networks, vpcs (#6988) 2022-12-19 11:19:56 +01:00
test_network_permissions.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_nic.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_nic_adapter_type.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_non_contigiousvlan.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_nonstrict_affinity_group.py new plugins: Add non-strict affinity groups (#6845) 2022-12-20 15:09:52 +01:00
test_outofbandmanagement.py test: Frix travis failure - test_outofbandmanagement.py (#5346) 2021-08-20 13:00:34 +02:00
test_outofbandmanagement_nestedplugin.py Use lowercase HTTP header field names so we are compatible with HTTP/2 (#7006) 2023-01-23 11:17:54 +01:00
test_over_provisioning.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_password_server.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_persistent_network.py Enable flake8 rule W292 No newline at end of file (#6274) 2022-06-30 12:08:27 +05:30
test_portable_publicip.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_portforwardingrules.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_primary_storage.py utils,framework/db: Introduce new database encryption cipher based on AesGcmJce (#7003) 2023-02-02 16:25:49 +01:00
test_private_roles.py create parameter to determine whether roles are public or private (#6960) 2023-05-01 15:26:10 +02:00
test_privategw_acl.py Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
test_privategw_acl_ovs_gre.py OVS/GRE: bug fixes (#5446) 2021-10-03 14:47:52 +05:30
test_projects.py server: allow updating project name (#7149) 2023-04-25 15:29:13 +05:30
test_public_ip_range.py server: fix cannot get systemvm ips in dedicated ranges (#7144) 2023-08-25 11:36:39 +02:00
test_pvlan.py Fix spelling (#6860) 2022-11-13 10:56:15 +01:00
test_regions.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_register_userdata.py userdata: fix append scenarios (#7741) 2023-07-19 15:18:53 +05:30
test_reset_configuration_settings.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_reset_vm_on_reboot.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_resource_accounting.py CLOUDSTACK-3009: Fix resource calculation CPU, RAM for accounts. (#3012) 2018-11-13 06:29:08 +05:30
test_resource_detail.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_router_dhcphosts.py cleanup of unused code and cleanup of cleanup procedure (#5562) 2021-12-23 10:10:38 +05:30
test_router_dns.py CLOUDSTACK-10193: Fix smoke tests failures with new systemvmtemplate 2017-12-23 09:22:44 +05:30
test_router_dnsservice.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_routers.py server: Use ACPI event to reboot VM on KVM, and Use 'forced' reboot option to stop and start the VM(s) (#4681) 2021-03-06 14:58:56 +05:30
test_routers_iptables_default_policy.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_routers_network_ops.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_safe_shutdown.py Run startServer in tearDown for test_safe_shutdown to ensure management server is up even if the tests fail (#7767) 2023-07-25 03:41:31 +02:00
test_scale_vm.py server: fix volume migration on user vm scale (#6704) 2022-11-30 12:58:48 +05:30
test_secondary_storage.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_service_offerings.py kvm: volume encryption feature (#6522) 2022-09-27 10:20:59 +05:30
test_set_sourcenat.py test: fix ci failures on main branch (#7733) 2023-07-12 09:19:28 +02:00
test_snapshots.py test: add test for standalone snapshot (#8104) 2023-10-19 09:48:16 +05:30
test_ssvm.py Add Service Offering to listSystemVMs and fix link from VR to its offering (#7938) 2023-09-28 09:10:03 +02:00
test_staticroles.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_storage_policy.py network: fix vm can be deployed on L2 network of other accounts (#5784) 2022-01-11 12:16:00 +05:30
test_templates.py marvin,test: fix directdownload template checksum test (#8096) 2023-10-19 19:40:03 +02:00
test_update_security_group.py Fix spelling (#6597) 2022-08-03 15:43:47 +05:30
test_usage.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_usage_events.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_vm_autoscaling.py test: fix test_vm_autoscaling.py which does not work due to userdata improvement (#7921) 2023-08-30 23:51:52 +02:00
test_vm_deployment_planner.py test_vm_deployment_planner: fix using wrong hypervisor (#7718) 2023-08-07 10:20:42 +05:30
test_vm_life_cycle.py test: skip live storage migration on CentOS 7 (#7862) 2023-08-15 08:39:18 +02:00
test_vm_lifecycle_unmanage_import.py test: fix failure on non-VMware env (#6969) 2022-12-12 10:32:29 +05:30
test_vm_schedule.py Add extra checks for test_vm_schedule to avoid intermittent failures (#8036) 2023-10-05 11:48:37 +05:30
test_vm_snapshot_kvm.py .github/linters: Enable flake8 W293 blank line contains whitespace (#6268) 2022-04-15 20:32:52 +05:30
test_vm_snapshots.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_volumes.py kvm: volume encryption feature (#6522) 2022-09-27 10:20:59 +05:30
test_vpc_ipv6.py test: use normal user for createing networks, vpcs (#6988) 2022-12-19 11:19:56 +01:00
test_vpc_redundant.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_vpc_router_nics.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_vpc_vpn.py Refactor test and change IP range (#6512) 2023-06-05 16:39:33 +02:00