Skip to content

Error: Invalid snapshot name 'Snapshot' when trying to clone VM with snapshot "Snapshot 1" #32

Description

@ben-eddy74

When cloning from a base VM, using snapshot "Snapshot 1" results in an error while there is also a success statement. In the end, the clone is not created. Commands:

$vmx | Get-VMXSnapshot | Where-Object { $_.Snapshot -eq "Snapshot 1" } | New-VMXClone -CloneName "My Test VM"

result:

==>creating Fullclone from Windows Server Template Snapshot 1 for My Test VMError: Invalid snapshot name 'Snapshot'

[success]

CloneName  Config                              Path
---------  ------                              ----
My Test VM C:\VMware\My Test VM\My Test VM.vmx C:\VMware\My Test VM

The Path is not created.

Workaround is using snapshot names without spaces.

Seems like an easy fix by adding quotes to the snapshot variable, at the following line:

3089: $clonecommand = "clone `"$config`" `"$Cloneconfig`" full -snapshot=`"$($BaseSnapshot)`" -cloneName=$($Clonename)" # 2>&1 | Out-Null

I can create a PR if there is a chance to get it released.

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