mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
feature #3957: do not treat current as snapshot
Skip current disk when monitoring snapshots as it is not an snapshot and is already monitored as disk size
This commit is contained in:
parent
84f5447b99
commit
d0aca00c57
@ -362,6 +362,9 @@ module KVM
|
||||
else
|
||||
# Search the disk in system datastore when the source
|
||||
# is a persistent image with snapshots
|
||||
source = nil
|
||||
current_snap_id = nil
|
||||
|
||||
if !file.match(/.*disk\.\d+$/) && systemds
|
||||
source = file.gsub(%r{/+}, '/')
|
||||
|
||||
@ -373,6 +376,7 @@ module KVM
|
||||
|
||||
if link == source
|
||||
file = disk
|
||||
current_snap_id = link.split('/').last
|
||||
break
|
||||
end
|
||||
end
|
||||
@ -392,6 +396,12 @@ module KVM
|
||||
|
||||
# Get snapshots
|
||||
Dir[file + '.snap/*'].each do |snap|
|
||||
if current_snap_id
|
||||
next if snap.split('/').last == current_snap_id
|
||||
else
|
||||
next if source == snap
|
||||
end
|
||||
|
||||
text = `qemu-img info --output=json #{snap}`
|
||||
next if !$? || !$?.success?
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user