Bug #5397

OneFlow sends a delete to VMs if terminate fails

Added by OpenNebula Systems Support Team about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:09/25/2017
Priority:NormalDue date:
Assignee:Abel Coronado% Done:

100%

Category:OneFlow
Target version:Release 5.4.3
Resolution:fixed Pull request:
Affected Versions:OpenNebula 5.4

Description

This behavior should be configurable as it can leave VMs running in nodes that are not reachable or in race condition cases.

        # Delete all the nodes in this role
        # @return [Array<true, nil>] All the VMs are deleted, and the return
        #   ignored
        def delete
            get_nodes.each { |node|
                vm_id = node['deploy_id']

                Log.debug LOG_COMP, "Role #{name} : Deleting VM #{vm_id}", @service.id()

                vm = OpenNebula::VirtualMachine.new_with_id(vm_id, @service.client)
                rc = vm.terminate(true)

                if OpenNebula.is_error?(rc)
                    rc = vm.delete
                end

                if OpenNebula.is_error?(rc)
                    msg = "Role #{name} : Delete failed for VM #{vm_id}; #{rc.message}" 
                    Log.error LOG_COMP, msg, @service.id()
                    @service.log_error(msg)
                else
                    Log.debug LOG_COMP, "Role #{name} : Delete success for VM #{vm_id}", @service.id()
                end
            }

            return [true, nil]
        end

Associated revisions

Revision 39e7aaf2
Added by Abel Coronado about 3 years ago

B #5397: Deletion force configurable (OneFlow service) (#514)

Revision 0dfed104
Added by Abel Coronado about 3 years ago

B #5397: Deletion force configurable (OneFlow service) (#514)

(cherry picked from commit 39e7aaf2662403da12bf050476124b23105f6b72)

History

#1 Updated by Abel Coronado about 3 years ago

  • Assignee set to Abel Coronado
  • Target version set to Release 5.4.2

#2 Updated by Abel Coronado about 3 years ago

  • % Done changed from 0 to 100

#3 Updated by OpenNebula Systems Support Team about 3 years ago

  • % Done changed from 100 to 90

Needs documentation

#4 Updated by Ruben S. Montero about 3 years ago

  • Target version changed from Release 5.4.2 to Release 5.4.3

#5 Updated by Abel Coronado about 3 years ago

  • % Done changed from 90 to 100

force-deletion documentation added

#6 Updated by Ruben S. Montero about 3 years ago

  • Status changed from Pending to Closed
  • Resolution set to fixed

Also available in: Atom PDF