How to return DDA device to the host if the VM has been removed?

JD 51 Reputation points
2022-07-13T08:51:11.847+00:00

I have a device assigned to a VM through DDA a long time ago. This VM was recently removed from the server without returning the device to the host. Now I am unable to do so because the command Remove-VMAssignableDevice requires me to define the VMName, while this VM no longer exists.

The device is now stuck in a weird status such that it cannot be used by anything (neither the host nor other VMs). On the host, I do have a device called "PCI Express Graphics Processing Unit - Dismounted" under system devices, which is expected for a device assigned to a VM.

Any idea on how I can get this device back running would be greatly appreciated!

Windows for business Windows Client for IT Pros Storage high availability Virtualization and Hyper-V
{count} votes

Accepted answer
  1. Eric Siron 1,586 Reputation points MVP
    2022-07-20T14:18:23.267+00:00

    I don't have any DDA-capable devices to test this with so I can't guarantee any of this.

    First, the cmdlets that take a -VMName parameter allow wildcards. So -VMName * should always work.
    Second, reviewing the available cmdlets, I can't be certain that you're using the one that you want. It seems like the cmdlets with "VMAssignable" in the name are only applicable when working with specific virtual machines. Since the VM in question is gone, I would think that you'd have to look at the device, not VMs. Maybe give the "VMHostAssignableDevice" cmdlets a look.

    PS C:\Windows\system32> Get-Command *assignable*  
      
    CommandType     Name                                               Version    Source  
    -----------     ----                                               -------    ------  
    Cmdlet          Add-VMAssignableDevice                             2.0.0.0    Hyper-V  
    Cmdlet          Add-VMHostAssignableDevice                         2.0.0.0    Hyper-V  
    Cmdlet          Dismount-VMHostAssignableDevice                    2.0.0.0    Hyper-V  
    Cmdlet          Get-VMAssignableDevice                             2.0.0.0    Hyper-V  
    Cmdlet          Get-VMHostAssignableDevice                         2.0.0.0    Hyper-V  
    Cmdlet          Mount-VMHostAssignableDevice                       2.0.0.0    Hyper-V  
    Cmdlet          Remove-VMAssignableDevice                          2.0.0.0    Hyper-V  
    Cmdlet          Remove-VMHostAssignableDevice                      2.0.0.0    Hyper-V  
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.