Class: Bosh::Deployer::InstanceManager::Vsphere
- Inherits:
-
Object
- Object
- Bosh::Deployer::InstanceManager::Vsphere
- Defined in:
- lib/bosh/deployer/instance_manager/vsphere.rb
Defined Under Namespace
Classes: FakeRegistry
Instance Method Summary collapse
- #check_dependencies ⇒ Object
- #discover_bosh_ip ⇒ Object
- #disk_model ⇒ Object
-
#disk_size(cid) ⇒ Integer
Size in MiB.
-
#initialize(instance_manager, logger) ⇒ Vsphere
constructor
A new instance of Vsphere.
- #persistent_disk_changed? ⇒ Boolean
- #remote_tunnel ⇒ Object
- #service_ip ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #update_spec(spec) ⇒ Object
Constructor Details
#initialize(instance_manager, logger) ⇒ Vsphere
Returns a new instance of Vsphere.
6 7 8 9 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 6 def initialize(instance_manager, logger) @instance_manager = instance_manager @logger = logger end |
Instance Method Details
#check_dependencies ⇒ Object
32 33 34 35 36 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 32 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_ip ⇒ Object
44 45 46 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 44 def discover_bosh_ip instance_manager.bosh_ip end |
#disk_model ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 14 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.
53 54 55 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 53 def disk_size(cid) disk_model.first(uuid: cid).size end |
#persistent_disk_changed? ⇒ Boolean
57 58 59 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 57 def persistent_disk_changed? Config.resources['persistent_disk'] != disk_size(instance_manager.state.disk_cid) end |
#remote_tunnel ⇒ Object
11 12 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 11 def remote_tunnel end |
#service_ip ⇒ Object
48 49 50 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 48 def service_ip instance_manager.bosh_ip end |
#start ⇒ Object
38 39 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 38 def start end |
#stop ⇒ Object
41 42 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 41 def stop end |
#update_spec(spec) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/bosh/deployer/instance_manager/vsphere.rb', line 22 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 |