1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

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

This commit is contained in:
Abel Coronado 2017-10-05 12:40:02 +02:00 committed by Tino Vázquez
parent ac0d1dc6d2
commit 39e7aaf266
3 changed files with 11 additions and 1 deletions

View File

@ -30,6 +30,9 @@
:host: 127.0.0.1
:port: 2474
# Force deletion of VMs on terminate signal
:force_deletion: true
################################################################################
# Defaults
################################################################################

View File

@ -349,7 +349,9 @@ module OpenNebula
rc = vm.terminate(true)
if OpenNebula.is_error?(rc)
rc = vm.delete
if @@force_deletion
rc = vm.delete
end
end
if OpenNebula.is_error?(rc)
@ -600,6 +602,10 @@ module OpenNebula
@@default_shutdown = shutdown_action
end
def self.init_force_deletion(force_deletion)
@@force_deletion = force_deletion
end
def self.init_default_vm_name_template(vm_name_template)
@@vm_name_template = vm_name_template
end

View File

@ -124,6 +124,7 @@ end
Role.init_default_cooldown(conf[:default_cooldown])
Role.init_default_shutdown(conf[:shutdown_action])
Role.init_force_deletion(conf[:force_deletion])
conf[:vm_name_template] ||= DEFAULT_VM_NAME_TEMPLATE
Role.init_default_vm_name_template(conf[:vm_name_template])