Commit Graph

33 Commits

Author SHA1 Message Date
Xinyuan Huang 0c0443b410 Move out TenantRackConstraint and minor cleanups
We need to move TenantRackConstraint to a stand alone module, it should not be
a part of rack affinity constraint. No user impact. This patch also cleans up
and fixes some minor codes in the rack_affinity_constraint and
tenant_rack_constraint modules.

Change-Id: I3dacb3979d5a134817f2502a4f419597e3413180
2015-08-26 01:58:41 +08:00
Xinyuan Huang 39fb7d996a Some fixes in comments
This patch fixed a couple of wrong comments.

Change-Id: Iacb4d423ec0e62bdd9f1243d72a950cefbde46c3
2015-08-25 23:57:08 +08:00
Jenkins 62b0021500 Merge "Rename the module rack_affinity_cost to tenant_rack_affinity_cost" 2015-08-25 13:33:44 +00:00
Jenkins 84d7d866e6 Merge "Add io ops cost to solver scheduler" 2015-08-25 13:29:33 +00:00
Jenkins 71f5abd050 Merge "Add aggregate num instances constraint to solver scheduler" 2015-08-25 13:20:01 +00:00
Jenkins 1fbfeeae5a Merge "Add NUMA topology constraint to solver scheduler" 2015-08-25 12:52:24 +00:00
Xinyuan Huang 569da9a5f9 Add exact vcpu/ram/disk constraints to solver scheduler
This adds the ExactVcpuConstraint, ExactRamConstraint, and ExactDiskConstraint
that matches the ExactCoreFilter, ExactRamFilter and ExactDiskFilter in filter
scheduler.

Change-Id: I942e7a6287b5b5927c4271ba56fd5a769ac5e227
2015-08-25 20:40:10 +08:00
Xinyuan Huang 1c4280b3af Add io ops cost to solver scheduler
This adds the IoOpsCost to match the IoOpsWeigher in filter scheduler.

Change-Id: I032eed99edd7c3848d3c848cd70ef3b630889b07
2015-08-20 21:26:23 +08:00
Xinyuan Huang 58a8c6b3be Rename the module rack_affinity_cost to tenant_rack_affinity_cost
To make it more specific. Only filename is changed, no change in class name,
and no user impact.

Change-Id: I559ae61b54654d30563d995ea6956c817789fa80
2015-08-20 14:42:56 +08:00
Xinyuan Huang 2646f4ddc6 Add aggregate num instances constraint to solver scheduler
This adds the AggregateNumInstancesConstraint that matches NumInstancesFilter
in filter scheduler.

Change-Id: If57070755b9f9a99379008aa519250f80cdb7b4e
2015-08-15 19:23:03 +08:00
Xinyuan Huang e63eaf53ce Add NUMA topology constraint to solver scheduler
This adds the numa topology constraint that matches the numa topology filter
in filter scheduler.

Change-Id: Id80f0a7364132204c82f50e61b0c77913485ae04
2015-08-10 22:42:11 +08:00
Jenkins 010cc4fe58 Merge "Add vCPU cost to solver scheduler" 2015-08-03 07:18:37 +00:00
Jenkins 5af1c0bd5b Merge "Add debug logs to server_group_affinity_constraint" 2015-08-03 06:58:34 +00:00
Jenkins 6ee0cc69dd Merge "Add some debug log into solver_scheduler" 2015-08-03 06:56:43 +00:00
Jenkins 78de6ec4d4 Merge "Add tenant rack affinity cost" 2015-08-03 06:56:00 +00:00
Xinyuan Huang 2893562105 Add vCPU cost to solver scheduler
This adds the vcpu_cost which can balance/stack the usage of vcpus in hosts.

Change-Id: I50445672a64d436f01a5e70b54ff96e101c62a51
2015-08-01 00:57:04 +08:00
Xinyuan Huang 9278f31992 Add debug logs to server_group_affinity_constraint
This adds a couple of debug logs for debuging convenience.

Change-Id: I5859366b8dc8ddc138a767c78013f36a5d7b323c
2015-08-01 00:06:07 +08:00
Xinyuan Huang 1f5284adac Add some debug log into solver_scheduler
This makes the scheduler to log host states and filter properties before the
solver takes them.

Change-Id: Icaf23e504bc13b4549e8284b17e41535d1968cfd
2015-07-31 23:58:52 +08:00
Xinyuan Huang 78d9a7f643 Fix indentation problem in scheduler.solvers.utils
This fixes an indentation mistake.

Change-Id: I7ae220f0a93c39e05b6b63cc0fb5fbfc4f0263c0
2015-07-31 17:14:27 +08:00
Xinyuan Huang 90d8bdf86d Add tenant rack affinity cost
This adds the TenantRackAffinityCost, which tends to place instances in the
racks that contain existing instances of the tenant. If a rack has existing
instances of the same tenant as that making request, then the hosts in the
rack will get lower cost value.

Change-Id: Iff9283ebdfb46a44978342430e453c24aea7c3d0
2015-07-31 12:13:38 +08:00
Jenkins ea6bbd10b8 Merge "Affiniy/anti-affinity costs for soft affinity placement in solver scheduler" 2015-07-26 13:45:09 +00:00
Xinyuan Huang fefcef5d67 Add tenant rack constraint to solver scheduler
This helps to limit the maximum number of racks that each tenant's VMs can
spread across. The max rack number can be set via config option, and if the
limit is not reached for a tenant the constraint logic will automatically look
for additional rack(s) and mark hosts in the additional rack(s) as available.

Change-Id: I792ac2e0ad75a6df8e8874b159a26760c47cfbd7
2015-07-09 01:42:21 +08:00
Xinyuan Huang 0ba1e05467 Add same/different rack constraints to solver scheduler
This adds two constraint classes, SameRackConstraint and DifferentRackConstraint,
to support rack-based affinity placement functionality, which are similar as the
same/different host constraints but in rack's level.

Change-Id: I4e06ab74808b565da6e93a5817ff095ae97b2c9c
2015-07-09 00:24:58 +08:00
Xinyuan Huang d7dfdb18db Affiniy/anti-affinity costs for soft affinity placement in solver scheduler
This enables solver scheduler to do soft affinity placement by adding two cost
classes: affinity cost and anti-affinity cost. User can specify scheduler hint
soft_same_host/soft_different_host=<a_list_of_instance_uuids>. The scheduler
will tend to put instances in same/different hosts as those existing instances
specified by user. If no instance uuid is provided, then scheduler should tend
to schedule all requested instances in same/different hosts. The affinity and
anti-affinity costs are not treated as hard restrictions which means if there
is no host that can meet the same/different host requirements then other hosts
may be chosen.

Change-Id: Ie12af12d6e11c1dd815a2b1a81ef5376a02be057
2015-07-09 00:13:56 +08:00
Xinyuan Huang 445b4ace80 Modify aggregate disk/ram/vcpu constraints to use host state for aggregate info
This removes db calls in them, and keeps them up-to-date with current nova.

Change-Id: I3f06c07b2eda48b8cb234b60dca891bf2e2aab53
2015-07-06 18:04:12 +08:00
Xinyuan Huang 7e4ef635d5 Let scheduler.solvers.utils import all methods from nova.scheduler.filters.utils
The methods in filters.utils are needed by solver scheduler, this enables the
solvers.utils to extend from the filters.utils in nova scheduler.

Change-Id: Ie13d2f3bd32ec4e25b5e4289a3eebe1c141263a2
2015-06-30 20:46:37 +08:00
Xinyuan Huang b34da2223c Add util method for getting rack config into scheduler from a config file
This adds a utility module to solver-scheduler's solver directory, together
with a method to get rack configurations from an external config file. This
will be needed by rack based constraints for solver scheduler.

Change-Id: I2f81fc47f374cb90d19dc1a1cafcb3beb76d4bb5
2015-06-30 18:32:48 +08:00
Xinyuan Huang 47576e780f Replacing '_' with '_LW' for log warnings
To comply with new oslo.i18n guidlines.

Change-Id: I7cabff37847690f446eb2f0b9b80edd9efc2ccab
2015-06-30 01:19:38 +08:00
Xinyuan Huang d0e3aa654c Fix bug in "Minimum necessary upgrades for solver scheduler to pass tests in kilo"
This removes some incorrect codes in previous commit.

Change-Id: I5a94f8c6b8b8b743842df8122d425c1ddfb87161
2015-06-29 18:02:25 +08:00
Xinyuan Huang 336b0388e3 Minimum necessary upgrades for solver scheduler to pass tests in kilo
This patch includes the minimum updates needed to fill the gap between solver
scheduler and kilo version of nova. It ensures that solver scheduler's tests
can pass under the kilo's nova environment. The patch does not include changes
that match all features in current nova codes. More changes are needed in the
future to fully port solver scheduler to the current nova version.

The main changes in this patch include:
- Switch from incubated depencies to corresponding oslo_* libraries.
- Minimum and necessary changes in solver_scheduler_host_manager,
solver_scheduler, and several unit testing modules to ensure that tests can
pass in the latest nova environment.
- Removed some unneeded tests which are not compatible with current nova
environment.
- Updated test dependencies to kilo.

TODO:
Future changes should cover all the features/changes in kilo and current nova.
Testings need to be enhanced to ensure the coverage and compatibility to kilo,
current and future nova versions.

Change-Id: Ib37b9361d3824fc12620db72892fcdcd0cab09af
Implements: blueprint update-to-liberty
2015-06-29 15:48:33 +08:00
Xinyuan Huang 1f8b9723e6 Fix the missing _get_disk_allocation_ratio() in disk constraint
Add back the missing _get_disk_allocation_ratio() method and related calls
which are supposed to be in disk_constraint.py.

Change-Id: I69fbc02387c9c4735568af126eae6c7d6e2e84f1
2015-05-28 21:11:25 +08:00
Xinyuan Huang 81688ad630 Fix a couple of small issues in tests found by pep8
Change-Id: I79c22ea5a8b48e940ffd8fa13767d629b953ae28
2015-05-20 08:12:42 -07:00
Xinyuan Huang 6c3c0fc8ff Move solver-scheduler's top directory from 'nova' to 'nova_solverscheduler'
The nova solver scheduler was designed to be a drop-in patch for nova, and it
uses 'nova' as the directory now, however it's easier to manage the project
as an individual python package, therefore we want to move the top directory
out to a separate one, which is called 'nova_solverscheduler'. This patch
will modify the module import dependencies and also add necessary init files
so as to turn the project into a complete python package.

Change-Id: I62550c84f157db398da5edbef514832e1351f66f
2015-05-16 18:05:55 -07:00