diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index 7f54955db5..fb92b83260 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -45,8 +45,10 @@ module OpenNebulaJSON rc = case action_hash['perform'] when "deploy" then self.deploy(action_hash['params']) when "hold" then self.hold - when "livemigrate" then self.migrate(action_hash['params'], true) - when "migrate" then self.migrate(action_hash['params'], false) + when "livemigrate" then self.migrate(action_hash['params'], true, 0) + when "migrate" then self.migrate(action_hash['params'], false, 0) + when "migrate_poff" then self.migrate(action_hash['params'], false, 1) + when "migrate_poff_hard" then self.migrate(action_hash['params'], false, 2) when "resume" then self.resume when "release" then self.release when "stop" then self.stop @@ -107,8 +109,8 @@ module OpenNebulaJSON super(params['hard']) end - def migrate(params=Hash.new, live=false) - super(params['host_id'], live, params['enforce'], params['ds_id']) + def migrate(params=Hash.new, live=false, mtype) + super(params['host_id'], live, params['enforce'], params['ds_id'], mtype) end def disk_saveas(params=Hash.new) diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index b807148ea2..6bc12bd510 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -447,6 +447,14 @@ define(function(require) { var action_obj = params.data.extra_param; OpenNebulaAction.simple_action(params, RESOURCE, "migrate", action_obj); }, + "migrate_poff": function(params) { + var action_obj = params.data.extra_param; + OpenNebulaAction.simple_action(params, RESOURCE, "migrate_poff", action_obj); + }, + "migrate_poff_hard": function(params) { + var action_obj = params.data.extra_param; + OpenNebulaAction.simple_action(params, RESOURCE, "migrate_poff_hard", action_obj); + }, "disk_saveas": function(params) { var action_obj = params.data.extra_param; OpenNebulaAction.simple_action(params, RESOURCE, "disk_saveas", action_obj); diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index 2ffde83410..ac1581c8b8 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -408,6 +408,11 @@ define(function(require) { text = button.text; buttonCode = "
  • " + text + "
  • "; break; + case "vmsmigration_buttons": + buttonContext = $("#" + customId + "vmsmigration_buttons", buttonsRow); + text = button.text; + buttonCode = "
  • " + text + "
  • "; + break; case "more_select": buttonContext = $("#" + customId + "more_buttons", buttonsRow); text = button.text; @@ -461,6 +466,10 @@ define(function(require) { $("button[data-toggle=" + customId + "vmsplanification_buttons]", actionBlock).remove(); } + if ($("#" + customId + "vmsmigration_buttons li", actionBlock).length == 0) { + $("button[data-toggle=" + customId + "vmsmigration_buttons]", actionBlock).remove(); + } + if ($("#" + customId + "vmsdelete_buttons li", actionBlock).length == 0) { $("button[data-toggle=" + customId + "vmsdelete_buttons]", actionBlock).remove(); } diff --git a/src/sunstone/public/app/sunstone/buttons.hbs b/src/sunstone/public/app/sunstone/buttons.hbs index 904fa7d084..27c9996b6c 100644 --- a/src/sunstone/public/app/sunstone/buttons.hbs +++ b/src/sunstone/public/app/sunstone/buttons.hbs @@ -65,6 +65,11 @@ + + +