Revision 39e7aaf2

View differences:

src/flow/etc/oneflow-server.conf
30 30
:host: 127.0.0.1
31 31
:port: 2474
32 32

  
33
# Force deletion of VMs on terminate signal
34
:force_deletion: true
35

  
33 36
################################################################################
34 37
# Defaults
35 38
################################################################################
src/flow/lib/models/role.rb
349 349
                rc = vm.terminate(true)
350 350

  
351 351
                if OpenNebula.is_error?(rc)
352
                    rc = vm.delete
352
                    if @@force_deletion
353
                        rc = vm.delete
354
                    end
353 355
                end
354 356

  
355 357
                if OpenNebula.is_error?(rc)
......
600 602
            @@default_shutdown = shutdown_action
601 603
        end
602 604

  
605
        def self.init_force_deletion(force_deletion)
606
            @@force_deletion = force_deletion
607
        end
608

  
603 609
        def self.init_default_vm_name_template(vm_name_template)
604 610
            @@vm_name_template = vm_name_template
605 611
        end
src/flow/oneflow-server.rb
124 124

  
125 125
Role.init_default_cooldown(conf[:default_cooldown])
126 126
Role.init_default_shutdown(conf[:shutdown_action])
127
Role.init_force_deletion(conf[:force_deletion])
127 128

  
128 129
conf[:vm_name_template] ||= DEFAULT_VM_NAME_TEMPLATE
129 130
Role.init_default_vm_name_template(conf[:vm_name_template])

Also available in: Unified diff