Mr.Will Posted October 2, 2022 Share Posted October 2, 2022 (edited) Hello unraiders I have a Windows 10 VM inside Unraid phisically residing in the SSD cache. The "C:" drive is a thin provisioned file (not passthrough), and G: is just the Google Drive virtual unit stored inside C:. It has all the Red Hat virtio drivers installed and so on. However, Windows detects the device as an HDD in task manager instead of SSD. In the defrag console it displays as "thin provisioned disk" (sorry, the picture is in spanish). I'm guessing Windows is not taking the full advantages of an SSD, and possibly not using TRIM. Questions are: - Is it really required to change it to SSD somehow? The underlaying OS (unraid) should treat it as an SSD anyway - If so, how can I change it to SSD? Below is the disk definition. I already tried adding "discard='unmap'" after cache (following another forum), but it still shows the same. Thank you!! <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/Windows 10/vdisk1.img' index='2'/> <backingStore/> <target dev='hdc' bus='virtio'/> <boot order='1'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> Edited October 2, 2022 by Mr.Will Quote Link to comment
JorgeB Posted October 2, 2022 Share Posted October 2, 2022 See here to enable unmap/trim: https://forums.unraid.net/topic/51703-vm-faq/?do=findComment&comment=557606 1 Quote Link to comment
Mr.Will Posted October 2, 2022 Author Share Posted October 2, 2022 Thank you for your reply @JorgeB. As I mentioned in my original post, I already did that but "HDD" still shows in the task managr. Does that mean that "HDD" is going to show regardsless? Should I not worry about that? Quote Link to comment
JorgeB Posted October 2, 2022 Share Posted October 2, 2022 That's not a problem, to show as an SSD you'd need to pass-through the device. Quote Link to comment
ghost82 Posted October 2, 2022 Share Posted October 2, 2022 Try to change to this: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/Windows 10/vdisk1.img' index='2'/> <backingStore/> <target dev='hdc' bus='virtio' rotation_rate='1'/> <boot order='1'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> to force to be seen as ssd. 1 Quote Link to comment
Mr.Will Posted October 2, 2022 Author Share Posted October 2, 2022 4 hours ago, ghost82 said: Try to change to this: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback'/> <source file='/mnt/user/domains/Windows 10/vdisk1.img' index='2'/> <backingStore/> <target dev='hdc' bus='virtio' rotation_rate='1'/> <boot order='1'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> to force to be seen as ssd. Thanks. I tried adding rotation_rate='1' as you suggest but it errors saying it only works with SATA, SCSI or IDE. It's Virtio so I tried changing it to SCSI and the VM blue screens to death. I had to turn it back to Virtio and remove rotation_rate='1' I think I may need to somehow change the driver to SCSI before changing the config of the VM. Not sure how though. Also, Virtio is supposed to be the best performant (at least that's what Unraids help says), no not sure if the change is worth it. Thanks again! Quote Link to comment
ghost82 Posted October 2, 2022 Share Posted October 2, 2022 59 minutes ago, Mr.Will said: I tried adding rotation_rate='1' as you suggest but it errors saying it only works with SATA, SCSI or IDE true, sorry, virtio is not compatible with rotation_rate Quote Link to comment
Mr.Will Posted October 2, 2022 Author Share Posted October 2, 2022 Thanks for trying anyway Is it really recommended to have windows identify it as an SSD or Unraid will take care of the writing appropriately? Any drawbacks on changing Virtio to SCSI? And... how would one do that? Quote Link to comment
ghost82 Posted October 2, 2022 Share Posted October 2, 2022 (edited) I think the important thing is to make trim to work for the virtual disk. virtio, and in particular virtio-blk should support trim, try to add discard=unmap: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback' discard='unmap'/> <source file='/mnt/user/domains/Windows 10/vdisk1.img' index='2'/> <backingStore/> <target dev='hdc' bus='virtio'/> <boot order='1'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> Check available size of the real disk in unraid, copy a big file inside the vm on the virtual disk. Check again available size of the real disk: should have decreased. Delete the file you copied from inside the vm. Check available size of the real disk: if it increases again trim is working correctly. This is what JorgeB pointed in his reply. Edited October 2, 2022 by ghost82 Quote Link to comment
Mr.Will Posted October 4, 2022 Author Share Posted October 4, 2022 On 10/2/2022 at 11:47 PM, ghost82 said: I think the important thing is to make trim to work for the virtual disk. virtio, and in particular virtio-blk should support trim, try to add discard=unmap: <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='writeback' discard='unmap'/> <source file='/mnt/user/domains/Windows 10/vdisk1.img' index='2'/> <backingStore/> <target dev='hdc' bus='virtio'/> <boot order='1'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> Check available size of the real disk in unraid, copy a big file inside the vm on the virtual disk. Check again available size of the real disk: should have decreased. Delete the file you copied from inside the vm. Check available size of the real disk: if it increases again trim is working correctly. This is what JorgeB pointed in his reply. Do you mean the allocated space in the VM tab of Unraid? What I see there is quite strange. If the VM is off it says 407Gb allocated (out of 600). If the VM is on then it's 583Gb allocated. If I check on windows it's using 407Gb. Of course, if I try to copy or remove a file to/from the VM the size doesn't increase or reduce. Unmap is added of course. Quote Link to comment
Mr.Will Posted October 14, 2022 Author Share Posted October 14, 2022 On 10/4/2022 at 8:16 PM, Mr.Will said: Do you mean the allocated space in the VM tab of Unraid? What I see there is quite strange. If the VM is off it says 407Gb allocated (out of 600). If the VM is on then it's 583Gb allocated. If I check on windows it's using 407Gb. Of course, if I try to copy or remove a file to/from the VM the size doesn't increase or reduce. Unmap is added of course. Is that supposed to happen? Quote Link to comment
Recommended Posts
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.