feature #1243: Add resched flag to VMs. Includes associated logic to make it work: RM methods, OCA bindings, CLI commands. LCM updated to clear the resched flag when leaving the running state Fixes VM tests

This commit is contained in:
Ruben S. Montero committed 2012-04-26 19:06:49 +02:00
1 parent d364c3e57f
commit 8ff221052d
16 files changed
+255 -37

No files matched your search

+6 -1
View File
@@ -57,7 +57,11 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
column :NAME, "Name of the Virtual Machine", :left,
:size=>15 do |d|
d["NAME"]
if d["RESCHED"] == "1"
"*#{d["NAME"]}"
else
d["NAME"]
end
end
column :USER, "Username of the Virtual Machine owner", :left,
@@ -132,6 +136,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
puts str % ["GROUP", vm['GNAME']]
puts str % ["STATE", vm.state_str]
puts str % ["LCM_STATE", vm.lcm_state_str]
puts str % ["RESCHED", OpenNebulaHelper.boolean_to_str(vm['RESCHED'])]
puts str % ["HOSTNAME",
vm['/VM/HISTORY_RECORDS/HISTORY[last()]/HOSTNAME']] if
%w{ACTIVE SUSPENDED}.include? vm.state_str
+24
View File
@@ -354,6 +354,30 @@ cmd=CommandParser::CmdParser.new(ARGV) do
end
end
resched_desc = <<-EOT.unindent
Sets the rescheduling flag for the VM.
States: RUNNING
EOT
command :resched, resched_desc, [:range,:vmid_list] do
helper.perform_actions(args[0],options,"Setting resched flag") do |vm|
vm.resched
end
end
unresched_desc = <<-EOT.unindent
Clears the rescheduling flag for the VM.
States: RUNNING
EOT
command :unresched, unresched_desc, [:range,:vmid_list] do
helper.perform_actions(args[0],options,"Clearing resched flag") do |vm|
vm.unresched
end
end
list_desc = <<-EOT.unindent
Lists VMs in the pool
EOT