summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-09-14 15:30:27 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-09-14 15:30:27 -0700
commitf31748460180aeff00f08b70b6134b63faf293fa (patch)
tree253efbae9d1185df763d354d9c2f0c6214845c9c /nova/compute
parentd0daaaa320ecb408e721d5e856676a87d7e98ea6 (diff)
parentb7997e4f3257304229045d75e23749520630ed10 (diff)
merge trunk
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py8
-rw-r--r--nova/compute/manager.py7
2 files changed, 9 insertions, 6 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 4e2944bb7..4220f47ae 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -202,7 +202,8 @@ class API(base.Base):
self._check_injected_file_quota(context, injected_files)
self._check_requested_networks(context, requested_networks)
- (image_service, image_id) = nova.image.get_image_service(image_href)
+ (image_service, image_id) = nova.image.get_image_service(context,
+ image_href)
image = image_service.show(context, image_id)
config_drive_id = None
@@ -1042,13 +1043,14 @@ class API(base.Base):
return recv_meta
@scheduler_api.reroute_compute("reboot")
- def reboot(self, context, instance_id):
+ def reboot(self, context, instance_id, reboot_type):
"""Reboot the given instance."""
self.update(context,
instance_id,
vm_state=vm_states.ACTIVE,
task_state=task_states.REBOOTING)
- self._cast_compute_message('reboot_instance', context, instance_id)
+ self._cast_compute_message('reboot_instance', context, instance_id,
+ params={'reboot_type': reboot_type})
@scheduler_api.reroute_compute("rebuild")
def rebuild(self, context, instance_id, image_href, admin_password,
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 0477db745..7915830ec 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -322,7 +322,8 @@ class ComputeManager(manager.SchedulerDependentManager):
# used by the image service. This should be refactored to be
# consistent.
image_href = instance['image_ref']
- image_service, image_id = nova.image.get_image_service(image_href)
+ image_service, image_id = nova.image.get_image_service(context,
+ image_href)
image_meta = image_service.show(context, image_id)
try:
@@ -579,7 +580,7 @@ class ComputeManager(manager.SchedulerDependentManager):
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
- def reboot_instance(self, context, instance_id):
+ def reboot_instance(self, context, instance_id, reboot_type="SOFT"):
"""Reboot an instance on this host."""
LOG.audit(_("Rebooting instance %s"), instance_id, context=context)
context = context.elevated()
@@ -601,7 +602,7 @@ class ComputeManager(manager.SchedulerDependentManager):
context=context)
network_info = self._get_instance_nw_info(context, instance_ref)
- self.driver.reboot(instance_ref, network_info)
+ self.driver.reboot(instance_ref, network_info, reboot_type)
current_power_state = self._get_power_state(context, instance_ref)
self._instance_update(context,