Class: Bosh::Director::DeploymentPlan::InstanceMemo

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/compilation_instance_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_provider, stemcell) ⇒ InstanceMemo

Returns a new instance of InstanceMemo.



176
177
178
179
# File 'lib/bosh/director/deployment_plan/compilation_instance_pool.rb', line 176

def initialize(instance_provider, stemcell)
  @instance_provider = instance_provider
  @stemcell = stemcell
end

Instance Attribute Details

#instance_planObject (readonly)

Returns the value of attribute instance_plan.



174
175
176
# File 'lib/bosh/director/deployment_plan/compilation_instance_pool.rb', line 174

def instance_plan
  @instance_plan
end

Instance Method Details

#instanceObject



181
182
183
184
185
186
187
188
# File 'lib/bosh/director/deployment_plan/compilation_instance_pool.rb', line 181

def instance
  return @instance if @called
  @called = true
  @instance_plan = @instance_provider.create_instance_plan(@stemcell)
  @instance = @instance_plan.instance
  @instance_provider.create_instance(@instance_plan)
  @instance
end