1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-13 12:58:17 +03:00

bug #2009: Add recover action to sunstone

This commit is contained in:
Daniel Molina 2013-05-17 12:55:12 +02:00
parent 9b74e6c5bd
commit 078fbdb7d3
4 changed files with 31 additions and 1 deletions

View File

@ -519,7 +519,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation
was successful or not.
Example: A VM is stuck in "migrate" because of a harware failure. You
Example: A VM is stuck in "migrate" because of a hardware failure. You
need to check if the VM is running in the new host or not to recover
the vm with success (onevm recover --with success) or failure
(onevm recover --with failure), respectively.

View File

@ -75,6 +75,7 @@ module OpenNebulaJSON
when "undeploy" then self.undeploy(action_hash['params'])
when "resched" then self.resched
when "unresched" then self.unresched
when "recover" then self.recover(action_hash['params'])
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -160,5 +161,10 @@ module OpenNebulaJSON
def rename(params=Hash.new)
super(params['name'])
end
def recover(params=Hash.new)
result = params['with'] == "success" ? true : false
super(result)
end
end
end

View File

@ -806,6 +806,10 @@ var OpenNebula = {
},
"unresched" : function(params){
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"unresched");
},
"recover" : function(params){
var action_obj = {"with": params.data.extra_param};
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"recover",action_obj);
}
},

View File

@ -404,6 +404,15 @@ var vm_actions = {
notify: true
},
"VM.recover" : {
type: "multiple",
call: OpenNebula.VM.recover,
callback: vmShow,
elements: vmElements,
error: onError,
notify: true
},
"VM.resched" : {
type: "multiple",
call: OpenNebula.VM.resched,
@ -834,6 +843,17 @@ var vm_buttons = {
layout: "vmsplanification_buttons",
tip: tr("This will cancel the rescheduling for the selected VMs")
},
"VM.recover" : {
type: "confirm_with_select",
text: tr("Recover"),
layout: "vmsplanification_buttons",
select: function(){ return '<option value="success">' + tr("success") + '</option>\
<option value="failure">' + tr("failure") + '</option>'},
tip: tr("Recovers a stuck VM that is waiting for a driver operation. \
The recovery may be done by failing or succeeding the pending operation. \
YOU NEED TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation \
was successful or not.")
}
//"VM.help" : {
// type: "action",