Class: Bosh::Director::InstanceUpdater::VmUpdater::DiskAttacher

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/instance_updater/vm_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(instance, vm_model, agent_client, cloud, logger) ⇒ DiskAttacher

Returns a new instance of DiskAttacher.



141
142
143
144
145
146
147
# File 'lib/bosh/director/instance_updater/vm_updater.rb', line 141

def initialize(instance, vm_model, agent_client, cloud, logger)
  @instance = instance
  @vm_model = vm_model
  @agent_client = agent_client
  @cloud = cloud
  @logger = logger
end

Instance Method Details

#attachObject



149
150
151
152
153
154
155
156
157
158
# File 'lib/bosh/director/instance_updater/vm_updater.rb', line 149

def attach
  if @instance.model.persistent_disk_cid.nil?
    @logger.info('Skipping disk attaching')
    return
  end

  @cloud.attach_disk(@vm_model.cid, @instance.model.persistent_disk_cid)

  @agent_client.mount_disk(@instance.model.persistent_disk_cid)
end