Skip to content

Commit

Permalink
Fix omitted snapshot-option
Browse files Browse the repository at this point in the history
Solves fog#269
Co-authored-by: Ondřej Ezr <ezrik12@gmail.com>
  • Loading branch information
m-bucher committed Jul 14, 2021
1 parent 6333944 commit 883e390
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/fog/vsphere/requests/compute/vm_take_snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ class Real
def vm_take_snapshot(options = {})
raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
raise ArgumentError, 'name is a required parameter' unless options.key? 'name'
defaults = {
description: '',
memory: true,
quiesce: false
}
opts = options.clone
defaults.each do |k, v|
opts[k] = v unless opts.key?(k) || opts.key?(k.to_s)
end
vm = get_vm_ref(options['instance_uuid'])
task = vm.CreateSnapshot_Task(
name: options['name'],
description: options['description'] || '',
memory: options['memory'] || true,
quiesce: options['quiesce'] || false
)
task = vm.CreateSnapshot_Task(opts)

task.wait_for_completion

Expand Down

0 comments on commit 883e390

Please sign in to comment.