Skip to content

Commit

Permalink
Support update VM snapshot
Browse files Browse the repository at this point in the history
Create new snapshot was disabled when VM already had an existing snapshot.
VCloud only supports having one snapshot per VM, but you can still create
new snapshot, which updates the existing one. So now VM supports
`snapshot_create` even when it already has a snapshot.

Signed-off-by: sasoc <[email protected]>
  • Loading branch information
sasoc committed Mar 5, 2018
1 parent e1fcf19 commit 6e2cb29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/manageiq/providers/vmware/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ManageIQ::Providers::Vmware::CloudManager::Vm < ManageIQ::Providers::Cloud
supports :snapshots
supports :remove_all_snapshots
supports_not :remove_snapshot
supports :snapshot_create

def provider_object(connection = nil)
connection ||= ext_management_system.connect
Expand Down
9 changes: 9 additions & 0 deletions spec/models/manageiq/providers/vmware/cloud_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@

@ems.vm_create_snapshot(vm, snapshot_options)
end

it 'supports snapshot create' do
expect(vm.supports_snapshot_create?).to be_truthy
end

it 'supports snapshot update' do
FactoryGirl.create(:snapshot, :vm_or_template_id => vm.id)
expect(vm.supports_snapshot_create?).to be_truthy
end
end

context ".vm_revert_to_snapshot" do
Expand Down

0 comments on commit 6e2cb29

Please sign in to comment.