What happens when a VM with passthrough devices gets shut down

win9

New Member
May 6, 2024
14
1
3
The motivation of this question is that I'm a home server user and I hope to shut down hard drives when I don't need them to save power.

Let's say I passthrough the onboard SATA controller to a VM. What happens to the SATA controller and the hard drives connected to it if I shut down the VM?

I've seen a claim that shutting down this VM also shuts down the SATA controller. In this case, hard drives stop working since the data connection is closed.
There are two assumptions here:
1) the hard drives do not work when the data connection is closed, even though the power is still on (according to the person who made this claim, this behavior of hard drives depend on the firmware)
2) PVE doesn't take over the SATA controller, therefore the controller remains shutting down.

Are these assumptions valid/correct? If not, what happens?
 
Servers were meant to be up 24/7/365...maybe you're aware of that and your assumptions are correct.
 
Although it probably depends on SATA CTRL model, firmware, drive firmware and VM's OS features/settings ...

I did some tests on my consumer hardware node with an OpenMediaVault VM with mainboard SATA CTRL passed to it and the results are :
- SATA CTRL still visible by PVE node, maybe in low power mode but certainly not powered-off ...
- ... because pass-through is telling the hypervisor "do not use this hardware yourself but if VM xyz talk to device abc then allow it"
- disks are spun down (or maybe put to low power mode for SSD's) but ...
- ... it probably depends on VM's OS feature/settings to tell disks to sleep after X minutes of inactivity or at shutdown of the OS
- shuting down the VM with the pass-through CTRL will prevent any "software" action to awake the drive (if asleep) but ...
- ... the drive is still "physically" powered (even in low power mode or spun down) so if you hot-unplug-replug the drive will restart
- I didn't see power usage difference, probably in the margin or error of my consumer-grade power-meter + load variation of the PVE node with only 1 VM remaining + the slight CPU usage decrease from shutting down the VM

Hope it helps !
 
  • Like
Reactions: win9
Servers were meant to be up 24/7/365...maybe you're aware of that and your assumptions are correct.
My home server, which basically only serves me, doesn't have to be running at full capacity 24/7:) thx anyway
 

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!