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

Inherits:
Bosh::Deployer::InstanceManager show all
Defined in:
lib/deployer/instance_manager/vcloud.rb

Constant Summary

Constants included from Helpers

Helpers::DEPLOYMENTS_FILE

Instance Attribute Summary

Attributes inherited from Bosh::Deployer::InstanceManager

#renderer, #state

Instance Method Summary collapse

Methods inherited from Bosh::Deployer::InstanceManager

#agent, #apply, #attach_disk, #attach_missing_disk, #check_persistent_disk, #cloud, create, #create, #create_deployment, #create_disk, #create_stemcell, #create_vm, #delete_deployment, #delete_disk, #destroy, #detach_disk, #discover_bosh_ip, #disk_info, #disk_model, #exists?, #initialize, #instance_model, #logger, #migrate_disk, #mount_disk, #service_ip, #start, #step, #stop, #unmount_disk, #update, #update_deployment, #update_persistent_disk, #with_lifecycle

Methods included from Helpers

#cloud_plugin, #dig_hash, #is_tgz?

Constructor Details

This class inherits a constructor from Bosh::Deployer::InstanceManager

Instance Method Details

#check_dependenciesObject



28
29
30
31
32
# File 'lib/deployer/instance_manager/vcloud.rb', line 28

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

#disk_size(cid) ⇒ Integer

Returns size in MiB.

Returns:

  • (Integer)

    size in MiB



20
21
22
# File 'lib/deployer/instance_manager/vcloud.rb', line 20

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

#persistent_disk_changed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/deployer/instance_manager/vcloud.rb', line 24

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

#update_spec(spec) ⇒ Object

TODO extract



9
10
11
12
13
14
15
16
17
# File 'lib/deployer/instance_manager/vcloud.rb', line 9

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