tomaae / homeassistant-openmediavault

OpenMediaVault integration for Home Assistant
Apache License 2.0
109 stars 16 forks source link

Preventing hdd spin-down? #19

Closed malinduta closed 11 months ago

malinduta commented 4 years ago

Hello! After installing this integration, omv hdd is not spinning down anymore. Using hd-idle for spinning down, with 30 min. idle time. Is this normal?

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.57. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

tomaae commented 4 years ago

Should not be. I was testing this during development and check did not cause spin up.

malinduta commented 4 years ago

Any thoughts on how to make it spin down?

tomaae commented 4 years ago

try removing the integration and see if they spin down. if they do, I will check what I can do.

malinduta commented 4 years ago

yes, they do spin down!

tomaae commented 4 years ago

ok, I will have a look

malinduta commented 4 years ago

Upgraded the hard disks and the issue seems to be gone.

tomaae commented 4 years ago

thats strange, best would be to test it for longer

malinduta commented 4 years ago

Payed more attention on new hard disks. OMV integration is asking for informations, as the read/write led from hdds is blinking every minute (guesstimating), but the hdds are not spinning up. I tend to belive it`s hardware related. Not using hd-idle anymore as hdds spin down themselves after 30-60 sec. of idleing.

tomaae commented 4 years ago

yes, it is requesting smart information. but only a method that should not cause spin-up. I have tested it only on my nas with wd red's. other disks may spin up, not sure. 30-60 sec spin-down time is too fast, thats not healthy for them. you can set up custom time using OMV GUI. I use 30 minutes for example.

malinduta commented 4 years ago

WD also, blue. Previous was Seagate. Had to use hd-idle to spin it down.

Set 20 minutes spindown on OMV. Nothing changed, the spindown time is the same, 30-60 sec.

tomaae commented 4 years ago

These are my settings for WD Red. image

Then smart disabled: image

And again in smart devices image

malinduta commented 4 years ago

Tryed your setup. No spindown. Replaced 128 with 127 - reverts to old behaviour, spindown 30-60 sec.

tomaae commented 4 years ago

if there is no spindown on 128, its possible that something accesses that disk

malinduta commented 4 years ago

Removed all possible access from exterior. It`s or the disks, or OMV integration.

blackscreener commented 3 years ago

Hello! After installing this integration, omv hdd is not spinning down anymore. Using hd-idle for spinning down, with 30 min. idle time. Is this normal?

+1 After installing this integration, omv hdd is not spinning down anymore. I also use hd-idle for spinning down.

tomaae commented 3 years ago

Wish I knew whats causing this for some people. I'm not able to reproduce it.

TigerHobbes commented 3 years ago

Hello. I too have this same issue with HDD's not spinning down when using this integration in HomeAssistant. My OMV5 is running remotely on a pi4 along with plex. It uses a Sabrent 5 bay USB docking station. All HDD's auto spindown after 10-20 min normally.

On a second pi4 I installed Raspiban lite (latest build and all up to date) and the supervisor install of HomeAssistant in a docker. Along with that I also installed the HACS community store which got me to the OMV integration.

I check all my drives with a batch file and putty SSH to see that they are all on standby using hdparm commands hdparm -C /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

they would normally report as being in standby from no activity (spindown).

Once I install the OMV integration and set it up, it creates all the entities for the OMV system and each drive, like the disk space and whatnot. during that setup, of course, all the drives have to come out of standby for HA to create all it's entities. All HDD then report hdparm as active.

Now at that point, I haven't added anything to the HA dashboard (post OMV integration install and setup). If I let the system idle, the drives don't go back to standby at all. No rebooting or anything basic fixes the issue.
What I have tried to do though is to disable all the Disk entities so that I can at least view the OMV status things, like uptime, RAM, updates available, etc. That however did not allow the drives to go back to standby.

I made another batch command file to force all drives to go into standby using hdparm -y . All disks will then spindown, but then instantly spin back up due to HA / OMV integration accessing them in some way.

I've tried messing around with it for a few hours but the only way I can keep the drives in standby is to remove the OMV integration / uninstall it, then reboot the system. Then all is back to normal , however, sans HA OMV which I was hoping to get. Although for me personally, I don't need HA to tell me the disk space or usage at all. But I would like my HA to report if my drives are in standby which I'm trying to figure out another way to get that reporting through SSH or something else, something that can just send the hdparm -C command and report either "standby" or "active" in some way. still trying to figure that out.

I don't know what logs I can get you to try to figure out this issue, if it even is an issue or a bug. But let me know. I'm pretty quick to reply unless I'm asleep at night.

Cheers and thanks for time in what you do for others.

willsy555 commented 3 years ago

Same issue here. If I have this integration installed hd-idle becomes useless and the disks continually wake. Took me ages to find out... Would be nice to have this one working without waking up the disks.

ShonP40 commented 3 years ago

Getting the same issue. My drive spins down, and then immediately spins back up again while running this integration.

tomaae commented 3 years ago

that unusual. what is your spin-down time?

ShonP40 commented 3 years ago

I had it set to 10 minutes first Then tried 30

But somehow I hear the drive spin up every 30-60 seconds (didn’t happen before installing the integration)

ShonP40 commented 3 years ago

I just noticed that the drive wakes up every time I load the OpenMediaVault WebUI. So there's probably no way to prevent this integration from waking it up as long as you're using the OMV RPC.

tomaae commented 3 years ago

Yea, that is tricky. Problem is that I dont have access to hardware with OMV right now. I only setup VM so I can fix issues.

leon-Glitchking commented 2 years ago

I am getting the same issue. spent 2 days trying to figure out why drives were not spinning down and getting hot. Finally realised it was the integration from my pi 4 home assistant integration. Tried disabling integration and that did not work had to fully uninstall in hacs.

I could force a spin down with “hdparm –y“, but they would spool back up again after about 15-30 seconds.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tomaae commented 2 years ago

is this still a thing?

noiob commented 2 years ago

I'm pretty sure it still is, just going by drive temperature my drive is running a lot more that it should

tomaae commented 2 years ago

well, I dont know how to solve it since I dont own any mechanical disk anymore. if someone is willing to help finding out what is causing it, I will look into it.

BebeMischa commented 2 years ago

My OMV machine contains 4 mechanical disks. How can I help you?

tomaae commented 2 years ago

Thanks. First, remove the server from OMV integration if you use it so it wont interfere. We will be spinning down the disk manually and testing which command will spin it up. It is usually audible in quiet room, or you can just touch it and you will feel it spinning up. It would be ideal to perform test several times to be sure. No need to give me any cli outputs, whose dont matter in this case.

replace all /dev/sdx for devicefile of drive you will be testing.

force spindown with hdparm –y /dev/sdx and wait few seconds until it spins down. sudo omv-rpc -u admin "DiskMgmt" "enumerateDevices" sudo omv-rpc -u admin "Smart" "getInformation" '{"devicefile":"/dev/sdx"}' sudo omv-rpc -u admin "Smart" "getAttributes" '{"devicefile":"/dev/sdx"}'

BebeMischa commented 2 years ago

image

but:

image

tomaae commented 2 years ago

try to type it by hand, most likely a hidden character or tab

BebeMischa commented 2 years ago
root@MischaNAS:~# sudo omv-rpc -u admin "DiskMgmt" "enumerateDevices"
[{"devicename":"sda","canonicaldevicefile":"\/dev\/sda","devicefile":"\/dev\/dis                                                                                                                                                             k\/by-id\/ata-ADATA_SU650_2J3820137494","devicelinks":["\/dev\/disk\/by-id\/ata-                                                                                                                                                             ADATA_SU650_2J3820137494","\/dev\/disk\/by-path\/pci-0000:00:1f.2-ata-1"],"model                                                                                                                                                             ":"ADATA SU650","size":"120034123776","description":"ADATA SU650 [\/dev\/sda, 11                                                                                                                                                             1.79 GiB]","vendor":"ATA","serialnumber":"2J3820137494","wwn":"","israid":false,                                                                                                                                                             "isroot":true},{"devicename":"sdb","canonicaldevicefile":"\/dev\/sdb","devicefil                                                                                                                                                             e":"\/dev\/disk\/by-id\/ata-TOSHIBA_HDWD130_89JEUA3CS","devicelinks":["\/dev\/di                                                                                                                                                             sk\/by-id\/ata-TOSHIBA_HDWD130_89JEUA3CS","\/dev\/disk\/by-id\/wwn-0x5000039fe6f                                                                                                                                                             08e68","\/dev\/disk\/by-path\/pci-0000:00:1f.2-ata-3"],"model":"TOSHIBA HDWD130"                                                                                                                                                             ,"size":"3000592982016","description":"TOSHIBA HDWD130 [\/dev\/sdb, 2.72 TiB]","                                                                                                                                                             vendor":"ATA","serialnumber":"89JEUA3CS","wwn":"0x5000039fe6f08e68","israid":fal                                                                                                                                                             se,"isroot":false},{"devicename":"sdc","canonicaldevicefile":"\/dev\/sdc","devic                                                                                                                                                             efile":"\/dev\/disk\/by-id\/ata-TOSHIBA_DT01ACA300_95PGWDEGS","devicelinks":["\/                                                                                                                                                             dev\/disk\/by-id\/ata-TOSHIBA_DT01ACA300_95PGWDEGS","\/dev\/disk\/by-id\/wwn-0x5                                                                                                                                                             000039fe3c6c40e","\/dev\/disk\/by-path\/pci-0000:00:1f.2-ata-4"],"model":"TOSHIB                                                                                                                                                             A DT01ACA300","size":"3000592982016","description":"TOSHIBA DT01ACA300 [\/dev\/s                                                                                                                                                             dc, 2.72 TiB]","vendor":"ATA","serialnumber":"95PGWDEGS","wwn":"0x5000039fe3c6c4                                                                                                                                                             0e","israid":false,"isroot":false},{"devicename":"sdd","canonicaldevicefile":"\/                                                                                                                                                             dev\/sdd","devicefile":"\/dev\/disk\/by-id\/ata-TOSHIBA_HDWD130_89JEU6DCS","devi                                                                                                                                                             celinks":["\/dev\/disk\/by-id\/ata-TOSHIBA_HDWD130_89JEU6DCS","\/dev\/disk\/by-i                                                                                                                                                             d\/wwn-0x5000039fe6f08df5","\/dev\/disk\/by-path\/pci-0000:00:1f.2-ata-5"],"mode                                                                                                                                                             l":"TOSHIBA HDWD130","size":"3000592982016","description":"TOSHIBA HDWD130 [\/de                                                                                                                                                             v\/sdd, 2.72 TiB]","vendor":"ATA","serialnumber":"89JEU6DCS","wwn":"0x5000039fe6                                                                                                                                                             f08df5","israid":false,"isroot":false},{"devicename":"sde","canonicaldevicefile"                                                                                                                                                             :"\/dev\/sde","devicefile":"\/dev\/disk\/by-id\/ata-TOSHIBA_DT01ACA300_Y5PN63PGS                                                                                                                                                             ","devicelinks":["\/dev\/disk\/by-id\/ata-TOSHIBA_DT01ACA300_Y5PN63PGS","\/dev\/                                                                                                                                                             disk\/by-id\/wwn-0x5000039fe3c92e64","\/dev\/disk\/by-path\/pci-0000:00:1f.2-ata                                                                                                                                                             -6"],"model":"TOSHIBA DT01ACA300","size":"3000592982016","description":"TOSHIBA                                                                                                                                                              DT01ACA300 [\/dev\/sde, 2.72 TiB]","vendor":"ATA","serialnumber":"Y5PN63PGS","ww                                                                                                                                                             n":"0x5000039fe3c92e64","israid":false,"isroot":false}]
tomaae commented 2 years ago

no need for output. I just need to know where HDD spins up :)

BebeMischa commented 2 years ago

oeps, i think, i need to stop containers with plex and bittorent, they may interupt us, wait a minut

tomaae commented 2 years ago

take as much time as you need. it does not need to be today.

BebeMischa commented 2 years ago

Ok, this is strange, OMV integration in HA is disabled, all extra container on the machine are stopped, but hdd's spin up automatically some seconds after the initiated spindown, with no command from me. So it is stil OMV it self, who spins them up...

tomaae commented 2 years ago

maybe you have smart checks enabled in OMV?

BebeMischa commented 2 years ago

yes, i try that...

blackscreener commented 2 years ago

My HDD idle perfect without hass OMV integration.

pon., 21 mar 2022, 12:52 użytkownik Tomaae @.***> napisał:

maybe you have smart checks enabled in OMV?

— Reply to this email directly, view it on GitHub https://github.com/tomaae/homeassistant-openmediavault/issues/19#issuecomment-1073802201, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPG7NA2W65FG55US5B3KMLVBBPHRANCNFSM4O75J3EA . You are receiving this because you commented.Message ID: @.***>

tomaae commented 2 years ago

My HDD idle perfect without hass OMV integration. pon., 21 mar 2022, 12:52 użytkownik Tomaae @.> napisał: maybe you have smart checks enabled in OMV? — Reply to this email directly, view it on GitHub <#19 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPG7NA2W65FG55US5B3KMLVBBPHRANCNFSM4O75J3EA . You are receiving this because you commented.Message ID: @.>

You may give a try to those commands too then. More data is always better.

blackscreener commented 2 years ago

OK, I will try later.

BebeMischa commented 2 years ago

ok, all smart capability functions disabled, built in DLNA server disabled, they still spin up... what ever its the cause, it is not HA integration... :-)

tomaae commented 2 years ago

Who knows, we will wait for @blackscreener to test it then. But thanks for trying :)

attilastrba commented 2 years ago

Fyi guys had the same effect, I am 100% sure it is caused by the integration. I have still physical HDD if there is any way I can assist let me know! I would love to see this working

tomaae commented 2 years ago

Fyi guys had the same effect, I am 100% sure it is caused by the integration. I have still physical HDD if there is any way I can assist let me know! I would love to see this working

yea, you can give this a try to help identify the issue: https://github.com/tomaae/homeassistant-openmediavault/issues/19#issuecomment-1073749601

blackscreener commented 2 years ago

Who knows, we will wait for @blackscreener to test it then. But thanks for trying :)

So sudo omv-rpc -u admin "Smart" "getInformation" '{"devicefile":"/dev/sdx"}' and sudo omv-rpc -u admin "Smart" "getAttributes" '{"devicefile":"/dev/sdx"}' spin-up HDD with ntfs (Driver=uas) file system. HDD with ext4 (Driver=usb-storage) sleeps fine. Maybe it's related to disk file system.

tomaae commented 2 years ago

both of them? interesting. usb-storage would be external USB drives, are they? Those should have separate controller on board which may behive differently.

could you test these if any cause spin up? sudo omv-rpc -u admin "Smart" "enumerateDevices" sudo omv-rpc -u admin "Smart" "enumerateMonitoredDevices" sudo omv-rpc -u admin "Smart" "getList" '{"start":0,"limit":25}' sudo omv-rpc -u admin "Smart" "getDeviceSettings" '{"devicefile":"/dev/sdx"}' I'm looking if there is alternate way or way to exclude them. Please also provide outputs if you can, since I dont have any mechanical and cant test output on them anymore.

MadJoker0815 commented 2 years ago

You could disable polling drive states or create a custom polling time for them. Once a day is for the most applications OK. But if you have disks running full and you want a direct message you might want to poll it even faster than the 20-30min at the moment. Is it possible to call the update of OMV drives via a service inside HomeAssistant? If so, everyone can create his own polling by creating an automation. Maybe activating/deactivating it via a switch in the Integration tab.