Skip to content

Using $vm->guestOperationsManager->fileManager fails #26

Description

@n3r0-ch

I'm trying to list the files a guest by using the following code:

    public function listFilesInVm(ManagedObject $vm, string $path, $offset = 0, $limit = 50, $pattern = null)
    {
        $this->logger->info('Listing files in '.$path.' of '.$vm->name);

        // Get file manager
        $fileManager = $vm->guestOperationsManager->fileManager;

        // Build args
        $args = [
            'vm' => $vm->getReferenceId(),
            'auth' => $this->getGuestAuthentication(),
            'filePath' => $path,
            'index' => $offset,
            'maxResults' => $limit,
            'matchPattern' => $pattern,
        ];

        $fileManager->ListFilesInGuest($args);
    }

Executing this fails always with the following exception:

  [Vmwarephp\Exception\Soap]
  ServerFaultCode: The request refers to an unexpected or unknown type.. InvalidType: InvalidType Object
  (
      [argument] => Type Mismatch: expected: N3Vim2Vm5Guest11FileManagerE, found: 13FileManagerMo
  )

The same error occurs if I use other methods of the $vm->guestOperationsManager->fileManager. All other request works perfectly

I'm using a vCenter server running 6.5

Any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions