watcher.decision_engine.strategy.strategies.host_maintenance
Module¶watcher.decision_engine.strategy.strategies.host_maintenance.
HostMaintenance
(config, osc=None)[source]¶Bases: watcher.decision_engine.strategy.strategies.base.HostMaintenanceBaseStrategy
[PoC]Host Maintenance
Description
It is a migration strategy for one compute node maintenance, without having the user’s application been interruptted. If given one backup node, the strategy will firstly migrate all instances from the maintenance node to the backup node. If the backup node is not provided, it will migrate all instances, relying on nova-scheduler.
Requirements
- You must have at least 2 physical compute nodes to run this strategy.
Limitations
- This is a proof of concept that is not meant to be used in production
- It migrates all instances from one host to other hosts. It’s better to execute such strategy when load is not heavy, and use this algorithm with ONESHOT audit.
- It assume that cold and live migrations are possible
add_action_maintain_compute_node
(node)[source]¶Add an action for node maintenance into the solution.
do_execute
()[source]¶Strategy execution phase
This phase is where you should put the main logic of your strategy.
get_node_capacity
(node)[source]¶Collect cpu, ram and disk capacity of a node.
Parameters: | node – node object |
---|---|
Returns: | dict(cpu(cores), ram(MB), disk(B)) |
get_node_free
(node)[source]¶Collect cpu, ram and disk free of a node.
Parameters: | node – node object |
---|---|
Returns: | dict(cpu(cores), ram(MB), disk(B)) |
get_node_used
(node)[source]¶Collect cpu, ram and disk used of a node.
Parameters: | node – node object |
---|---|
Returns: | dict(cpu(cores), ram(MB), disk(B)) |
get_schema
()[source]¶Defines a Schema that the input parameters shall comply to
Returns: | A jsonschema format (mandatory default setting) |
---|---|
Return type: | dict |
host_fits
(source_node, destination_node)[source]¶check host fits
return True if VMs could intensively migrate from source_node to destination_node.
host_migration
(source_node, destination_node)[source]¶host migration
Migrate all instances from source_node to destination_node. Active instances use “live-migrate”, and other instances use “cold-migrate”
instance_migration
(instance, src_node, des_node=None)[source]¶Add an action for instance migration into the solution.
Parameters: |
|
---|---|
Returns: | None |
safe_maintain
(maintenance_node, backup_node=None)[source]¶safe maintain one compute node
Migrate all instances of the maintenance_node intensively to the backup host. If users didn’t give the backup host, it will select one unused node to backup the maintaining node.
It calculate the resource both of the backup node and maintaining node to evaluate the migrations from maintaining node to backup node. If all instances of the maintaining node can migrated to the backup node, it will set the maintaining node in ‘watcher_maintaining’ status., and add the migrations to solution.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.