VMware Cloud Community
MicroMarket
Contributor
Contributor

New-Vm Error "Operation is not valid due to the current state of the object."

Dear Friends

     In Vsphere client im click with right click button then chose clone and working well

but with the comand bellow the command begin but in im have a error bellow and the script stops

New-VM -Name newname -VM actualname -Datastore Datastore05 -VMHost cat01

Error

PS C:\Windows\system32> New-VM -Name $newvmname -VM $fromVMname.Name -Datastore ($mydatastore) -VMHost $esx

New-VM : 5/12/2015 6:44:37 PM    New-VM        Operation is not valid due to the current state of the object.   

At line:1 char:1

+ New-VM -Name $newvmname -VM $fromVMname.Name -Datastore ($mydatastore) -VMHost $ ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [New-VM], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

im try with the machine off too

how im can fix this ?

Thanks

Almir

0 Kudos
0 Replies