Can't remove virtual disks completely

gdlr 101 Reputation points
2020-10-25T22:02:09.79+00:00

I'm creating a lot of differencing disks for my project and deleting them after some time.

I use "detach vdisk" command, they disappear from disk management but they are not completely removed...

When i use "list vdisk" command there is a huge list with all the virtual disks ever attached:
34749-b5c13e178e1511c9164ec57698195da7.png

I couldn't find a way to clear this and I have no idea if it will impact performance at some point. Does anyone know where all this info is stored and how to remove it?

Is there any way to completely remove a virtual disk so it won't show up in this list after?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,602 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,112 questions
0 comments No comments
{count} votes

Accepted answer
  1. gdlr 101 Reputation points
    2020-10-26T19:46:07.83+00:00

    I tested and restarting computer clears the list.

    1 person found this answer helpful.

7 additional answers

Sort by: Most helpful
  1. Malcolm Kobes 11 Reputation points
    2020-10-25T23:23:35.63+00:00

    Like the command you used "detatch vdisk" suggests, you detach the vdisk. The actual file does not get removed and does stay on the disk until you actualy remove the file.

    (If the reply was helpful please don't forget to accept it as the answer, thank you)

    2 people found this answer helpful.
    0 comments No comments

  2. Dave Patrick 426.1K Reputation points MVP
    2020-10-25T23:15:53.737+00:00

    Can you remove them?
    https://learn.microsoft.com/en-us/powershell/module/storage/remove-virtualdisk?view=win10-ps

    --please don't forget to Accept as answer if the reply is helpful--

    1 person found this answer helpful.
    0 comments No comments

  3. Xiaowei He 9,871 Reputation points
    2020-10-26T06:08:51.73+00:00

    Hi,

    As @Malcolm Kobes mentioned, when we use "detatch vdisk", it only stops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer, while the vdisk files still exist, we need to delete the VHDXs in the listed location manually.

    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/detach-vdisk

    Thanks for your time!
    Best Regards,
    Anne

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  4. gdlr 101 Reputation points
    2020-10-26T08:23:32.777+00:00

    But I delete the file after ... I use Remove-Item from powershell.

    The disk still remains listed there. I have almost 3000 disks now ...

    @Dave Patrick
    I can't figure out how to use Remove-VirtualDisk here. I tried following commands but they don't work. Where can I find out the name or the friendly name of the virtual disks that show up in diskpart list?

    Remove-VirtualDisk -FriendlyName "VDisk 2852"

    Remove-VirtualDisk -Name "VDisk 2852"

    Also, I have to mention that the disks are created on a virtual machine that doesn't run Hyper-V services. Can this be causing the problem?

    0 comments No comments