Skip to content

import.vmdk path gets url encoded #4061

Description

@aklakina

Describe the bug

When attempting to upload a VMDK to a nested directory path on a datastore using govc import.vmdk, the CLI does not properly interpret the forward slashes (/) as directory separators. Instead, it URL-encodes the path, creating a single directory with the URL-encoded string (e.g., / becomes %2f or similar) and placing the VMDK inside that erroneously named directory, then a post processor tries to get the nested directory like expected and that can not find the vmdk so it fails.

To Reproduce
Steps to reproduce the behavior:

  1. Define a nested remote directory path (e.g., windows/win2019).
  2. Attempt to upload a stream-optimized VMDK using govc import.vmdk: govc import.vmdk -dc "MyDatacenter" -ds "MyDatastore" -pool "My Pool" -force ./my_image.vmdk "windows/win2019"
  3. Browse the datastore to view the result.

Expected behavior
A clear and concise description of what you expected to happen.

The CLI should recognize the path separators and place the VMDK inside the nested folder structure windows/win2019 on the datastore.

Affected version
Please provide details on the version used, e.g. release tag, commit, module version, etc.

govc version: 0.55.0
vSphere version: vsphere client version 8.0.3.00900
OS running govc: Ubuntu 24.04

Screenshots/Debug Output
If applicable, add screenshots or debug output to help explain your problem.

Image Image Image Image

Additional context
Add any other context about the problem here.

For this to work, you also need to open up the possibility to name the file. Right now the file name is the same as the target path postfixed with .vmdk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions