1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #4913: Add method to find persistent image in pool using SOURCE as reference

This commit is contained in:
mcabrerizo 2017-04-17 16:55:31 +02:00
parent 7d211b2d98
commit 601d4bea26

View File

@ -57,6 +57,15 @@ class VIHelper
return element
end
def self.find_persistent_image_by_source(source, pool)
element = pool.select{|e|
e["SOURCE"] == source &&
e["PERSISTENT"] == "1"
}.first rescue nil
return element
end
def self.find_vcenter_vm_by_name(one_vm, host, vi_client)
# Let's try to find the VM object only by its name
# Let's build the VM name