The vSphere module does not implement the get_total_space subroutine --------------------------------------------------------------------
Key: VCL-470 URL: https://issues.apache.org/jira/browse/VCL-470 Project: VCL Issue Type: Bug Components: vcld (backend) Affects Versions: 2.2.1 Environment: VMware ESX4 host using the perl vSphere API Reporter: Aaron Coburn Fix For: 2.2.1 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{'CRITICAL'}, 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{'WARNING'}, 0, "path argument was not specified"); < 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{'DEBUG'}, 0, "capacity of $datastore_name datastore on $vmhost_hostname: " . format_number($total_bytes) . " bytes"); < return $total_bytes; < } < < -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira