Hi,
the following (part of my) script creates VM´s with the VM-Version 4:
New-VM -Host $Horst -Name $vmName -DiskMB $HDsize -MemoryMB $RAMsize -NumCPU $ProcNum -GuestID $OSname -Datastore $Datastore -NetworkName $Network -CD -Description $Description
How do i create VM´s with Version 7?
Thx in advance
You can upgrade the hardware to version 7 after the creation of the VM like this:
$vm = New-VM -Host $Horst -Name $vmName -DiskMB $HDsize -MemoryMB $RAMsize -NumCPU $ProcNum -GuestID $OSname -Datastore $Datastore -NetworkName $Network -CD -Description $Description $vmview = $vm | Get-View if ($vmView.Config.Version -eq "vmx-04") {$vmView.UpgradeVM_Task("vmx-07")}
Regards, Robert
Hi chakoe,
Can you clarify the version of PowerCLI that you are using and the version of the VC or ESX on which you run this command.
Thanks,
Vitali
Hi,
Since PowerCLI 4.1 we've introduced Version parameter in the New-VM cmdlet. The valid values are listed in VMVersion enum
Now you can create VM and specify the version explicitly:
New-VM -Host $Horst -Name $vmName -DiskMB $HDsize -MemoryMB $RAMsize -NumCPU $ProcNum -GuestID $OSname -Datastore $Datastore -NetworkName $Network -CD -Description $Description -Version v7
By default, the new virtual machine is created with the highest available version.
Regards,
Yasen Kalchev
PowerCLI Dev Team