Remove duplicate storage units in node query

This is a little performance tweak for the node queries.
So far, the query code mapped the disk templates to storage
units. It could happen that two disk templates were mapped
to the same storage unit and therefore the storage space
information was calculated twice for the same unit. This
patch removes this unecessary double calculation by
filtering for duplicate storage units before invoking the
the RPC call.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Use hypervisor / storage information only when requested

So far, the node queries ignored the list of fields and
just requested all available information from the backend.
That means, for example if only hypervisor information is
requested, still the storage space calculation is
triggered. This patch makes the node queries aware of
their fields and only calls the RPC with the minimum
necessary parameters.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix retrieval of number of instances of a node

This patch fixes a FIXME to make the retrieval of the
number of primary and secondary instances share more
common code.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>