Class: Bosh::Deployer::InstanceManager::Vsphere

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

Constant Summary

Constants inherited from Bosh::Deployer::InstanceManager

CONNECTION_EXCEPTIONS

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, #exists?, #initialize, #instance_model, #logger, #migrate_disk, #mount_disk, #service_ip, #start, #step, #stop, #unmount_disk, #update, #update_deployment, #update_persistent_disk, #update_vm_metadata, #with_lifecycle

Methods included from Helpers

#close_ssh_sessions, #cloud_plugin, #dig_hash, #is_tgz?, #process_exists?, #socket_readable?, #strip_relative_path

Constructor Details

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

Instance Method Details

#check_dependenciesObject



36
37
38
39
40
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 36

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

#disk_modelObject



9
10
11
12
13
14
15
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 9

def disk_model
  if @disk_model.nil?
    require 'cloud/vsphere'
    @disk_model = VSphereCloud::Models::Disk
  end
  @disk_model
end

#disk_size(cid) ⇒ Integer

Returns size in MiB.

Returns:

  • (Integer)

    size in MiB



28
29
30
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 28

def disk_size(cid)
  disk_model.first(uuid: cid).size
end

#persistent_disk_changed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 32

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

#remote_tunnel(port) ⇒ Object



6
7
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 6

def remote_tunnel(port)
end

#update_spec(spec) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 17

def update_spec(spec)
  properties = spec.properties

  properties['vcenter'] =
    Config.spec_properties['vcenter'] ||
    Config.cloud_options['properties']['vcenters'].first.dup

  properties['vcenter']['address'] ||= properties['vcenter']['host']
end