Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
VMware ESX4 host using the perl vSphere API
Description
The VMware provisioning module calls the get_total_space subroutine before moving the VMX and VMDK files to/from the VM host machine. But when using the VMware::vSphere_SDK module, vcld reaches a critical error because the function is not implemented in the vSphere module. Attached is an implementation of the needed subroutine for lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
1797,1840d1796
< #/////////////////////////////////////////////////////////////////////////////
<
< =head2 get_total_space
<
< Parameters : $path
< Returns : integer
< Description : Returns the total size (in bytes) of the volume specified by the
< argument.
<
< =cut
<
< sub get_total_space {
< my $self = shift;
< if (ref($self) !~ /VCL::Module/i) {
< notify($ERRORS
, 0, "subroutine was called as a function, it must be called as a class method");
< return;
< }
<
< # Get the path argument
< my $path = shift;
< if (!$path) {
< notify($ERRORS
< return;
< }
<
< # Get the datastore name
< my $datastore_name = $self->_get_datastore_name($path) || return;
<
< my $vmhost_hostname = $self->data->get_vmhost_hostname();
<
< # Get the datastore info hash
< my $datastore_info = $self->_get_datastore_info() || return;
<
< my $total_bytes = $datastore_info->{$datastore_name}{capacity};
< if (!defined($total_bytes)) {
< notify($ERRORS{'WARNING'}
, 0, "datastore $datastore_name capacity key does not exist in datastore info:\n" . format_data($datastore_info));
< return;
< }
<
< notify($ERRORS
, 0, "capacity of $datastore_name datastore on $vmhost_hostname: " . format_number($total_bytes) . " bytes");
< return $total_bytes;
< }
<
<