mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-24 21:34:01 +03:00
feature #132: Support for reboot in EC2 hybrid driver
This commit is contained in:
parent
0d21013029
commit
a6592d09be
@ -52,6 +52,7 @@ class EC2Driver < VirtualMachineDriver
|
||||
:terminate => "#{EC2_LOCATION}/bin/ec2-terminate-instances",
|
||||
:describe => "#{EC2_LOCATION}/bin/ec2-describe-instances",
|
||||
:associate => "#{EC2_LOCATION}/bin/ec2-associate-address",
|
||||
:reboot => "#{EC2_LOCATION}/bin/ec2-reboot-instances",
|
||||
:authorize => "#{EC2_LOCATION}/bin/ec2-authorize"
|
||||
}
|
||||
|
||||
@ -186,6 +187,20 @@ class EC2Driver < VirtualMachineDriver
|
||||
|
||||
ec2_terminate(ACTION[:shutdown], id, deploy_id)
|
||||
end
|
||||
|
||||
# Reboot a EC2 instance
|
||||
def reboot(id, drv_message)
|
||||
cmd = "#{EC2_LOCATION}/bin/ec2-reboot-instances #{deploy_id}"
|
||||
exe = LocalCommand.run(cmd, log_method(id))
|
||||
|
||||
if exe.code != 0
|
||||
result = RESULT[:failure]
|
||||
else
|
||||
result = RESULT[:success]
|
||||
end
|
||||
|
||||
send_message(action,result,id)
|
||||
end
|
||||
|
||||
# Cancel a EC2 instance
|
||||
def cancel(id, drv_message)
|
||||
|
Loading…
Reference in New Issue
Block a user