Introduction
Currently CloudStack has following 3 deployment planners available out-of-the-box:
...
- Expose deployment planner as part of a ServiceOffering API. By default, the value can be set to the default CS FirstFitPlanner, but admin can override it and set some other strategy as per needs.
- Add a resource reservation mechanism to let deployment planners co-exist
Resource reservation between planners
When the Deployment planner gets exposed per ServiceOffering, then in a CS deployment multiple planners will have to co-exist.
...
e.g Refer to the Implicit Dedication Planner being added as part of this 4.2 release.
Design
- Planner Choice in ServiceOffering
API Changes
- listDeploymentPlanners Admin API - This will be a new API that will let Admin list the available set of deployment planners.
- createServiceOffering API changes - Following new field will be added to this API
- deploymentplanner - String value (default: 'FirstFitPlanner' )
DB Changes
- Additional column to service_offering:
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `deployment_planner` varchar(255) NOT NULL DEFAULT 'FirstFitPlanner' COMMENT 'Planner heuristics used to deploy a VM of this offering'; - A new table to store planner reservations. Following are some columns needed:
CREATE TABLE `cloud`.`op_host_planner_reservation` (
`id` bigint unsigned NOT NULL auto_increment,
`data_center_id` bigint unsigned NOT NULL,
`pod_id` bigint unsigned,
`cluster_id` bigint unsigned,
`host_id` bigint unsigned,
`account_id` bigint unsigned,
`domain_id` bigint unsigned,
`deployment_planner` int(1) unsigned NOT NULL COMMENT 'Name of the Planner',
`resource_type` datetime COMMENT 'shared(0) Vs dedicated(1)',
PRIMARY KEY (`id`),
INDEX `i_op_host_capacity__host_type`(`host_id`, `resource_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UI Changes
Following UI changes are needed:
Add a field 'deployment planner' to the createServiceOffering UI.
The value should be chosen from a drop-down list of available deployment planners.