1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Features #457 & #455: Resubmit action for VMs added to the RM and CLI

This commit is contained in:
Carlos Martín 2011-01-11 18:50:29 +01:00
parent 135ba26c34
commit 8696b216a2
3 changed files with 31 additions and 2 deletions

View File

@ -362,9 +362,12 @@ Commands:
* delete (Deletes a VM from the pool and DB)
onevm delete <vm_id>
* restart (Resubmits the VM after failure)
* restart (Forces a re-deployment of a VM in UNKNOWN or BOOT state)
onevm restart <vm_id>
* resubmit (Resubmits a VM to PENDING state)
onevm resubmit <vm_id>
* list (Shows VMs in the pool)
onevm list <filter_flag>
where filter_flag can be
@ -673,6 +676,23 @@ when "restart"
end
end
when "resubmit"
check_parameters("resubmit", 1)
args=expand_args(ARGV)
args.each do |param|
vm_id=get_vm_id(param)
vm=OpenNebula::VirtualMachine.new_with_id(vm_id, get_one_client)
result=vm.resubmit
if is_successful?(result)
puts "Resubmitting VM" if ops[:verbose]
else
break
end
end
when "list"
ops.merge!(get_user_flags)
if !ops[:xml]

View File

@ -179,11 +179,16 @@ module OpenNebula
action('finalize')
end
# Resubmits the VM after failure
# Forces a re-deployment of a VM in UNKNOWN or BOOT state
def restart
action('restart')
end
# Resubmits a VM to PENDING state
def resubmit
action('resubmit')
end
# Saves a running VM and starts it again in the specified host
def migrate(host_id)
return Error.new('ID not defined') if !@pe_id

View File

@ -120,6 +120,10 @@ void RequestManager::VirtualMachineAction::execute(
{
rc = dm->finalize(vid);
}
else if (action == "resubmit")
{
rc = dm->resubmit(vid);
}
else
{
rc = -3;