Afaik sata doesn't support trim.
You have to use virtio for trim to work.
Download virtio drivers here: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Install the vioscsi driver, after that power down the vm and change the config from "sata0" to "scsi0" in /etc/pve/qemu-server/105.conf
Then power up again and download sdelete https://docs.microsoft.com/en-us/sysinternals/downloads/sdelete
Run "sdelete.exe -z" in admin cmd. Wait for 20 minutes and check used space on the hypervisor.
Thanks! So whats the correct way after migrating a disk to proxmox? Only the steps you mentioned? Ireplaced the sata to scsi in 105.conf. Even though it was only the boot-order where I have found a "sata0" snippet. Thats my current 105.conf
Code:
root@pve-01:~# qm conf 105
agent: 1
bios: ovmf
boot: order=scsi0
cores: 4
ide2: cephfs:iso/virtio-win-0.1.185.iso,media=cdrom,size=402812K
memory: 16384
name: JS-Veeam-95
net0: e1000=0A:44:3B:2B:90:0B,bridge=vmbr0,firewall=1
sata0: vm_nvme:vm-105-disk-0,discard=on,size=200G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=c4310d6a-7776-4811-8c9e-26609be5e922
vmgenid: 28f9ab6a-e74e-4f5a-a6ce-9f801bd41a2e
I tried
sdelete.exe -z c:
waited for it to complete, the disk size was fully used again (rbd -du
). I runned disk optimization and Optimize-Volume -DriveLetter C -ReTrim -Verbose
again. Now I am at the same size again:
Code:
Every 2.0s: rbd du vm_nvme/vm-105-disk-0 pve-01: Mon Feb 22 08:36:56 2021
NAME PROVISIONED USED
vm-105-disk-0 200 GiB 128 GiB
So summarized:
- Windows VM transfered from VMware (vSAN) to Proxmox via OFV-Tool (x)
- Imported VM via qm importovf + settings for windows to boot (x)
- Install virtio drivers (x)
- changed qm conf 105 to scsi0 (x)
- VM has discard and ssd emulation enabled (x)
sdelete.exe -z c:
-> disk space is fully used again accordingrbd -du
(x)Optimize-Volume -DriveLetter C -ReTrim -Verbose
is freeing up space but not completly (72 GB less, but still like 100GB left that should not be used)- Optimizing c via GUI does the same (C -> Computer -> Rightclick -> Optimize)
rbd sparsify --image vm_nvme/vm-105-disk-0
is running right now (-> reduced size about 1GB only) (x)- QM-Guest-Agent is running in Windows (x)
- QM-Guest Agent is activated in VM-Config (x)
- qm agent 105 fstrim still running in timeout ...
Proxmox GUI still says my disk is sata:
how can I change that to scsi? Edit: I detached disk, changed it to scsi and attached it again. letme see. -
Now I have bluescreen damn it. If I change it back to sata, everything works again. Got it working with workaround by addin scsi temporary disk. change boot disk to scsi0, remove the temp disk. scsi ok now.
- sdelete.exe -z c: is now running on windows 2k16 with scis0 working
- will report later: but space is getting more used, not less used (according to rbd -du)
- after setting to scsi0 and doing sdelete -z c: something changed (but optimizing it still does not free up space)
- I mean its a progress because windows knows that its not sufficient and that it mightwork with thin but yeah its still not freeing up space
- will try sparsify again...-> still not freeing up space
Last edited: