Skip to content

[Feature]: Set different DISK_OPTS for various virtual disks #974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Namorzyny opened this issue Apr 12, 2025 · 7 comments
Open

[Feature]: Set different DISK_OPTS for various virtual disks #974

Namorzyny opened this issue Apr 12, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@Namorzyny
Copy link

Is your proposal related to a problem?

I installed packages on an SSD-based image file, but other data is stored on an HDD-based image file. I noticed the ssd option in the volumes' mount settings, likely because the default value is 1 in:

: "${DISK_ROTATION:="1"}" # Rotation rate, set to 1 for SSD storage and increase for HDD

However, I cannot set different values for different image files.

Describe the solution you'd like.

I want to add environment variables like DISK2_ROTATION to set corresponding values for them individually.

Describe alternatives you've considered.

Alternatively, provide a variable like DISK2_EXTRA_OPTS, as some users may need more custom parameters.

Additional context

No response

@Namorzyny Namorzyny added the enhancement New feature or request label Apr 12, 2025
@kroese
Copy link
Collaborator

kroese commented Apr 12, 2025

@Namorzyny I don't think it would be necessary to set that flag. As far as I know it is used by Windows to detect that the drive is a spinning hdd and then it will schedule defragmentation (which it doesnt do when it's an ssd). But DSM is based on Linux, and doesnt do any automatic defragmentation like that. So I do not think there would be any advantage when it's detected as a hdd vs ssd.

@Namorzyny
Copy link
Author

@Namorzyny I don't think it would be necessary to set that flag. As far as I know it is used by Windows to detect that the drive is a spinning hdd and then it will schedule defragmentation (which it doesnt do when it's an ssd). But DSM is based on Linux, and doesnt do any automatic defragmentation like that. So I do not think there would be any advantage when it's detected as a hdd vs ssd.

Okay, I think the ssd option might reduce the performance of images on HDD, so should DISK_ROTATION be set to HDD instead?

@kroese
Copy link
Collaborator

kroese commented Apr 12, 2025

You can set it to DISK_ROTATION=7200 to emulate a HDD that spins at 7200 rotations. And if you notice any difference I will add a feature so that you can specify it for each disk individually. But Im almost sure you will not notice any difference at all.

@Namorzyny
Copy link
Author

@kroese Thank you. I'll try it and see how it works.

@Namorzyny
Copy link
Author

@kroese Oh, I forgot to mention that since vdsm doesn't have data scrubbing settings, I plan to use a script to perform balance and scrub regularly, which is why I noticed this issue.

@Namorzyny
Copy link
Author

You can set it to DISK_ROTATION=7200 to emulate a HDD that spins at 7200 rotations. And if you notice any difference I will add a feature so that you can specify it for each disk individually. But Im almost sure you will not notice any difference at all.

@kroese It's strange. I have set DISK_ROTATION=7200, and /sys/block/<disk>/queue/rotational shows 1, but the ssd option is still here. 👀

@Namorzyny
Copy link
Author

You can set it to DISK_ROTATION=7200 to emulate a HDD that spins at 7200 rotations. And if you notice any difference I will add a feature so that you can specify it for each disk individually. But Im almost sure you will not notice any difference at all.

@kroese It's strange. I have set DISK_ROTATION=7200, and /sys/block/<disk>/queue/rotational shows 1, but the ssd option is still here. 👀

But they still seem to have some differences.

Sequential DISK_ROTATION=1, bs=1M, ioengine=libaio, iodepth=1:
read: IOPS=148, BW=148MiB/s (155MB/s)(8886MiB/60003msec)
write: IOPS=145, BW=145MiB/s (152MB/s)(8703MiB/60005msec)

Sequential DISK_ROTATION=7200, bs=1M, ioengine=libaio, iodepth=1:
read: IOPS=129, BW=130MiB/s (136MB/s)(7780MiB/60011msec)
write: IOPS=122, BW=123MiB/s (129MB/s)(7378MiB/60003msec)

Random DISK_ROTATION=1, bs=4k, ioengine=libaio, iodepth=32:
read: IOPS=86, BW=348KiB/s (356kB/s)(20.5MiB/60222msec)
write: IOPS=87, BW=351KiB/s (360kB/s)(20.6MiB/60222msec)

Random DISK_ROTATION=7200, bs=4k, ioengine=libaio, iodepth=32:
read: IOPS=97, BW=389KiB/s (399kB/s)(22.9MiB/60333msec)
write: IOPS=98, BW=393KiB/s (403kB/s)(23.2MiB/60333msec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants