Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-470

The vSphere module does not implement the get_total_space subroutine

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3
    • vcld (backend)
    • 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

      {'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;
      < }
      <
      <

      Attachments

        Activity

          People

            arkurth Andrew Kurth
            acoburn Aaron Coburn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified