Class: CloudProviders::VmwareInstance

Inherits:
CloudProviderInstance show all
Defined in:
lib/cloud_providers/vmware/vmware_instance.rb

Instance Method Summary collapse

Methods inherited from CloudProviderInstance

#[], #[]=, #after_bootstrap, #after_configure, #before_bootstrap, #before_configure, #bootstrap!, #bootstrapped?, #configure!, #determine_os, #each, #elapsed_runtime, #has_key?, #keypair, #keys, #loaded, #on_all_callbacks, #os, #pack_clouds_dot_rb_and_expected_directories, #pending?, #running?, #terminate!, #terminated?, #terminating?, #to_hash, #valid?, #values, #wait_for_port

Methods included from Callbacks

included

Methods included from Connections

#host, #rsync, #run, #scp, #ssh, #ssh_options, #user

Constructor Details

#initialize(opts = {}, &block) ⇒ VmwareInstance

A new instance will be created from a hash. The parent clouds describe_instances list will be searched for the first one matching any of this instance’s provided unique identifiers. If an instance is found, this instance’s properties will be set to the properties provided If the found instance has properties of the same key as the provided options, the found instance’s values will override the passed in options



20
21
22
23
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 20

def initialize(opts={}, &block)
  set_vars_from_options(opts)
  super
end

Instance Method Details

#cloud_provider(o = {}, &block) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 45

def cloud_provider(o={}, &block)
  @cloud_provider ||= if cloud
    cloud.cloud_provider
  else        
    options_for_cloud_provider = o.choose{|k,v| Vmware.default_options.has_key?(k)}
    Vmware.new( options_for_cloud_provider, &block)
  end
end

#refresh!Object



41
42
43
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 41

def refresh!
  self
end

#statusObject



31
32
33
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 31

def status
  "running"
end

#to_sObject

Printing. This is how we extract the instances into the listing on the local side into the local listing file



27
28
29
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 27

def to_s
  "#{name}\t#{dns_name}\t#{instance_id}"
end

#wait_for_public_ip(timeout = 60) ⇒ Object

Since we aren’t actually getting any ips from a list, only using the one vmx file, we don’t actually need to refresh anything



37
38
39
# File 'lib/cloud_providers/vmware/vmware_instance.rb', line 37

def wait_for_public_ip(timeout=60)
  public_ip      
end