Can not suspend or resume anymore when failed

Bug #1469927 reported by huangtianhua
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
huangtianhua

Bug Description

1. create a stack with nova server
2. suspend the stack, failed due to some reasons, the stack went to 'SUSPEND_FAILED' state, and the resource(nova server) went to 'SUSPEND_FAILED' state
3. then we can't suspend the stack anymore, because the resource(nova server) status is not COMPLETE:
   def suspend(self):
        '''
        Suspend the resource. Subclasses should provide a handle_suspend()
        method to implement suspend
        '''
        action = self.SUSPEND

        # Don't try to suspend the resource unless it's in a stable state
        if (self.action == self.DELETE or self.status != self.COMPLETE):
            exc = exception.Error(_('State %s invalid for suspend')
                                  % six.text_type(self.state))
            raise exception.ResourceFailure(exc, self, action)

         .... (DO SUSPEND)

4. stack resume has the same problem.
    May be the state check for suspend should be:
          if (self.action == self.DELETE or (self.acton != self.SUSPEND and self.status != self.COMPLETE)):
            exc = exception.Error(_('State %s invalid for suspend')
                                  % six.text_type(self.state))
            raise exception.ResourceFailure(exc, self, action)
          .... (DO SUSPEND)

    the state check for resume should be:
         if self.state not in ((self.SUSPEND, self.COMPLETE), (self.RESUME, self.FAILED)):
            exc = exception.Error(_('State %s invalid for resume')
                                  % six.text_type(self.state))
            raise exception.ResourceFailure(exc, self, action)
         ...... (DO RESUME)

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → Medium
milestone: none → liberty-2
Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.