mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
B #5368: Add snapshot and metadata earlier check
Wild VMs won't be imported and left for delete-db action if they have snapshosts and not disk metadata
This commit is contained in:
parent
82fd8177ba
commit
5b0d816f1a
@ -1054,7 +1054,8 @@ end
|
||||
else
|
||||
if snapshots?
|
||||
error = 'Disk metadata not present and snapshots exist. ' \
|
||||
'OpenNebula cannot manage this VM.'
|
||||
'Please remove imported VM with "onevm recover ' \
|
||||
'--delete-db".'
|
||||
raise error
|
||||
end
|
||||
|
||||
|
@ -54,6 +54,14 @@ module VCenterDriver
|
||||
|
||||
vc_vm = VCenterDriver::VirtualMachine.new_without_id(@vi_client,
|
||||
vm_ref)
|
||||
|
||||
# Importing Wild VMs with snapshots is not supported
|
||||
# https://github.com/OpenNebula/one/issues/1268
|
||||
if vc_vm.snapshots? && vc_vm.disk_keys.empty?
|
||||
raise 'Disk metadata not present and snapshots exist, '\
|
||||
'cannot import this VM'
|
||||
end
|
||||
|
||||
vname = vc_vm['name']
|
||||
|
||||
type = { :object => 'VM', :id => vname }
|
||||
|
Loading…
x
Reference in New Issue
Block a user