SSD passthrough to Windows 10 VM


Recommended Posts

Hi,

 

TLDR: if someone knows of a precise way to have a SSD passthrough, completely, to Windows 10 VM, with TRIM working, and disk recognized as SSD, it would be amazing, since I did not get it to work as Thin Provisioned Drive (SCSI) which I've read from the below FAQ:

 

Solid State Drive (SATA) or Hard Disk Drive (virtio) do not seem to be fully working either

 

Issue: I have a Windows 10 VM which "works great" - no noticeable performance issues, my GPU is passthrough succesfully and my SSD is passthrough (somewhat successfully). The only issue I can see is that I cannot seem to be able to optimize the SSD so TRIM would work. The front end Optimize tool drive from Windows says "Optimization not available". I am not entirely certain this is an issue, but from what I'm reading, this seems to be something requiring a fix since it's an SSD.

 

I've read several posts on this forum to try to solve this issue and despite trying these three combinations, I seem stuck and/or am not finding a perfect solution including what I read in the VM FAQ, see above link. It sounds like my use case 2 is the one documented in the FAQ and would solve this, but it does not seem to do so.

 

My first uss case, when virtio-disk2 in XML, disk is recognized as Hard Disk, Optimize tool wanted to actually do a "defrag" instead of Optimize, so I do not think that's good, is it?

 

     <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/disk/by-id/ata-KINGSTON_xxxxxxxxxxxx_xxxxxxxxxxxxxxxx' index='2'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>

 

Second case, when SCSI in XML, disk is recognized as Thin Provisioned Drive and says "Optimization not Available" in front end, and cannot seem to be able to run defrag /O from command line - since this is from the FAQ, is it a problem that it cannot optimize?

 

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' discard='unmap'/>
      <source dev='/dev/disk/by-id/ata-KINGSTON_xxxxxxxxxxxx_xxxxxxxxxxxxxxxx'/>
      <target dev='hdc' bus='scsi'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    
Third case, which is the one I am currently running, disk is recognized as SSD, allows the Optimize from command line, but front end still does not seem to allow the Optimization. It completes the TRIM from command line, the UI seems to show progress in % while the command line is working, but cannot "trigger" the optimization from the front end - this seems to be the closest to it working.

 

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback' discard='unmap'/>
      <source dev='/dev/disk/by-id/ata-KINGSTON_xxxxxxxxxxxx_xxxxxxxxxxxxxxxx'/>
      <target dev='sda' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    
For use case two and three, i've added the following at the bottom per posts I've read, thinking it would help Windows identify as SSD.

For SCSI:

 

     <qemu:commandline>
        <qemu:arg value='-set'/>
        <qemu:arg value='device.scsi0-0-0-0.rotation_rate=1'/>
      </qemu:commandline>

 

and for SATA respectively:

 

      <qemu:commandline>
        <qemu:arg value='-set'/>
        <qemu:arg value='device.sata0-0-0.rotation_rate=1'/>
      </qemu:commandline>
      
Sorry for lengthy post, but if one of you would know what I could do to actually solve this. My goal is to have Windows understanding it's truly a SSD, be able to Optimize the drive on a weekly basis and actually keep my SSD healthy and performing well. I cannot distinguish any performance differences between all modes, virtio, scsi or sata, so any insights on this would be appreciated as well.

 

Thanks in advance!


 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.