diff options
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 13 | ||||
| -rw-r--r-- | nova/compute/rpcapi.py | 22 |
2 files changed, 24 insertions, 11 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index cd756af65..2f977b26c 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -213,7 +213,7 @@ def _get_image_meta(context, image_ref): class ComputeManager(manager.SchedulerDependentManager): """Manages the running instances from creation to destruction.""" - RPC_API_VERSION = '2.1' + RPC_API_VERSION = '2.2' def __init__(self, compute_driver=None, *args, **kwargs): """Load configuration options and connect to the hypervisor.""" @@ -2812,11 +2812,12 @@ class ComputeManager(manager.SchedulerDependentManager): self._set_instance_error_state(context, instance_uuid) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) - def add_aggregate_host(self, context, aggregate_id, host): + def add_aggregate_host(self, context, aggregate_id, host, slave_info=None): """Notify hypervisor of change (for hypervisor pools).""" aggregate = self.db.aggregate_get(context, aggregate_id) try: - self.driver.add_to_aggregate(context, aggregate, host) + self.driver.add_to_aggregate(context, aggregate, host, + slave_info=slave_info) except exception.AggregateError: with excutils.save_and_reraise_exception(): self.driver.undo_aggregate_operation(context, @@ -2824,11 +2825,13 @@ class ComputeManager(manager.SchedulerDependentManager): aggregate.id, host) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) - def remove_aggregate_host(self, context, aggregate_id, host): + def remove_aggregate_host(self, context, aggregate_id, + host, slave_info=None): """Removes a host from a physical hypervisor pool.""" aggregate = self.db.aggregate_get(context, aggregate_id) try: - self.driver.remove_from_aggregate(context, aggregate, host) + self.driver.remove_from_aggregate(context, aggregate, host, + slave_info=slave_info) except (exception.AggregateError, exception.InvalidAggregateAction) as e: with excutils.save_and_reraise_exception(): diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index b53cc1e7a..2e3873c19 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -128,6 +128,8 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): 2.0 - Remove 1.x backwards compat 2.1 - Adds orig_sys_metadata to rebuild_instance() + 2.2 - Adds slave_info parameter to add_aggregate_host() and + remove_aggregate_host() ''' # @@ -145,7 +147,8 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): topic=FLAGS.compute_topic, default_version=self.BASE_RPC_API_VERSION) - def add_aggregate_host(self, ctxt, aggregate_id, host_param, host): + def add_aggregate_host(self, ctxt, aggregate_id, host_param, host, + slave_info=None): '''Add aggregate host. :param ctxt: request context @@ -154,9 +157,12 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): parameter for the remote method. :param host: This is the host to send the message to. ''' + self.cast(ctxt, self.make_msg('add_aggregate_host', - aggregate_id=aggregate_id, host=host_param), - topic=_compute_topic(self.topic, ctxt, host, None)) + aggregate_id=aggregate_id, host=host_param, + slave_info=slave_info), + topic=_compute_topic(self.topic, ctxt, host, None), + version='2.2') def add_fixed_ip_to_instance(self, ctxt, instance, network_id): instance_p = jsonutils.to_primitive(instance) @@ -355,7 +361,8 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): self.cast(ctxt, self.make_msg('refresh_provider_fw_rules'), _compute_topic(self.topic, ctxt, host, None)) - def remove_aggregate_host(self, ctxt, aggregate_id, host_param, host): + def remove_aggregate_host(self, ctxt, aggregate_id, host_param, host, + slave_info=None): '''Remove aggregate host. :param ctxt: request context @@ -364,9 +371,12 @@ class ComputeAPI(nova.openstack.common.rpc.proxy.RpcProxy): parameter for the remote method. :param host: This is the host to send the message to. ''' + self.cast(ctxt, self.make_msg('remove_aggregate_host', - aggregate_id=aggregate_id, host=host_param), - topic=_compute_topic(self.topic, ctxt, host, None)) + aggregate_id=aggregate_id, host=host_param, + slave_info=slave_info), + topic=_compute_topic(self.topic, ctxt, host, None), + version='2.2') def remove_fixed_ip_from_instance(self, ctxt, instance, address): instance_p = jsonutils.to_primitive(instance) |
