Module: ForemanSnapshotManagement::Extensions::BulkHostsManager

Extended by:
ActiveSupport::Concern
Defined in:
app/models/foreman_snapshot_management/extensions/bulk_hosts_manager.rb

Constant Summary collapse

SNAPSHOT_MODES =
%w[full include_ram quiesce].freeze
QUIESCE_ERROR_MESSAGE =
_('Unable to create VMWare Snapshot with Quiesce. Check Power and VMWare Tools status.').freeze

Instance Method Summary collapse

Instance Method Details

#create_snapshots(name:, description:, mode:) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/foreman_snapshot_management/extensions/bulk_hosts_manager.rb', line 12

def create_snapshots(name:, description:, mode:)
  include_ram, quiesce = resolve_mode(mode)

  @hosts.map do |host|
    process_snapshot_for_host(
      host: host,
      name: name,
      description: description,
      include_ram: include_ram,
      quiesce: quiesce
    )
  end
end