Use cluster's hvparams in LUInstSetParams

Since the instance does not have hvparams at that point,
we have to use the cluster's hvparams here. This fixes
a crash when using 'gnt-instance modify'.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Add storage type to NodeInfo result

So far, the storage information returned from RPC call
NodeInfo contained only information about volume groups.
In order to extend the storage reporting to other storage
type, we include another field "type" in the result of
the RPC call to be able to distinguish storage space
information from different storage units.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Renamining space reporting for file storage

Before being integrated, the function for space reporting
for file storage is renamed to a more expressive name.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Unit tests for ApplyStorageSpaceFunction

So far, the function 'ApplyStorageSpaceFunction' was not
covered by unit tests. Before the integration of space
reporting for file storage, we add those missing tests.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Integrate free space reporting for file storage

This patch integrates the free space reporting for file
storage. So far, it is only called, when the default
disk template is a file-based disk template ("file" or
"sharedfile").

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Utility functions for storage types

Handling various storage types for the free space reporting
requires some utility functions. They will be invoked in
later patches. Unit tests are included.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Refactor NodeInfo RPC regarding storage reporting

The NodeInfo RPC call is refactored to handle now more than
just storage reporting for volume groups.

Since NodeInfo now returns storage space information not
necessarily for volume groups, but also for other storage
entities, it is no longer appropriate to call the fields
of the NodeInfo result "vg_free" and "vg_size". We rename
it to "storage_free" and "storage_size" instead.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>