Class: Bosh::Deployer::InstanceManager::Vcloud

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/deployer/instance_manager/vcloud.rb

Defined Under Namespace

Classes: FakeRegistry

Instance Method Summary collapse

Constructor Details

#initialize(instance_manager, logger) ⇒ Vcloud

Returns a new instance of Vcloud.



6
7
8
9
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 6

def initialize(instance_manager, logger)
  @instance_manager = instance_manager
  @logger = logger
end

Instance Method Details

#check_dependenciesObject



30
31
32
33
34
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 30

def check_dependencies
  if Bosh::Common.which(%w[genisoimage mkisofs]).nil?
    err("either of 'genisoimage' or 'mkisofs' commands must be present")
  end
end

#discover_bosh_ipObject



42
43
44
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 42

def discover_bosh_ip
  instance_manager.bosh_ip
end

#disk_modelObject



16
17
18
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 16

def disk_model
  nil
end

#disk_size(cid) ⇒ Integer

Returns size in MiB.

Returns:

  • (Integer)

    size in MiB



51
52
53
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 51

def disk_size(cid)
  instance_manager.cloud.get_disk_size_mb(cid)
end

#persistent_disk_changed?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 55

def persistent_disk_changed?
  Config.resources['persistent_disk'] != disk_size(instance_manager.state.disk_cid)
end

#remote_tunnelObject



11
12
13
14
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 11

def remote_tunnel
  # VCloud / vsphere does not use bosh-registry so no remote_tunnel
  # to bosh-registry is required
end

#service_ipObject



46
47
48
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 46

def service_ip
  instance_manager.bosh_ip
end

#startObject



36
37
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 36

def start
end

#stopObject



39
40
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 39

def stop
end

#update_spec(spec) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/bosh/deployer/instance_manager/vcloud.rb', line 20

def update_spec(spec)
  properties = spec.properties

  properties['vcd'] =
    Config.spec_properties['vcd'] ||
    Config.cloud_options['properties']['vcds'].first.dup

  properties['vcd']['address'] ||= properties['vcd']['url']
end