diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index ffbd577904..1868e1b124 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -91,6 +91,8 @@ void InformationManagerDriver::protocol( if ( action == "MONITOR" ) { + bool vm_poll; + host = hpool->get(id,true); if ( host == 0 ) @@ -145,6 +147,9 @@ void InformationManagerDriver::protocol( delete hinfo; + host->get_template_attribute("VM_POLL", vm_poll); + + host->remove_template_attribute("VM_POLL"); host->remove_template_attribute("VM"); host->touch(true); @@ -187,10 +192,7 @@ void InformationManagerDriver::protocol( delete *it; } - // TODO Some drivers do not return info about the VMs, but we should - // have a better way to check that. This will be true when no VMs are - // reported - if (!vm_att.empty()) + if (vm_poll) { for (set::iterator it = vm_ids.begin(); it != vm_ids.end(); it++) { diff --git a/src/im_mad/remotes/vmware.d/vmware.rb b/src/im_mad/remotes/vmware.d/vmware.rb index aeee880677..41adb38c7f 100755 --- a/src/im_mad/remotes/vmware.d/vmware.rb +++ b/src/im_mad/remotes/vmware.d/vmware.rb @@ -101,6 +101,8 @@ def get_vm_info(host, vm) end def get_all_vm_info(host, vms) + puts "VM_POLL=YES" + vms.each do |vm| info=get_vm_info(host, vm) @@ -111,7 +113,7 @@ def get_all_vm_info(host, vms) puts "VM=[" puts " ID=#{number}," - puts " DEPLOY_ID=#{vm},\n" + puts " DEPLOY_ID=#{vm}," puts " POLL=\"#{info}\" ]" end end diff --git a/src/vmm_mad/remotes/poll_ganglia.rb b/src/vmm_mad/remotes/poll_ganglia.rb index 1de76bd030..0bb822fb34 100755 --- a/src/vmm_mad/remotes/poll_ganglia.rb +++ b/src/vmm_mad/remotes/poll_ganglia.rb @@ -113,6 +113,8 @@ if !ALL puts info_string(dom_info) else + puts "VM_POLL=YES" + doms_info.each do |name, data| puts vm_info(name, data) end diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb index 6c2c5d9da1..4604418557 100755 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -346,6 +346,8 @@ end def print_all_vm_template(hypervisor) vms=hypervisor.get_all_vm_info + puts "VM_POLL=YES" + vms.each do |name, data| number = -1