mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[vsphere] force poweroff of instance of vmware tools are not installed
This commit is contained in:
parent
09d52dac8d
commit
0644377c60
1 changed files with 9 additions and 1 deletions
|
@ -53,7 +53,7 @@ module Fog
|
|||
end
|
||||
|
||||
def stop(options = {})
|
||||
options = { :force => false }.merge(options)
|
||||
options = { :force => !tools_installed? }.merge(options)
|
||||
requires :instance_uuid
|
||||
connection.vm_power_off('instance_uuid' => instance_uuid, 'force' => options[:force])
|
||||
end
|
||||
|
@ -100,6 +100,14 @@ module Fog
|
|||
new_vm
|
||||
end
|
||||
|
||||
def ready?
|
||||
power_state == "poweredOn"
|
||||
end
|
||||
|
||||
def tools_installed?
|
||||
tools_state != "toolsNotInstalled"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue