Class: Bosh::Deployer::InstanceManager::Vsphere
- Inherits:
-
Object
- Object
- Bosh::Deployer::InstanceManager::Vsphere
- Extended by:
- Forwardable
- Defined in:
- lib/bosh/deployer/instance_manager/vsphere.rb
Defined Under Namespace
Classes: FakeRegistry
Instance Method Summary collapse
- #check_dependencies ⇒ Object
-
#disk_size(cid) ⇒ Integer
Size in MiB.
-
#initialize(instance_manager, config, logger) ⇒ Vsphere
constructor
A new instance of Vsphere.
- #persistent_disk_changed? ⇒ Boolean
- #remote_tunnel ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #update_spec(spec) ⇒ Object
Constructor Details
#initialize(instance_manager, config, logger) ⇒ Vsphere
Returns a new instance of Vsphere.
8 9 10 11 12 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 8 def initialize(instance_manager, config, logger) @instance_manager = instance_manager @config = config @logger = logger end |
Instance Method Details
#check_dependencies ⇒ Object
27 28 29 30 31 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 27 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.
47 48 49 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 47 def disk_size(cid) instance_manager.cloud.disk_provider.find(cid).size_in_mb end |
#persistent_disk_changed? ⇒ Boolean
51 52 53 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 51 def persistent_disk_changed? config.resources['persistent_disk'] != disk_size(instance_manager.state.disk_cid) end |
#remote_tunnel ⇒ Object
14 15 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 14 def remote_tunnel end |
#start ⇒ Object
33 34 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 33 def start end |
#stop ⇒ Object
36 37 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 36 def stop 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.['properties']['vcenters'].first.dup properties['vcenter']['address'] ||= properties['vcenter']['host'] end |