diff --git a/lib/fog/vsphere/models/compute/server.rb b/lib/fog/vsphere/models/compute/server.rb index fd0aeac5b..a3521162f 100644 --- a/lib/fog/vsphere/models/compute/server.rb +++ b/lib/fog/vsphere/models/compute/server.rb @@ -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