Hi,
I created a New Vm using the following code and booted into the BIOS. There I decided to boot from CD and the ISO linked to the CD drive is a windows PE ISO. On booting into WinPE, when I try and do a diskpart by running DISKPART at the command prompt and running list drive
it says "there are no fixed disks to show".
Am I doing something wrong here? Code below:
function to enable/disable boot into BIOS screen
filter Set-VMBIOSSetup
{
param(
)
if($_ -is http://VMware.VimAutomation.Types.VirtualMachine)
{
trap { throw $_ }
$vmbo = New-Object VMware.Vim.VirtualMachineBootOptions
$vmbo.EnterBIOSSetup = $true
if($Disable)
{
$vmbo.EnterBIOSSetup = $false
}
$vmcs = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmcs.BootOptions = $vmbo
($_ | Get-View).ReconfigVM($vmcs)
if($PassThru)
{
Get-VM $_
}
}
else
{
Write-Error "Wrong object type. Only virtual machine objects are allowed."
}
}
$index = 0
Create the virtual machines
1..$vmCount | %{
$vm = New-VM -VMHost $desiredHost -Name "testVm" -Datastore $ds -MemoryMB 8000
$vm | Set-VMBIOSSetup -PassThru
0..1 | %{$vm | New-HardDisk -Datastore $ds -CapacityKB (4*1MB) -Confirm:$false}
$netName = ($vm | Get-NetworkAdapter).NetworkName
0..2 | %{$vm | New-NetworkAdapter -NetworkName $netName -Confirm:$false}
0..2 | %{
$isoPath = '' + ' Installer/' + $myISOPath[$index++]
$vm | New-CDDrive -Confirm:$false -IsoPath $isoPath -StartConnected:$true
}
Start-VM -VM $vm -Confirm:$false
$vm | Get-CDDrive | Set-CDDrive -Connected:$true -Confirm:$false
$index = 0
}
Disconnect-VIServer -Confirm:$false
Yes, there has been a similar thread about the type of controller that was chosen.
See for the details.
In that thread there is also a link to my script in from .
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What does
Get-VM -Name "testVM" | Get-HardDisk
return when you are the BIOS boot prompt ?
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
This is what Get-HardDisk returns when the VM boots into the BIOS
Regards
Dhiman
Hi Dhiman,
The disks are there.
Then I suspect it has to do with the absence of drivers for the virtual controller in WinPE.
See KB1011710 on how you can include drivers for the virtual HW in a WinPE image.
Depending on your OS version, the type of the controller will be different. The sample drivers referenced in the KB are not necessarily the drivers you would need.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
I seem to have found the problem. It works if I manually create a VM and boot into the WinPE. I check the 2 VM configurations and found that the SCSI controller on the one I was creating via script is BuLogic whereas the VM created manually has an LSI Logic controller.
Can we change the SCSI controller via powercli? I guess we should be able to do this using ReconfigVM but not sure how to go about it.
Regards
Dhiman
Yes, there has been a similar thread about the type of controller that was chosen.
See for the details.
In that thread there is also a link to my script in from .
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference