summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-07-18 16:58:23 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-07-18 16:58:23 -0700
commitb5ceab5a46ffac11cb229de86c49802bba3fa383 (patch)
tree62459fbead53019efe4efc3e762fe1e07e84a450 /nova/compute
parent67e5492d6723a00b0ad5d7e8c44f5762a9b0a206 (diff)
parent77db06c908f9c08c80beb11241c0e23247129ad6 (diff)
merged trunk
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py102
-rw-r--r--nova/compute/manager.py148
2 files changed, 159 insertions, 91 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index edd1a4d64..acafc7760 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -32,6 +32,7 @@ from nova import quota
from nova import rpc
from nova import utils
from nova import volume
+from nova.api.ec2 import ec2utils
from nova.compute import instance_types
from nova.compute import power_state
from nova.compute.utils import terminate_volumes
@@ -217,6 +218,9 @@ class API(base.Base):
if reservation_id is None:
reservation_id = utils.generate_uid('r')
+ root_device_name = ec2utils.properties_root_device_name(
+ image['properties'])
+
base_options = {
'reservation_id': reservation_id,
'image_ref': image_href,
@@ -241,11 +245,61 @@ class API(base.Base):
'availability_zone': availability_zone,
'os_type': os_type,
'architecture': architecture,
- 'vm_mode': vm_mode}
+ 'vm_mode': vm_mode,
+ 'root_device_name': root_device_name}
+
+ return (num_instances, base_options, image)
+
+ def _update_image_block_device_mapping(self, elevated_context, instance_id,
+ mappings):
+ """tell vm driver to create ephemeral/swap device at boot time by
+ updating BlockDeviceMapping
+ """
+ for bdm in ec2utils.mappings_prepend_dev(mappings):
+ LOG.debug(_("bdm %s"), bdm)
+
+ virtual_name = bdm['virtual']
+ if virtual_name == 'ami' or virtual_name == 'root':
+ continue
- return (num_instances, base_options)
+ assert (virtual_name == 'swap' or
+ virtual_name.startswith('ephemeral'))
+ values = {
+ 'instance_id': instance_id,
+ 'device_name': bdm['device'],
+ 'virtual_name': virtual_name, }
+ self.db.block_device_mapping_update_or_create(elevated_context,
+ values)
+
+ def _update_block_device_mapping(self, elevated_context, instance_id,
+ block_device_mapping):
+ """tell vm driver to attach volume at boot time by updating
+ BlockDeviceMapping
+ """
+ for bdm in block_device_mapping:
+ LOG.debug(_('bdm %s'), bdm)
+ assert 'device_name' in bdm
- def create_db_entry_for_new_instance(self, context, base_options,
+ values = {'instance_id': instance_id}
+ for key in ('device_name', 'delete_on_termination', 'virtual_name',
+ 'snapshot_id', 'volume_id', 'volume_size',
+ 'no_device'):
+ values[key] = bdm.get(key)
+
+ # NOTE(yamahata): NoDevice eliminates devices defined in image
+ # files by command line option.
+ # (--block-device-mapping)
+ if bdm.get('virtual_name') == 'NoDevice':
+ values['no_device'] = True
+ for k in ('delete_on_termination', 'volume_id',
+ 'snapshot_id', 'volume_id', 'volume_size',
+ 'virtual_name'):
+ values[k] = None
+
+ self.db.block_device_mapping_update_or_create(elevated_context,
+ values)
+
+ def create_db_entry_for_new_instance(self, context, image, base_options,
security_group, block_device_mapping, num=1):
"""Create an entry in the DB for this new instance,
including any related table updates (such as security group,
@@ -278,23 +332,14 @@ class API(base.Base):
instance_id,
security_group_id)
- block_device_mapping = block_device_mapping or []
- # NOTE(yamahata)
- # tell vm driver to attach volume at boot time by updating
- # BlockDeviceMapping
- for bdm in block_device_mapping:
- LOG.debug(_('bdm %s'), bdm)
- assert 'device_name' in bdm
- values = {
- 'instance_id': instance_id,
- 'device_name': bdm['device_name'],
- 'delete_on_termination': bdm.get('delete_on_termination'),
- 'virtual_name': bdm.get('virtual_name'),
- 'snapshot_id': bdm.get('snapshot_id'),
- 'volume_id': bdm.get('volume_id'),
- 'volume_size': bdm.get('volume_size'),
- 'no_device': bdm.get('no_device')}
- self.db.block_device_mapping_create(elevated, values)
+ # BlockDeviceMapping table
+ self._update_image_block_device_mapping(elevated, instance_id,
+ image['properties'].get('mappings', []))
+ self._update_block_device_mapping(elevated, instance_id,
+ image['properties'].get('block_device_mapping', []))
+ # override via command line option
+ self._update_block_device_mapping(elevated, instance_id,
+ block_device_mapping)
# Set sane defaults if not specified
updates = {}
@@ -356,7 +401,7 @@ class API(base.Base):
"""Provision the instances by passing the whole request to
the Scheduler for execution. Returns a Reservation ID
related to the creation of all of these instances."""
- num_instances, base_options = self._check_create_parameters(
+ num_instances, base_options, image = self._check_create_parameters(
context, instance_type,
image_href, kernel_id, ramdisk_id,
min_count, max_count,
@@ -394,7 +439,7 @@ class API(base.Base):
Returns a list of instance dicts.
"""
- num_instances, base_options = self._check_create_parameters(
+ num_instances, base_options, image = self._check_create_parameters(
context, instance_type,
image_href, kernel_id, ramdisk_id,
min_count, max_count,
@@ -404,10 +449,11 @@ class API(base.Base):
injected_files, admin_password, zone_blob,
reservation_id)
+ block_device_mapping = block_device_mapping or []
instances = []
LOG.debug(_("Going to run %s instances..."), num_instances)
for num in range(num_instances):
- instance = self.create_db_entry_for_new_instance(context,
+ instance = self.create_db_entry_for_new_instance(context, image,
base_options, security_group,
block_device_mapping, num=num)
instances.append(instance)
@@ -901,8 +947,14 @@ class API(base.Base):
def add_fixed_ip(self, context, instance_id, network_id):
"""Add fixed_ip from specified network to given instance."""
self._cast_compute_message('add_fixed_ip_to_instance', context,
- instance_id,
- network_id)
+ instance_id,
+ params=dict(network_id=network_id))
+
+ @scheduler_api.reroute_compute("remove_fixed_ip")
+ def remove_fixed_ip(self, context, instance_id, address):
+ """Remove fixed_ip from specified network to given instance."""
+ self._cast_compute_message('remove_fixed_ip_from_instance', context,
+ instance_id, params=dict(address=address))
#TODO(tr3buchet): how to run this in the correct zone?
def add_network_to_project(self, context, project_id):
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 5d21c9eb2..77ff9e317 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -54,7 +54,7 @@ from nova import rpc
from nova import utils
from nova import volume
from nova.compute import power_state
-from nova.notifier import api as notifier_api
+from nova.notifier import api as notifier
from nova.compute.utils import terminate_volumes
from nova.virt import driver
@@ -83,6 +83,10 @@ flags.DEFINE_integer('host_state_interval', 120,
LOG = logging.getLogger('nova.compute.manager')
+def publisher_id(host=None):
+ return notifier.publisher_id("compute", host)
+
+
def checks_instance_lock(function):
"""Decorator to prevent action against locked instances for non-admins."""
@functools.wraps(function)
@@ -181,7 +185,7 @@ class ComputeManager(manager.SchedulerDependentManager):
def get_console_pool_info(self, context, console_type):
return self.driver.get_console_pool_info(console_type)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def refresh_security_group_rules(self, context, security_group_id,
**kwargs):
"""Tell the virtualization driver to refresh security group rules.
@@ -191,7 +195,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
return self.driver.refresh_security_group_rules(security_group_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def refresh_security_group_members(self, context,
security_group_id, **kwargs):
"""Tell the virtualization driver to refresh security group members.
@@ -201,7 +205,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
return self.driver.refresh_security_group_members(security_group_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def refresh_provider_fw_rules(self, context, **_kwargs):
"""This call passes straight through to the virtualization driver."""
return self.driver.refresh_provider_fw_rules()
@@ -218,6 +222,17 @@ class ComputeManager(manager.SchedulerDependentManager):
for bdm in self.db.block_device_mapping_get_all_by_instance(
context, instance_id):
LOG.debug(_("setting up bdm %s"), bdm)
+
+ if bdm['no_device']:
+ continue
+ if bdm['virtual_name']:
+ # TODO(yamahata):
+ # block devices for swap and ephemeralN will be
+ # created by virt driver locally in compute node.
+ assert (bdm['virtual_name'] == 'swap' or
+ bdm['virtual_name'].startswith('ephemeral'))
+ continue
+
if ((bdm['snapshot_id'] is not None) and
(bdm['volume_id'] is None)):
# TODO(yamahata): default name and description
@@ -250,15 +265,6 @@ class ComputeManager(manager.SchedulerDependentManager):
block_device_mapping.append({'device_path': dev_path,
'mount_device':
bdm['device_name']})
- elif bdm['virtual_name'] is not None:
- # TODO(yamahata): ephemeral/swap device support
- LOG.debug(_('block_device_mapping: '
- 'ephemeral device is not supported yet'))
- else:
- # TODO(yamahata): NoDevice support
- assert bdm['no_device']
- LOG.debug(_('block_device_mapping: '
- 'no device is not supported yet'))
return block_device_mapping
@@ -319,10 +325,9 @@ class ComputeManager(manager.SchedulerDependentManager):
self._update_launched_at(context, instance_id)
self._update_state(context, instance_id)
usage_info = utils.usage_from_instance(instance)
- notifier_api.notify('compute.%s' % self.host,
- 'compute.instance.create',
- notifier_api.INFO,
- usage_info)
+ notifier.notify('compute.%s' % self.host,
+ 'compute.instance.create',
+ notifier.INFO, usage_info)
except exception.InstanceNotFound:
# FIXME(wwolf): We are just ignoring InstanceNotFound
# exceptions here in case the instance was immediately
@@ -330,11 +335,11 @@ class ComputeManager(manager.SchedulerDependentManager):
# be fixed once we have no-db-messaging
pass
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def run_instance(self, context, instance_id, **kwargs):
self._run_instance(context, instance_id, **kwargs)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def start_instance(self, context, instance_id):
"""Starting an instance on this host."""
@@ -367,7 +372,7 @@ class ComputeManager(manager.SchedulerDependentManager):
if action_str == 'Terminating':
terminate_volumes(self.db, context, instance_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def terminate_instance(self, context, instance_id):
"""Terminate an instance on this host."""
@@ -377,19 +382,18 @@ class ComputeManager(manager.SchedulerDependentManager):
# TODO(ja): should we keep it in a terminated state for a bit?
self.db.instance_destroy(context, instance_id)
usage_info = utils.usage_from_instance(instance)
- notifier_api.notify('compute.%s' % self.host,
- 'compute.instance.delete',
- notifier_api.INFO,
- usage_info)
+ notifier.notify('compute.%s' % self.host,
+ 'compute.instance.delete',
+ notifier.INFO, usage_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def stop_instance(self, context, instance_id):
"""Stopping an instance on this host."""
self._shutdown_instance(context, instance_id, 'Stopping')
# instance state will be updated to stopped by _poll_instance_states()
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def rebuild_instance(self, context, instance_id, **kwargs):
"""Destroy and re-make this instance.
@@ -419,12 +423,12 @@ class ComputeManager(manager.SchedulerDependentManager):
self._update_state(context, instance_id)
usage_info = utils.usage_from_instance(instance_ref,
image_ref=image_ref)
- notifier_api.notify('compute.%s' % self.host,
+ notifier.notify('compute.%s' % self.host,
'compute.instance.rebuild',
- notifier_api.INFO,
+ notifier.INFO,
usage_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def reboot_instance(self, context, instance_id):
"""Reboot an instance on this host."""
@@ -449,7 +453,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.driver.reboot(instance_ref)
self._update_state(context, instance_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def snapshot_instance(self, context, instance_id, image_id,
image_type='snapshot', backup_type=None,
rotation=None):
@@ -541,7 +545,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.debug(_("Deleting image %d" % image_id))
image_service.delete(context, image_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def set_admin_password(self, context, instance_id, new_pass=None):
"""Set the root/admin password for an instance on this host.
@@ -589,7 +593,7 @@ class ComputeManager(manager.SchedulerDependentManager):
time.sleep(1)
continue
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def inject_file(self, context, instance_id, path, file_contents):
"""Write a file to the specified path in an instance on this host."""
@@ -607,7 +611,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.audit(msg)
self.driver.inject_file(instance_ref, path, file_contents)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def agent_update(self, context, instance_id, url, md5hash):
"""Update agent running on an instance on this host."""
@@ -625,7 +629,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.audit(msg)
self.driver.agent_update(instance_ref, url, md5hash)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def rescue_instance(self, context, instance_id):
"""Rescue an instance on this host."""
@@ -642,7 +646,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.driver.rescue(instance_ref, _update_state)
self._update_state(context, instance_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def unrescue_instance(self, context, instance_id):
"""Rescue an instance on this host."""
@@ -663,7 +667,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""Update instance state when async task completes."""
self._update_state(context, instance_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def confirm_resize(self, context, instance_id, migration_id):
"""Destroys the source instance."""
@@ -671,12 +675,12 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_ref = self.db.instance_get(context, instance_id)
self.driver.destroy(instance_ref)
usage_info = utils.usage_from_instance(instance_ref)
- notifier_api.notify('compute.%s' % self.host,
+ notifier.notify('compute.%s' % self.host,
'compute.instance.resize.confirm',
- notifier_api.INFO,
+ notifier.INFO,
usage_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def revert_resize(self, context, instance_id, migration_id):
"""Destroys the new instance on the destination machine.
@@ -698,7 +702,7 @@ class ComputeManager(manager.SchedulerDependentManager):
'instance_id': instance_id, },
})
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def finish_revert_resize(self, context, instance_id, migration_id):
"""Finishes the second half of reverting a resize.
@@ -723,12 +727,12 @@ class ComputeManager(manager.SchedulerDependentManager):
self.db.migration_update(context, migration_id,
{'status': 'reverted'})
usage_info = utils.usage_from_instance(instance_ref)
- notifier_api.notify('compute.%s' % self.host,
+ notifier.notify('compute.%s' % self.host,
'compute.instance.resize.revert',
- notifier_api.INFO,
+ notifier.INFO,
usage_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def prep_resize(self, context, instance_id, flavor_id):
"""Initiates the process of moving a running instance to another host.
@@ -766,12 +770,12 @@ class ComputeManager(manager.SchedulerDependentManager):
usage_info = utils.usage_from_instance(instance_ref,
new_instance_type=instance_type['name'],
new_instance_type_id=instance_type['id'])
- notifier_api.notify('compute.%s' % self.host,
+ notifier.notify('compute.%s' % self.host,
'compute.instance.resize.prep',
- notifier_api.INFO,
+ notifier.INFO,
usage_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def resize_instance(self, context, instance_id, migration_id):
"""Starts the migration of a running instance to another host."""
@@ -797,7 +801,7 @@ class ComputeManager(manager.SchedulerDependentManager):
'instance_id': instance_id,
'disk_info': disk_info}})
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def finish_resize(self, context, instance_id, migration_id, disk_info):
"""Completes the migration process.
@@ -829,7 +833,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.db.migration_update(context, migration_id,
{'status': 'finished', })
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def add_fixed_ip_to_instance(self, context, instance_id, network_id):
"""Calls network_api to add new fixed_ip to instance
@@ -841,7 +845,19 @@ class ComputeManager(manager.SchedulerDependentManager):
self.inject_network_info(context, instance_id)
self.reset_network(context, instance_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
+ @checks_instance_lock
+ def remove_fixed_ip_from_instance(self, context, instance_id, address):
+ """Calls network_api to remove existing fixed_ip from instance
+ by injecting the altered network info and resetting
+ instance networking.
+ """
+ self.network_api.remove_fixed_ip_from_instance(context, instance_id,
+ address)
+ self.inject_network_info(context, instance_id)
+ self.reset_network(context, instance_id)
+
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def pause_instance(self, context, instance_id):
"""Pause an instance on this host."""
@@ -858,7 +874,7 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_id,
result))
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def unpause_instance(self, context, instance_id):
"""Unpause a paused instance on this host."""
@@ -875,13 +891,13 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_id,
result))
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def set_host_enabled(self, context, instance_id=None, host=None,
enabled=None):
"""Sets the specified host's ability to accept new instances."""
return self.driver.set_host_enabled(host, enabled)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def get_diagnostics(self, context, instance_id):
"""Retrieve diagnostics for an instance on this host."""
instance_ref = self.db.instance_get(context, instance_id)
@@ -890,7 +906,7 @@ class ComputeManager(manager.SchedulerDependentManager):
context=context)
return self.driver.get_diagnostics(instance_ref)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def suspend_instance(self, context, instance_id):
"""Suspend the given instance."""
@@ -906,7 +922,7 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_id,
result))
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def resume_instance(self, context, instance_id):
"""Resume the given suspended instance."""
@@ -922,7 +938,7 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_id,
result))
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def lock_instance(self, context, instance_id):
"""Lock the given instance."""
context = context.elevated()
@@ -930,7 +946,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.debug(_('instance %s: locking'), instance_id, context=context)
self.db.instance_update(context, instance_id, {'locked': True})
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def unlock_instance(self, context, instance_id):
"""Unlock the given instance."""
context = context.elevated()
@@ -938,7 +954,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.debug(_('instance %s: unlocking'), instance_id, context=context)
self.db.instance_update(context, instance_id, {'locked': False})
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def get_lock(self, context, instance_id):
"""Return the boolean state of the given instance's lock."""
context = context.elevated()
@@ -967,7 +983,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.driver.inject_network_info(instance, network_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def get_console_output(self, context, instance_id):
"""Send the console output for the given instance."""
context = context.elevated()
@@ -977,7 +993,7 @@ class ComputeManager(manager.SchedulerDependentManager):
output = self.driver.get_console_output(instance_ref)
return output.decode('utf-8', 'replace').encode('ascii', 'replace')
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def get_ajax_console(self, context, instance_id):
"""Return connection information for an ajax console."""
context = context.elevated()
@@ -985,7 +1001,7 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_ref = self.db.instance_get(context, instance_id)
return self.driver.get_ajax_console(instance_ref)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def get_vnc_console(self, context, instance_id):
"""Return connection information for a vnc console."""
context = context.elevated()
@@ -1048,7 +1064,7 @@ class ComputeManager(manager.SchedulerDependentManager):
return True
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
def _detach_volume(self, context, instance_id, volume_id, destroy_bdm):
"""Detach a volume from an instance."""
@@ -1083,7 +1099,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
self.volume_manager.remove_compute_volume(context, volume_id)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def compare_cpu(self, context, cpu_info):
"""Checks that the host cpu is compatible with a cpu given by xml.
@@ -1094,7 +1110,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
return self.driver.compare_cpu(cpu_info)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def create_shared_storage_test_file(self, context):
"""Makes tmpfile under FLAGS.instance_path.
@@ -1114,7 +1130,7 @@ class ComputeManager(manager.SchedulerDependentManager):
os.close(fd)
return os.path.basename(tmp_file)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def check_shared_storage_test_file(self, context, filename):
"""Confirms existence of the tmpfile under FLAGS.instances_path.
@@ -1126,7 +1142,7 @@ class ComputeManager(manager.SchedulerDependentManager):
if not os.path.exists(tmp_file):
raise exception.FileNotFound(file_path=tmp_file)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def cleanup_shared_storage_test_file(self, context, filename):
"""Removes existence of the tmpfile under FLAGS.instances_path.
@@ -1137,7 +1153,7 @@ class ComputeManager(manager.SchedulerDependentManager):
tmp_file = os.path.join(FLAGS.instances_path, filename)
os.remove(tmp_file)
- @exception.wrap_exception
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def update_available_resource(self, context):
"""See comments update_resource_info.