I am trying to assign a PCIe device to a VM using DDA with Hyper-V using Windows Server 2019. I already have ACS and ASPM enabled in BIOS. Both dismount and add assigned device to VM are successful (no errors are shown). However when I start the VM, I got the error:
Failed to Power on with Error 'The hypervisor could not perform the operation because the object or value was either already in use or being used for a purpose that would not permit completing the operation.'.
Any suggestions where I should look into?
Below is the complete command sequence:
PS C:\Users\Administrator> $vmName = 'Ubuntu'
PS C:\Users\Administrator> $instanceId = 'PCI\VEN_8086&DEV_43A2&SUBSYS_72708086&REV_00\3&11583659&0&F5'
PS C:\Users\Administrator> $vm = Get-VM -Name $vmName
PS C:\Users\Administrator> $dev = (Get-PnpDevice -PresentOnly).Where{ $_.InstanceId -like $instanceId }
PS C:\Users\Administrator> Disable-PnpDevice -InstanceId $dev.InstanceId -Confirm:$false
PS C:\Users\Administrator> $locationPath = (Get-PnpDeviceProperty -KeyName DEVPKEY_Device_LocationPaths -InstanceId $dev.InstanceId).Data[0]
PS C:\Users\Administrator> Dismount-VmHostAssignableDevice -LocationPath $locationPath -Force -Verbose
VERBOSE: Dismount-VmHostAssignableDevice will dismount an assignable device so it can be assigned to a virtual machine.
PS C:\Users\Administrator> Get-VMHostAssignableDevice
InstanceID : PCIP\VEN_8086&DEV_43A2&SUBSYS_72708086&REV_00\3&11583659&0&F5
LocationPath : PCIROOT(0)#PCI(1E05)
CimSession : CimSession: .
ComputerName : WIN-66HJJTFH7EH
IsDeleted : False
PS C:\Users\Administrator> Set-VM -VM $vm -DynamicMemory -MemoryMinimumBytes 1024MB -MemoryMaximumBytes 4096MB -MemoryStartupBytes 1024MB -AutomaticStopAction TurnOff
PS C:\Users\Administrator> Add-VMAssignableDevice -VM $vm -LocationPath $locationPath -Verbose
VERBOSE: Add-VMAssignableDevice will add an assignable device to virtual machine "Ubuntu".
PS C:\Users\Administrator> Start-VM -vm $vm
Start-VM : 'Ubuntu' failed to start.
Virtual Pci Express Port (Instance ID B123BE62-FAAF-441B-8C03-C33751A01E59): Failed to Power on with Error 'The
hypervisor could not perform the operation because the object or value was either already in use or being used for a
purpose that would not permit completing the operation.'.
'Ubuntu' failed to start. (Virtual machine ID 50065806-E76A-4894-BC07-71FCB8EB1EB3)
'Ubuntu' Virtual Pci Express Port (Instance ID B123BE62-FAAF-441B-8C03-C33751A01E59): Failed to Power on with Error
'The hypervisor could not perform the operation because the object or value was either already in use or being used
for a purpose that would not permit completing the operation.' (0xC0350019). (Virtual machine ID
50065806-E76A-4894-BC07-71FCB8EB1EB3)
At line:1 char:1
- Start-VM -vm $vm
- ~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Start-VM], VirtualizationException
- FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.StartVM