← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1254620] Re: Split reboot to hard_reboot and soft_reboot

 

** Changed in: nova
       Status: In Progress => Opinion

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1254620

Title:
  Split reboot to hard_reboot and soft_reboot

Status in OpenStack Compute (Nova):
  Opinion

Bug description:
  It is a left issue related to patch
  https://review.openstack.org/#/c/51130/4

  From Mark: I'd be tempted to split out hard_reboot() and soft_reboot()
  methods and use the check_instance_state() decorator to check
  hard/soft reboot specific states ... but it wouldn't be appropriate to
  mix that up with this fix

  Now in compute api part, nova using reboot() to handle both soft and
  hard reboot, but soft and hard reboot need check instance in different
  state, so it is better to split reboot() to hard_reboot() and
  soft_reboot() and use the  check_instance_state() decorator to check
  hard/soft reboot specific states.

  @wrap_check_policy
      @check_instance_lock
      @check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED,
                                      vm_states.PAUSED, vm_states.SUSPENDED,
                                      vm_states.ERROR],
                            task_state=[None, task_states.REBOOTING,
                                        task_states.REBOOTING_HARD,
                                        task_states.RESUMING,
                                        task_states.UNPAUSING,
                                        task_states.PAUSING,
                                        task_states.SUSPENDING])
      def reboot(self, context, instance, reboot_type):
          """Reboot the given instance."""
          if (reboot_type == 'SOFT' and
                  (instance['vm_state'] in [vm_states.STOPPED,
                                            vm_states.PAUSED,
                                            vm_states.SUSPENDED,
                                            vm_states.ERROR])):
              raise exception.InstanceInvalidState(
                  attr='vm_state',
                  instance_uuid=instance['uuid'],
                  state=instance['vm_state'],
                  method='reboot')
          if ((reboot_type == 'SOFT' and
                  instance['task_state'] == task_states.REBOOTING) or
              (reboot_type == 'HARD' and
                  instance['task_state'] == task_states.REBOOTING_HARD)):
              raise exception.InstanceInvalidState(
                  attr='task_state',
                  instance_uuid=instance['uuid'],

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1254620/+subscriptions