Code:
1..3 | ForEach-Object { New-VM -Name "WinSvr$_" ` -Template "Windows 2003 Server Standard" ` -VMHost 192.168.0.55 ` -RunAsync }
Results:
Name State % Complete Start Time Finish Time ---- ----- ---------- ---------- ----------- CloneVM_Task Running 0 05:16:02 AM New-VM : Object reference not set to an instance of an object. At C:\DOCUME~1\HROTTE~1\LOCALS~1\Temp\Untitled9.ps1:2 char:8 + New-VM <<<< -Name "WinSvr$_" ` New-VM : Object reference not set to an instance of an object. At C:\DOCUME~1\HROTTE~1\LOCALS~1\Temp\Untitled9.ps1:2 char:8 + New-VM <<<< -Name "WinSvr$_" `
Can anyone else repro on v1.0.103777?
I ran it again with ps-debug on and see a few weird things which I don't quite know how to explain. The output is here: http://halr9000.pastebin.com/f1e1bcba7
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
This is a bug in the VI Toolkit. It will be fixed in the next release.
Let me know if you need some specific workaround for your environment.
Regards,
Angel
Is there anything in the vpxd logs after you set the logging to verbose?
I don't have access to my VI environment right now. Will try it asap.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is there anything in the vpxd logs after you set the logging to verbose?
No idea. I got dizzy after a while.
http://halr9000.pastebin.com/m5c674191
Confirmed. For me it is happening sporadically however I may get 1 good run for every 5 failed.
-Cody Bunch
Confirmed, the clone of the first guest runs ok, number 2 & 3 fail with the same message.
Nothing conclusive in the verbose vpxd logs afaics.
In sync mode it works without a problem.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
VMware, can you comment? Thanks.
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
No help here.. but I am running into same in my environment.
Interested in VMware response.
This is a bug in the VI Toolkit. It will be fixed in the next release.
Let me know if you need some specific workaround for your environment.
Regards,
Angel
FYI, I just confirmed this fixed in 1.5.
[VI Toolkit] C:\tmp> 1..4 | % { new-vm -na "testsvr$_" -templ test1 -vmhost eazye* -runa } Name State % Complete Start Time Finish Time ---- ----- ---------- ---------- ----------- CloneVM_Task Running 0 01:33:38 PM CloneVM_Task Running 0 01:34:00 PM CloneVM_Task Running 0 01:34:21 PM CloneVM_Task Running 0 01:34:41 PM
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Need general, non-VMware-related PowerShell Help? Try the forums at PowerShellCommunity.org