Revision 9fc2bcc8

View differences:

src/im_mad/remotes/vcenter.d/vcenter.rb
61 61
    puts vm_monitor_info
62 62
end
63 63

  
64
# TODO: monitor network metrics in 'monitor_vms'
65
# TODO: monitor_customizations
66
# TODO: get_available_ds
64
puts cluster.monitor_customizations
65

  
66
dc = cluster.get_dc
67
ds_folder = dc.datastore_folder
68
ds_folder.fetch!
69
puts ds_folder.monitor
src/vmm_mad/remotes/lib/vcenter_driver/datastore.rb
18 18
            item_name = item._ref
19 19
            @items[item_name.to_sym] = Datastore.new(item)
20 20
        end
21

  
22
        VIClient.get_entities(@item, "StoragePod").each do |sp|
23
            VIClient.get_entities(sp, "Datastore").each do |item|
24
                item_name = item._ref
25
                @items[item_name.to_sym] = Datastore.new(item)
26
            end
27
        end
28
    end
29

  
30
    def monitor
31
        monitor = ""
32
        @items.values.each do |ds|
33
            monitor << "VCENTER_DATASTORE=\"#{ds['name']}\"\n"
34
        end
35
        monitor
21 36
    end
22 37

  
23 38
    ########################################################################
src/vmm_mad/remotes/lib/vcenter_driver/host.rb
241 241
        return str_info.gsub(/^\s+/,"")
242 242
    end
243 243

  
244

  
245
    def monitor_customizations
246
        customizations = self['_connection'].serviceContent.customizationSpecManager.info
247

  
248
        text = ''
249

  
250
        customizations.each do |c|
251
            t = "CUSTOMIZATION = [ "
252
            t << %Q<NAME = "#{c.name}", >
253
            t << %Q<TYPE = "#{c.type}" ]\n>
254

  
255
            text << t
256
        end
257

  
258
        text
259
    end
260

  
244 261
    def get_dc
245 262
        item = @item
246 263

  
src/vmm_mad/remotes/lib/vcenter_driver/vi_client.rb
18 18
        !!@rp
19 19
    end
20 20

  
21
    # @return RbVmomi::VIM::<type> objects
21 22
    def self.get_entities(folder, type, entities=[])
22 23
        if folder == []
23 24
            return nil

Also available in: Unified diff