diff --git a/src/flow/etc/oneflow-server.conf b/src/flow/etc/oneflow-server.conf index 1ec088608f..ea20b5f973 100644 --- a/src/flow/etc/oneflow-server.conf +++ b/src/flow/etc/oneflow-server.conf @@ -37,8 +37,8 @@ # Default cooldown period after a scale operation, in seconds :default_cooldown: 300 -# Default shutdown action. Values: 'shutdown', 'shutdown-hard' -:shutdown_action: 'shutdown' +# Default shutdown action. Values: 'terminate', 'terminate-hard' +:shutdown_action: 'terminate' # Default number of virtual machines (action_number) that will receive the # given call in each interval defined by action_period, when an action diff --git a/src/flow/lib/models/role.rb b/src/flow/lib/models/role.rb index d01b6c5214..3238b024b1 100644 --- a/src/flow/lib/models/role.rb +++ b/src/flow/lib/models/role.rb @@ -28,8 +28,8 @@ module OpenNebula # Actions that can be performed on the VMs of a given Role SCHEDULE_ACTIONS = [ - 'shutdown', - 'shutdown-hard', + 'terminate', + 'terminate-hard', 'undeploy', 'undeploy-hard', 'hold', @@ -37,8 +37,6 @@ module OpenNebula 'stop', 'suspend', 'resume', - 'delete', - 'delete-recreate', 'reboot', 'reboot-hard', 'poweroff', @@ -315,12 +313,12 @@ module OpenNebula return [true, nil] end - # Shutdown all the nodes in this role + # Terminate all the nodes in this role # - # @param scale_down [true, false] true to shutdown and dispose the + # @param scale_down [true, false] true to terminate and dispose the # number of VMs needed to get down to cardinality nodes # @return [Array, Array] true if all the VMs - # were shutdown, false and the error reason if there was a problem + # were terminated, false and the error reason if there was a problem # shutting down the VMs def shutdown(scale_down=false) success = true @@ -348,10 +346,10 @@ module OpenNebula Log.debug LOG_COMP, "Role #{name} : Deleting VM #{vm_id}", @service.id() vm = OpenNebula::VirtualMachine.new_with_id(vm_id, @service.client) - rc = vm.shutdown(true) + rc = vm.terminate(true) if OpenNebula.is_error?(rc) - rc = vm.finalize + rc = vm.delete end if OpenNebula.is_error?(rc) @@ -553,7 +551,7 @@ module OpenNebula if diff > 0 return deploy(true) elsif diff < 0 - return shutdown(true) + return terminate(true) end return [true, nil] @@ -886,7 +884,7 @@ module OpenNebula elsif ( Role.vm_failure?(vm_state, lcm_state) ) vm = OpenNebula::VirtualMachine.new_with_id(vm_id, @service.client) - rc = vm.finalize + rc = vm.shutdown(true) if !OpenNebula.is_error?(rc) # Store the VM id in the array of disposed nodes @@ -933,14 +931,14 @@ module OpenNebula nodes.each { |node| vm_id = node['deploy_id'] - Log.debug LOG_COMP, "Role #{name} : Shutting down VM #{vm_id}", @service.id() + Log.debug LOG_COMP, "Role #{name} : Terminating VM #{vm_id}", @service.id() vm = OpenNebula::VirtualMachine.new_with_id(vm_id, @service.client) - if action == 'shutdown-hard' - rc = vm.shutdown(true) + if action == 'terminate-hard' + rc = vm.terminate(true) else - rc = vm.shutdown + rc = vm.terminate end if scale_down @@ -948,11 +946,17 @@ module OpenNebula end if OpenNebula.is_error?(rc) - msg = "Role #{name} : Shutdown failed for VM #{vm_id}, will perform a Delete; #{rc.message}" + msg = "Role #{name} : Terminate failed for VM #{vm_id}, will perform a Delete; #{rc.message}" Log.error LOG_COMP, msg, @service.id() @service.log_error(msg) - rc = vm.finalize + if action != 'terminate-hard' + rc = vm.terminate(true) + end + + 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}" @@ -965,7 +969,7 @@ module OpenNebula Log.debug LOG_COMP, "Role #{name} : Delete success for VM #{vm_id}", @service.id() end else - Log.debug LOG_COMP, "Role #{name} : Shutdown success for VM #{vm_id}", @service.id() + Log.debug LOG_COMP, "Role #{name} : Terminate success for VM #{vm_id}", @service.id() end } end diff --git a/src/flow/lib/models/service_template.rb b/src/flow/lib/models/service_template.rb index a6a8610725..39e7f2affc 100644 --- a/src/flow/lib/models/service_template.rb +++ b/src/flow/lib/models/service_template.rb @@ -48,7 +48,7 @@ module OpenNebula }, 'shutdown_action' => { :type => :string, - :enum => %w{shutdown shutdown-hard}, + :enum => %w{terminate terminate-hard shutdown shutdown-hard}, :required => false }, 'min_vms' => { @@ -158,7 +158,7 @@ module OpenNebula }, 'shutdown_action' => { :type => :string, - :enum => %w{shutdown shutdown-hard}, + :enum => %w{terminate terminate-hard shutdown shutdown-hard}, :required => false }, 'roles' => { diff --git a/src/flow/oneflow-server.rb b/src/flow/oneflow-server.rb index 8ea951078b..90f2921d89 100644 --- a/src/flow/oneflow-server.rb +++ b/src/flow/oneflow-server.rb @@ -65,7 +65,7 @@ end conf[:debug_level] ||= 2 conf[:lcm_interval] ||= 30 conf[:default_cooldown] ||= 300 -conf[:shutdown_action] ||= 'shutdown' +conf[:shutdown_action] ||= 'terminate' conf[:action_number] ||= 1 conf[:action_period] ||= 60 diff --git a/src/oca/ruby/opennebula/oneflow_client.rb b/src/oca/ruby/opennebula/oneflow_client.rb index 1e777f2e31..e9220318af 100644 --- a/src/oca/ruby/opennebula/oneflow_client.rb +++ b/src/oca/ruby/opennebula/oneflow_client.rb @@ -22,8 +22,8 @@ include CloudCLI module Role # Actions that can be performed on the VMs of a given Role SCHEDULE_ACTIONS = [ - 'shutdown', - 'shutdown-hard', + 'terminate', + 'terminate-hard', 'undeploy', 'undeploy-hard', 'hold', @@ -31,8 +31,6 @@ module Role 'stop', 'suspend', 'resume', - 'delete', - 'delete-recreate', 'reboot', 'reboot-hard', 'poweroff', @@ -114,7 +112,7 @@ module Service end # Build a json specifying an action - # @param [String] perform action to be performed (i.e: shutdowm) + # @param [String] perform action to be performed (e.g.: shutdown) # @param [Hash, nil] params contains the params for the action # @return [String] json representing the action def self.build_json_action(perform, params=nil) diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index c6e5c19cce..8f5e194fba 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -293,10 +293,8 @@ tabs: Role.poweroff_hard: true Role.undeploy: true Role.undeploy_hard: true - Role.shutdown: true - Role.shutdown_hard: true - Role.delete: true - Role.delete_recreate: true + Role.terminate: true + Role.terminate_hard: true RoleVM.hold: true RoleVM.release: true RoleVM.suspend: true @@ -308,10 +306,8 @@ tabs: RoleVM.poweroff_hard: true RoleVM.undeploy: true RoleVM.undeploy_hard: true - RoleVM.shutdown: true - RoleVM.shutdown_hard: true - RoleVM.delete: true - RoleVM.delete_recreate: true + RoleVM.terminate: true + RoleVM.terminate_hard: true RoleVM.resched: true RoleVM.unresched: true RoleVM.recover: true diff --git a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml index e495e74afc..99915629fa 100644 --- a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml @@ -293,10 +293,8 @@ tabs: Role.poweroff_hard: true Role.undeploy: true Role.undeploy_hard: true - Role.shutdown: true - Role.shutdown_hard: true - Role.delete: true - Role.delete_recreate: true + Role.terminate: true + Role.terminate_hard: true RoleVM.hold: true RoleVM.release: true RoleVM.suspend: true @@ -308,10 +306,8 @@ tabs: RoleVM.poweroff_hard: true RoleVM.undeploy: true RoleVM.undeploy_hard: true - RoleVM.shutdown: true - RoleVM.shutdown_hard: true - RoleVM.delete: true - RoleVM.delete_recreate: true + RoleVM.terminate: true + RoleVM.terminate_hard: true RoleVM.resched: true RoleVM.unresched: true RoleVM.recover: true diff --git a/src/sunstone/etc/sunstone-views/groupadmin.yaml b/src/sunstone/etc/sunstone-views/groupadmin.yaml index b894917038..7786cf988d 100644 --- a/src/sunstone/etc/sunstone-views/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/groupadmin.yaml @@ -292,10 +292,8 @@ tabs: Role.poweroff_hard: true Role.undeploy: true Role.undeploy_hard: true - Role.shutdown: true - Role.shutdown_hard: true - Role.delete: true - Role.delete_recreate: false + Role.terminate: true + Role.terminate_hard: true RoleVM.hold: true RoleVM.release: true RoleVM.suspend: false @@ -307,10 +305,8 @@ tabs: RoleVM.poweroff_hard: true RoleVM.undeploy: true RoleVM.undeploy_hard: true - RoleVM.shutdown: true - RoleVM.shutdown_hard: true - RoleVM.delete: true - RoleVM.delete_recreate: false + RoleVM.terminate: true + RoleVM.terminate_hard: true RoleVM.resched: false RoleVM.unresched: false RoleVM.recover: false diff --git a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml index 3abfd73456..78d0328215 100644 --- a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml @@ -294,10 +294,8 @@ tabs: Role.poweroff_hard: true Role.undeploy: true Role.undeploy_hard: true - Role.shutdown: true - Role.shutdown_hard: true - Role.delete: true - Role.delete_recreate: false + Role.terminate: true + Role.terminate_hard: true RoleVM.hold: true RoleVM.release: true RoleVM.suspend: false @@ -309,10 +307,8 @@ tabs: RoleVM.poweroff_hard: true RoleVM.undeploy: true RoleVM.undeploy_hard: true - RoleVM.shutdown: true - RoleVM.shutdown_hard: true - RoleVM.delete: true - RoleVM.delete_recreate: false + RoleVM.terminate: true + RoleVM.terminate_hard: true RoleVM.resched: false RoleVM.unresched: false RoleVM.recover: false diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index ff6742b87b..8ec0154cf2 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -296,10 +296,8 @@ tabs: Role.poweroff_hard: true Role.undeploy: true Role.undeploy_hard: true - Role.shutdown: true - Role.shutdown_hard: true - Role.delete: true - Role.delete_recreate: true + Role.terminate: true + Role.terminate_hard: true RoleVM.hold: true RoleVM.release: true RoleVM.suspend: true @@ -311,10 +309,8 @@ tabs: RoleVM.poweroff_hard: true RoleVM.undeploy: true RoleVM.undeploy_hard: true - RoleVM.shutdown: true - RoleVM.shutdown_hard: true - RoleVM.delete: true - RoleVM.delete_recreate: true + RoleVM.terminate: true + RoleVM.terminate_hard: true RoleVM.resched: false RoleVM.unresched: false RoleVM.recover: false diff --git a/src/sunstone/public/app/opennebula/role.js b/src/sunstone/public/app/opennebula/role.js index e2868b9072..a9532bb9d5 100644 --- a/src/sunstone/public/app/opennebula/role.js +++ b/src/sunstone/public/app/opennebula/role.js @@ -97,13 +97,6 @@ define(function(require) { generate_batch_action_params(), PATH); }, - "delete_recreate" : function(params) { - OpenNebulaAction.simple_action(params, - RESOURCE, - "delete-recreate", - generate_batch_action_params(), - PATH); - }, "reboot" : function(params) { OpenNebulaAction.simple_action(params, RESOURCE, @@ -153,24 +146,17 @@ define(function(require) { generate_batch_action_params(), PATH); }, - "shutdown" : function(params) { + "terminate" : function(params) { OpenNebulaAction.simple_action(params, RESOURCE, - "shutdown", + "terminate", generate_batch_action_params(), PATH); }, - "shutdown_hard" : function(params) { + "terminate_hard" : function(params) { OpenNebulaAction.simple_action(params, RESOURCE, - "shutdown-hard", - generate_batch_action_params(), - PATH); - }, - "del" : function(params) { - OpenNebulaAction.simple_action(params, - RESOURCE, - "delete", + "terminate-hard", generate_batch_action_params(), PATH); }, diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js index f3b3827fd3..90092ae458 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js @@ -157,24 +157,6 @@ define(function(require) { notify: true }, - "Role.reboot_hard" : { - type: "multiple", - call: OpenNebulaRole.reboot_hard, - callback: roleCallback, - elements: roleElements, - error: Notifier.onError, - notify: true - }, - - "Role.delete_recreate" : { - type: "multiple", - call: OpenNebulaRole.delete_recreate, - callback: roleCallback, - elements: roleElements, - error: Notifier.onError, - notify: true - }, - "Role.reboot" : { type: "multiple", call: OpenNebulaRole.reboot, @@ -184,6 +166,15 @@ define(function(require) { notify: true }, + "Role.reboot_hard" : { + type: "multiple", + call: OpenNebulaRole.reboot_hard, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + "Role.poweroff" : { type: "multiple", call: OpenNebulaRole.poweroff, @@ -228,18 +219,18 @@ define(function(require) { notify: true }, - "Role.shutdown" : { + "Role.terminate" : { type: "multiple", - call: OpenNebulaRole.shutdown, + call: OpenNebulaRole.terminate, callback: roleCallback, elements: roleElements, error: Notifier.onError, notify: true }, - "Role.shutdown_hard" : { + "Role.terminate_hard" : { type: "multiple", - call: OpenNebulaRole.shutdown_hard, + call: OpenNebulaRole.terminate_hard, callback: roleCallback, elements: roleElements, error: Notifier.onError, @@ -401,27 +392,18 @@ define(function(require) { notify: true }, - "RoleVM.shutdown" : { + "RoleVM.terminate" : { type: "multiple", - call: OpenNebulaVM.shutdown, + call: OpenNebulaVM.terminate, callback: roleCallback, elements: roleVMElements, error: Notifier.onError, notify: true }, - "RoleVM.shutdown_hard" : { + "RoleVM.terminate_hard" : { type: "multiple", - call: OpenNebulaVM.shutdown_hard, - callback: roleCallback, - elements: roleVMElements, - error: Notifier.onError, - notify: true - }, - - "RoleVM.delete" : { - type: "multiple", - call: OpenNebulaVM.del, + call: OpenNebulaVM.terminate_hard, callback: roleCallback, elements: roleVMElements, error: Notifier.onError, diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs index 77b896baec..7b17762c40 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs @@ -18,24 +18,24 @@
{{#if servicePanel}}
-
+
+
+
-
+
- +
-
+
- +
-
-
{{/if}}
diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js index 9b280d2a59..a6aca412ab 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js @@ -89,29 +89,17 @@ define(function(require) { layout: "vmsstop_buttons", tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore.") }, - "Role.shutdown" : { + "Role.terminate" : { type: "action", - text: Locale.tr("Shutdown"), + text: Locale.tr("Terminate"), layout: "vmsdelete_buttons", - tip: Locale.tr("This will initiate the shutdown process in the selected VMs") + tip: Locale.tr("This will initiate the terminate process in the selected VMs") }, - "Role.shutdown_hard" : { + "Role.terminate_hard" : { type: "action", - text: Locale.tr("Shutdown") + ' hard', + text: Locale.tr("Terminate") + ' hard', layout: "vmsdelete_buttons", - tip: Locale.tr("This will initiate the shutdown-hard (forced) process in the selected VMs") - }, - "Role.delete" : { - type: "action", - text: Locale.tr("Delete"), - layout: "vmsdelete_buttons", - tip: Locale.tr("This will delete the selected VMs from the database") - }, - "Role.delete_recreate" : { - type: "action", - text: Locale.tr("Delete") + ' recreate', - layout: "vmsrepeat_buttons", - tip: Locale.tr("This will delete and recreate VMs to PENDING state") + tip: Locale.tr("This will initiate the terminate-hard (forced) process in the selected VMs") } }; diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-vm-buttons.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-vm-buttons.js index aded90c6f9..19395f51d3 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-vm-buttons.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-vm-buttons.js @@ -30,10 +30,8 @@ define(function(require) { "RoleVM.poweroff_hard" : VMButtons["VM.poweroff_hard"], "RoleVM.undeploy" : VMButtons["VM.undeploy"], "RoleVM.undeploy_hard" : VMButtons["VM.undeploy_hard"], - "RoleVM.shutdown" : VMButtons["VM.shutdown"], - "RoleVM.shutdown_hard" : VMButtons["VM.shutdown_hard"], - "RoleVM.delete" : VMButtons["VM.delete"], - "RoleVM.delete_recreate" : VMButtons["VM.delete_recreate"], + "RoleVM.terminate" : VMButtons["VM.terminate"], + "RoleVM.terminate_hard" : VMButtons["VM.terminate_hard"], "RoleVM.resched" : VMButtons["VM.resched"], "RoleVM.unresched" : VMButtons["VM.unresched"] }; diff --git a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/create/wizard.hbs index c8c9a8f925..6f69616216 100644 --- a/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/oneflow-templates-tab/form-panels/create/wizard.hbs @@ -78,12 +78,12 @@
diff --git a/src/sunstone/public/app/tabs/oneflow-templates-tab/utils/role-tab/html.hbs b/src/sunstone/public/app/tabs/oneflow-templates-tab/utils/role-tab/html.hbs index b25cf6ad6a..61d5fed0d9 100644 --- a/src/sunstone/public/app/tabs/oneflow-templates-tab/utils/role-tab/html.hbs +++ b/src/sunstone/public/app/tabs/oneflow-templates-tab/utils/role-tab/html.hbs @@ -198,12 +198,12 @@