mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 13:15:14 +09:00
F #4913: monitor datastores and customizations
This commit is contained in:
1 parent
9d16d397a4
commit
9fc2bcc86f
4 files changed
+39
-3
No files matched your search
@@ -61,6 +61,9 @@ if !vm_monitor_info.empty?
|
||||
puts vm_monitor_info
|
||||
end
|
||||
|
||||
# TODO: monitor network metrics in 'monitor_vms'
|
||||
# TODO: monitor_customizations
|
||||
# TODO: get_available_ds
|
||||
puts cluster.monitor_customizations
|
||||
|
||||
dc = cluster.get_dc
|
||||
ds_folder = dc.datastore_folder
|
||||
ds_folder.fetch!
|
||||
puts ds_folder.monitor
|
||||
@@ -18,6 +18,21 @@ class DatastoreFolder
|
||||
item_name = item._ref
|
||||
@items[item_name.to_sym] = Datastore.new(item)
|
||||
end
|
||||
|
||||
VIClient.get_entities(@item, "StoragePod").each do |sp|
|
||||
VIClient.get_entities(sp, "Datastore").each do |item|
|
||||
item_name = item._ref
|
||||
@items[item_name.to_sym] = Datastore.new(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def monitor
|
||||
monitor = ""
|
||||
@items.values.each do |ds|
|
||||
monitor << "VCENTER_DATASTORE=\"#{ds['name']}\"\n"
|
||||
end
|
||||
monitor
|
||||
end
|
||||
|
||||
########################################################################
|
||||
|
||||
@@ -241,6 +241,23 @@ class ClusterComputeResource
|
||||
return str_info.gsub(/^\s+/,"")
|
||||
end
|
||||
|
||||
|
||||
def monitor_customizations
|
||||
customizations = self['_connection'].serviceContent.customizationSpecManager.info
|
||||
|
||||
text = ''
|
||||
|
||||
customizations.each do |c|
|
||||
t = "CUSTOMIZATION = [ "
|
||||
t << %Q<NAME = "#{c.name}", >
|
||||
t << %Q<TYPE = "#{c.type}" ]\n>
|
||||
|
||||
text << t
|
||||
end
|
||||
|
||||
text
|
||||
end
|
||||
|
||||
def get_dc
|
||||
item = @item
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class VIClient
|
||||
!!@rp
|
||||
end
|
||||
|
||||
# @return RbVmomi::VIM::<type> objects
|
||||
def self.get_entities(folder, type, entities=[])
|
||||
if folder == []
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user