mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-08 21:16:39 +09:00
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:
1 parent
d364c3e57f
commit
8ff221052d
16 files changed
+255
-37
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user