External HDD not going into spin down

dme

New Member
Oct 15, 2022
3
0
1
Hi all,

i have setup my first Proxmox server yesterday. Now I wanted to move all active applications from my raspi4 to a VM. I had an external HDD (WD Elements) attached to my raspi, which was used as storage for my Plex Server. With my raspi, the HDD was sent to spin down, if there was no activity (as the Plex server was not used 24/7 but rather in the evening hours, the HDD was not running - but available - most time of the day).

Now coming to my problem: My Proxmox Host and VMs are located on an internal SDD and I attached the WD Elements via usb 3.0 Port to my Server. I can see the HDD under "Disks"1665823548390.png

I am passing through the HDD to my VM:
1665823597670.png

And in the VM (which is running Debian) I am mounting the hdd using the fstab file. Since yesterday the HDD is always active and not spinning down, although from my side there is no interaction with the hdd.

Using Virtualization instead of the raspi is bringing another complexity level in the whole thing and I'm not able to find a solution by myself.

running hdparm on both - host and VM - I', getting a "not supported".

looking forward to your ideas!
 
Keep in mind that when using disk passthrough this won't passthrough the real physical disk. All your VM is seeing is a virtual disk which stores its data on that physical disk. So your guest OS shouldn't be able to send the real physical disk into any powersaving mode.
What you might want to try is to set the powersaving modes directly on the PVE host. Have a look at hdparm (which you might need to install first). You then can edit the config file and set the spindown interval and APM value there for your physical disk. Something like:
Code:
/dev/disk/by-id/usb-YourDiskID {
        spindown_time = 15
        apm = 1
}

And check if something is accessing that disk all the time. As long as there will be any IO to that disk, that disk won't spin down.
 
Last edited:
Keep in mind that when using disk passthrough this won't passthrough the real physical disk. All your VM is seeing is a virtual disk which stores its data on that physical disk. So your guest OS shouldn't be able to send the real physical disk into any powersaving mode.
What you might want to try is to set the powersaving modes directly on the PVE host. Have a look at hdparm (which you might need to install first). You then can edit the config file and set the spindown interval and APM value there for your physical disk. Something like:
Code:
/dev/disk/by-id/usb-YourDiskID {
        spindown_time = 15
        apm = 1
}

And check if something is accessing that disk all the time. As long as there will be any IO to that disk, that disk won't spin down.
Thanks for the idea. As mentioned, setting apm is not working on both - host and vm. Anyway, I found a solution by passing the whole USB port, instead of a disk. With this, only one system (the VM) is interacting with the hdd.
 
But that also isn't great. Do a benchmark, performance should be bad as USB passthrough is fully emulated and therefore got bad latency and throughput. USB passthrough is fine for simple stuff like a USB keyboard but not for devices like HDDs which need a lot of bandwidth. For those devices, you would be better to PCI passthrough the whole USB controller into the VM.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!