I'm new to both Powershell and the VMware VI toolkit, but I wanted to create a new VM froma template.
I have a template "XP Professional" that requires me to enter an IP address for the template, I also want to put this ina folder called "XP Workstations". I want to control what datastore is used as well, e.g. datastore1. I've tried several times to figure this out, but with no success.
Would somebody like to enlighten me.
Also, something weird happens....When I conenct to VC (Get-VC <VCServerName>) I connect to the VC, but I am NEVER prompted for my credentials. I can read VC fine, but even a simple "new-vm" command fails.
greg
There actually is a way to specify the IP address, but it's hard, and there's a bug in that code at present. VMware has acknowledged both issues in this thread:
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Hi,
New-VM accepts "Template" as parameter and you can specify the folder in which to put the new VM. But there is no way to specify the IP of the machine.
So what you can do currently is:
Get-Template "XP Professional" | New-VM -VMHost "host name" -Name "vm name" -Location ( Get-Folder "XP Workstations" ) -Datastore ( Get-Datastore "datastore1" )
As for the Get-VC problem - there is a separate topic in the forum for this: http://communities.vmware.com/thread/133717
There actually is a way to specify the IP address, but it's hard, and there's a bug in that code at present. VMware has acknowledged both issues in this thread:
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Also, something weird happens....When I conenct to VC (Get-VC <VCServerName>) I connect to the VC, but I am NEVER prompted for my credentials. I can read VC fine, but even a simple "new-vm" command fails.
greg
The VI Toolkit will take advantage of SSPI if you have it configured in your environment. Is it possible that this is what happens? When you connect to VC, are you able to run the get-vmhost cmdlet successfully?