Search code examples
powershellvmwarepowercli

New-VM - "The operation is not supported on this object"


I am trying to clone a VM using PowerCLI. Running the following snippet returns the error "The operation is not supported on the object."

$vmHost = Get-VMHost
New-VM -Name VM1 -VM SourceVM -VMHost $vmHost

Why does this return: 'operation not supported on the object error'

There is only one host, so it's not an issue with $vmHost selection.

Thanks


Solution

  • I'm recreating this error with PowerCLI 6.5R1 directly connected to the ESXi host rather than to the vCenter server (with Connect-VIServer). The New-VM line you have works fine when connected to vCenter. So I'd suggest doing that if you're able. Otherwise it might be something to take up with VMware. If you don't have a support contract, you could try their Forums.

    edit - You can't clone a vm without vCenter (thanks @Jelphy) although in a pinch you could copy the disks.