+
+ {{tr "This action will power off this Virtual Machine. The Virtual Machine will remain in the poweroff state, and can be powered on later"}}
+ {{#if opts.both}}
+
+
+ {{tr "You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer)."}}
+ {{/if}}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_reboot.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_reboot.hbs
new file mode 100644
index 0000000000..81a3086e0d
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_reboot.hbs
@@ -0,0 +1,47 @@
+
+
+
+
+ {{tr "This action will reboot this Virtual Machine."}}
+ {{#if opts.both}}
+
+
+ {{tr "You can send the reboot signal to the Virtual Machine (this is equivalent to execute the reboot command form the console). If that doesn't affect your Virtual Machine, try to Reboot the machine (this is equivalent to pressing the reset button a physical computer)."}}
+ {{/if}}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_save_as_template.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_save_as_template.hbs
new file mode 100644
index 0000000000..e267b02d6e
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_save_as_template.hbs
@@ -0,0 +1,55 @@
+
+
+
+
+ {{tr "This Virtual Machine will be saved in a new Template."}}
+
+ {{tr "You can then create a new Virtual Machine using this Template."}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{tr "The new Virtual Machine's disks can be made persistent. In a persistent Virtual Machine the changes made survive after it is destroyed. On the other hand, you cannot create more than one simultaneous Virtual Machine from a Template with persistent disks."}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_terminate.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_terminate.hbs
new file mode 100644
index 0000000000..315c9d6f52
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_terminate.hbs
@@ -0,0 +1,47 @@
+
+
+
+
+ {{tr "Be careful, this action will shutdown and destroy your Virtual Machine"}}
+ {{#if opts.both}}
+
+
+ {{tr "You can send the shutdown signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to terminate the machine (this is equivalent to pressing the power off button in a physical computer)."}}
+ {{/if}}
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/confirm_undeploy.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_undeploy.hbs
new file mode 100644
index 0000000000..831ae7f22d
--- /dev/null
+++ b/src/sunstone/public/app/tabs/provision-tab/vms/confirm_undeploy.hbs
@@ -0,0 +1,47 @@
+
+
+
+
+ {{tr "This action will power off this Virtual Machine and will be undeployed from the physical machine"}}
+ {{#if opts.both}}
+
+
+ {{tr "You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer)."}}
+ {{/if}}
+
+
'+
- ''+
- Locale.tr("This Virtual Machine will be saved in a new Template.")+
- ' '+
- Locale.tr("You can then create a new Virtual Machine using this Template.")+
- ''+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- ''+
- Locale.tr("The new Virtual Machine's disks can be made persistent. In a persistent Virtual Machine the changes made survive after it is destroyed. On the other hand, you cannot create more than one simultaneous Virtual Machine from a Template with persistent disks.")+
- ''+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- ''+Locale.tr("Save Virtual Machine to Template")+''+
- '
'+
- ''+
- Locale.tr("Be careful, this action will immediately destroy your Virtual Machine")+
- ' '+
- Locale.tr("All the information will be lost!")+
- ''+
- '
'+
- ''+
- Locale.tr("Be careful, this action will immediately destroy your Virtual Machine")+
- ' '+
- Locale.tr("All the information will be lost!")+
- ''+
- '
'+
- ''+
- Locale.tr("This action will power off this Virtual Machine. The Virtual Machine will remain in the poweroff state, and can be powered on later")+
- ' '+
- ' '+
- Locale.tr("You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't effect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer).")+
- ''+
- '
'+
- ''+
- Locale.tr("This action will power off this Virtual Machine and will be undeployed from the physical machine")+
- ' '+
- ' '+
- Locale.tr("You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't effect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer).")+
- ''+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- ''+Locale.tr("Power off and undeploy")+''+
- '
'+
- ''+
- Locale.tr("This action will reboot this Virtual Machine.")+
- ' '+
- ' '+
- Locale.tr("You can send the reboot signal to the Virtual Machine (this is equivalent to execute the reboot command form the console). If that doesn't effect your Virtual Machine, try to Reboot the machine (this is equivalent to pressing the reset button a physical computer).")+
- ''+
- '
'+
- '
'+
- ' '+
- '
'+
- '
'+
- ''+Locale.tr("Reboot")+''+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- ''+
- '
'+
- '
'+
- '
'+
- '
'+
- '' +
- '×' +
- ''+
- '
');
+ var data = $(".provision_info_vm", context).data("vm");
+
+ var hard = Config.isTabActionEnabled("provision-tab", "VM.reboot_hard") &&
+ StateActions.enabledStateAction("VM.reboot_hard", data.STATE, data.LCM_STATE);
+
+ var soft = Config.isTabActionEnabled("provision-tab", "VM.reboot") &&
+ StateActions.enabledStateAction("VM.reboot", data.STATE, data.LCM_STATE);
+
+ var opts = {};
+
+ if(hard && soft){
+ opts.both = true;
+ } else if(hard){
+ opts.hard = true;
+ }
+
+ $(".provision_confirm_action:first", context).html(TemplateConfirmReboot({opts: opts}));
});
- context.on("click", ".provision_delete_button", function(){
+ context.on("click", ".provision_terminate_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
+ var terminate_action = $('input[name=provision_terminate_radio]:checked').val()
- OpenNebula.VM.del({
+ OpenNebula.VM[terminate_action]({
data : {
id: vm_id
},
success: function(request, response){
- $(".provision_back", context).click();
- $(".provision_vms_list_refresh_button", context).click();
- button.removeAttr("disabled");
- },
- error: function(request, response){
- Notifier.onError(request, response);
- button.removeAttr("disabled");
- }
- })
-
- return false;
- });
-
- context.on("click", ".provision_shutdownhard_button", function(){
- var button = $(this);
- button.attr("disabled", "disabled");
- var vm_id = $(".provision_info_vm", context).attr("vm_id");
-
- OpenNebula.VM.shutdown_hard({
- data : {
- id: vm_id
- },
- success: function(request, response){
- $(".provision_back", context).click();
- $(".provision_vms_list_refresh_button", context).click();
+ update_provision_vm_info(vm_id, context);
button.removeAttr("disabled");
},
error: function(request, response){
@@ -861,7 +690,7 @@ define(function(require) {
return false;
});
- context.on("click", ".provision_poweron_button", function(){
+ context.on("click", ".provision_resume_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
diff --git a/src/sunstone/public/app/tabs/vms-tab/actions.js b/src/sunstone/public/app/tabs/vms-tab/actions.js
index 5184c7f116..aa2dde4ab8 100644
--- a/src/sunstone/public/app/tabs/vms-tab/actions.js
+++ b/src/sunstone/public/app/tabs/vms-tab/actions.js
@@ -56,24 +56,21 @@ define(function(require) {
error: Notifier.onError
},
"VM.refresh": _commonActions.refresh(),
- "VM.delete": _commonActions.del(),
"VM.chown": _commonActions.multipleAction('chown'),
"VM.chgrp": _commonActions.multipleAction('chgrp'),
-
"VM.hold": _commonActions.multipleAction('hold'),
"VM.release": _commonActions.multipleAction('release'),
"VM.suspend": _commonActions.multipleAction('suspend'),
"VM.resume": _commonActions.multipleAction('resume'),
"VM.stop": _commonActions.multipleAction('stop'),
- "VM.reboot_hard": _commonActions.multipleAction('reset'),
- "VM.delete_recreate": _commonActions.multipleAction('resubmit'),
"VM.reboot": _commonActions.multipleAction('reboot'),
+ "VM.reboot_hard": _commonActions.multipleAction('reboot_hard'),
"VM.poweroff": _commonActions.multipleAction('poweroff'),
"VM.poweroff_hard": _commonActions.multipleAction('poweroff_hard'),
"VM.undeploy": _commonActions.multipleAction('undeploy'),
"VM.undeploy_hard": _commonActions.multipleAction('undeploy_hard'),
- "VM.shutdown": _commonActions.multipleAction('shutdown'),
- "VM.shutdown_hard": _commonActions.multipleAction('shutdown_hard'),
+ "VM.terminate": _commonActions.multipleAction('terminate'),
+ "VM.terminate_hard": _commonActions.multipleAction('terminate_hard'),
"VM.recover": _commonActions.multipleAction('recover'),
"VM.resched": _commonActions.multipleAction('resched'),
"VM.unresched": _commonActions.multipleAction('unresched'),
@@ -198,7 +195,7 @@ define(function(require) {
},
notify: true
},
- "VM.saveas_template" : {
+ "VM.save_as_template" : {
type: "single",
call: function() {
var dialog = Sunstone.getDialog(SAVE_AS_TEMPLATE_DIALOG_ID);
diff --git a/src/sunstone/public/app/tabs/vms-tab/buttons.js b/src/sunstone/public/app/tabs/vms-tab/buttons.js
index ded203a51a..7b6396d89e 100644
--- a/src/sunstone/public/app/tabs/vms-tab/buttons.js
+++ b/src/sunstone/public/app/tabs/vms-tab/buttons.js
@@ -140,33 +140,18 @@ define(function(require) {
tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore."),
custom_classes : "state-dependent"
},
- "VM.shutdown" : {
+ "VM.terminate" : {
type: "confirm",
- 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"),
custom_classes : "state-dependent"
},
- "VM.shutdown_hard" : {
+ "VM.terminate_hard" : {
type: "confirm",
- text: Locale.tr("Shutdown") + ' ' + Locale.tr("hard") + '',
+ text: Locale.tr("Terminate") + ' ' + Locale.tr("hard") + '',
layout: "vmsdelete_buttons",
- tip: Locale.tr("This will initiate the shutdown-hard (forced) process in the selected VMs"),
- custom_classes : "state-dependent"
- },
-
- "VM.delete" : {
- type: "confirm",
- text: Locale.tr("Delete"),
- layout: "vmsdelete_buttons",
- tip: Locale.tr("This will delete the selected VMs from the database"),
- custom_classes : "state-dependent"
- },
- "VM.delete_recreate" : {
- type: "confirm",
- text: Locale.tr("Delete") + ' ' + Locale.tr("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"),
custom_classes : "state-dependent"
},
"VM.resched" : {
@@ -188,14 +173,19 @@ define(function(require) {
text: Locale.tr("Recover"),
layout: "vmsplanification_buttons",
custom_select: '' ,
+ \
+ \
+ \
+ \
+ \
+ ' ,
tip: Locale.tr("Recovers a stuck VM that is waiting for a driver operation. \
The recovery may be done by failing, succeeding or retrying the current operation. \
YOU NEED TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation \
- was successful or not, or if it can be retried."),
+ was successful or not, or if it can be retried.\
+ \
+ Delete: This will delete the selected VMs\
+ Delete-recreate: This will delete and recreate VMs to PENDING state"),
custom_classes : "state-dependent"
},
"VM.startvnc" : {
@@ -210,7 +200,7 @@ define(function(require) {
custom_classes: "only-sunstone-info spice-sunstone-info",
tip: Locale.tr("SPICE")
},
- "VM.saveas_template" : {
+ "VM.save_as_template" : {
type: "action",
text: '',
tip: Locale.tr("This Virtual Machine will be saved in a new Template. You can then create a new Virtual Machine using this Template"),
diff --git a/src/sunstone/public/app/tabs/vms-tab/utils/state-actions.js b/src/sunstone/public/app/tabs/vms-tab/utils/state-actions.js
index c982df68f9..12e7635234 100644
--- a/src/sunstone/public/app/tabs/vms-tab/utils/state-actions.js
+++ b/src/sunstone/public/app/tabs/vms-tab/utils/state-actions.js
@@ -20,47 +20,47 @@ define(function(require) {
var STATE_ACTIONS = {};
STATE_ACTIONS[OpenNebulaVM.STATES.INIT] =
- ["VM.delete", "VM.delete_recreate", "VM.resize"];
+ ["VM.resize", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.PENDING] =
- ["VM.delete", "VM.delete_recreate", "VM.hold", "VM.deploy", "VM.updateconf"];
+ ["VM.hold", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.HOLD] =
- ["VM.delete", "VM.delete_recreate", "VM.release", "VM.deploy", "VM.updateconf"];
+ ["VM.release", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.ACTIVE] =
- ["VM.delete", "VM.delete_recreate", "VM.recover"];
+ ["VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.STOPPED] =
- ["VM.delete", "VM.delete_recreate", "VM.resume", "VM.deploy"];
+ ["VM.resume", "VM.deploy", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.SUSPENDED] =
- ["VM.delete", "VM.resume", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.stop", "VM.shutdown_hard"];
+ ["VM.resume", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.stop", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.DONE] =
[];
STATE_ACTIONS[OpenNebulaVM.STATES.FAILED] =
- ["VM.delete", "VM.delete_recreate", "VM.resize"];
+ [];
STATE_ACTIONS[OpenNebulaVM.STATES.POWEROFF] =
- ["VM.delete", "VM.resume", "VM.resize", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.migrate", "VM.undeploy", "VM.undeploy_hard", "VM.shutdown_hard", "VM.saveas_template", "VM.updateconf"];
+ ["VM.resume", "VM.resize", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.migrate", "VM.undeploy", "VM.undeploy_hard", "VM.save_as_template", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.UNDEPLOYED] =
- ["VM.delete", "VM.delete_recreate", "VM.resume", "VM.resize", "VM.deploy", "VM.updateconf"];
+ ["VM.resume", "VM.resize", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.CLONING] =
- ["VM.delete", "VM.delete_recreate", "VM.updateconf"];
+ ["VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.CLONING_FAILURE] =
- ["VM.delete", "VM.delete_recreate", "VM.recover", "VM.updateconf"];
+ ["VM.updateconf", "VM.terminate_hard", "VM.recover"];
var LCM_STATE_ACTIONS = {};
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.LCM_INIT ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.PROLOG ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.BOOT ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.RUNNING ] =
- ["VM.shutdown", "VM.shutdown_hard", "VM.stop", "VM.suspend", "VM.reboot", "VM.reboot_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_delete"];
+ ["VM.stop", "VM.suspend", "VM.reboot", "VM.reboot_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_delete", "VM.terminate", "VM.terminate_hard"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.MIGRATE ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SAVE_STOP ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SAVE_SUSPEND ] = [];
@@ -74,7 +74,7 @@ define(function(require) {
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.FAILURE ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.CLEANUP_RESUBMIT ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.UNKNOWN ] =
- ["VM.shutdown", "VM.shutdown_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.resume"];
+ ["VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.resume", "VM.terminate", "VM.terminate_hard"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.HOTPLUG ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SHUTDOWN_POWEROFF ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.BOOT_UNKNOWN ] = [];
diff --git a/src/sunstone/public/app/utils/dialogs/confirm-with-select.js b/src/sunstone/public/app/utils/dialogs/confirm-with-select.js
index 3399005776..ae8377d3f7 100644
--- a/src/sunstone/public/app/utils/dialogs/confirm-with-select.js
+++ b/src/sunstone/public/app/utils/dialogs/confirm-with-select.js
@@ -119,7 +119,7 @@ define(function(require) {
tip = this.button.tip
}
- $('#confirm_with_select_tip', dialog).text(tip);
+ $('#confirm_with_select_tip', dialog).html(tip);
var action = Sunstone.getAction(this.actionId);
var elements = action.elements();