Class: Bosh::Director::Jobs::CreateSnapshot
- Inherits:
-
BaseJob
show all
- Defined in:
- lib/bosh/director/jobs/create_snapshot.rb
Instance Attribute Summary
Attributes inherited from BaseJob
#task_id
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseJob
#begin_stage, #event_log, #logger, perform, #result_file, #single_step_stage, #task_cancelled?, #task_checkpoint, #track_and_log
Constructor Details
#initialize(instance_id, options) ⇒ CreateSnapshot
11
12
13
14
|
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 11
def initialize(instance_id, options)
@instance = Bosh::Director::Api::InstanceManager.new.find_instance(instance_id)
@options = options
end
|
Class Method Details
7
8
9
|
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 7
def self.job_type
:create_snapshot
end
|
Instance Method Details
16
17
18
19
20
|
# File 'lib/bosh/director/jobs/create_snapshot.rb', line 16
def perform
logger.info("taking snapshot of: #{@instance.job}/#{@instance.index} (#{@instance.vm.cid})")
snapshot_cids = Bosh::Director::Api::SnapshotManager.take_snapshot(@instance, @options)
"snapshot(s) #{snapshot_cids.join(', ')} created"
end
|