Why can I only attach one spare disk now?

I can’t for the life of me figure out why this new release of TrueNAS limits you to only attaching a SINGLE device as a spare. Why? I can’t seem to find any info on this anywhere.

Hi,

I have done some testing today and found that all scale versions prior to 25.10 allow the addition of multiple spares. This includes 25.04.

If you upgrade to 25.10 and have pre-existing multiple spares, they are recognized and display the multiple spares when viewing the VDEVs in Storage as per prior versions.

Once a spare is consumed to replace a failed disk, and then promoted by detaching the failed disk, you can no longer add a spare back in via the WEB UI. In fact, if you have any spares, you cant add a spare back. Only once all spares are consumed that the option to add a spare back in becomes available.

I have read through the release notes and also can not find any information about this restriction.

The message that appears when adding a spare (click the question mark next to “Select Disk for Spare VDEV“) is: “Only one disk can be selected for the Spare VDEV”.

This change seems like an oversight to me and possibly done in error?

I’ve managed to work around this and can add spares another way.

Is there anything official about this? Perhaps I didn’t read the docs properly?

Glad to know I’m not going mad here, but can you share your workaround?

This is going to be a long answer (which should be short) - my apologies in advance and I’ll preface this by stating you really need to know what your doing when you do this.

I used the command line to add the spare.

There are many things that need to be taken in to consideration by doing this though and it’s not just a simple as doing a zpool add pool spare… It could be, but as always, it depends :slight_smile:

For anyone else reading this, I did take the time to read what is being done to partition a disk and then applied that logic to my system (there is a good reason that the code partitions the disks the way it does).

Have a good look at the middleware source on github if you want to learn more: https://github.com/truenas/middleware

This is probably the best way I can answer this without providing you with commands that could potentially compromise your system. I hope you understand.

Once you add the spare, the VDEV tree will be as you expect in the WEB UI.

2 Likes

This is just a UI limitation in the new release, not a ZFS limitation. For now, the pool only supports multiple backups, so you have to add them via the CLI. The UI will likely catch up in the next update.

What do you mean catch up? The previous releases don’t even have that limitation in the first place. This limitation was ADDED to the Goldeye release. I want to know why.

There is an old expression:

Never attribute to malice that which is adequately explained by stupidity.
Hanlon's razor - Wikipedia

Ideally, their would be a check list of items to verify after major GUI changes. Perhaps multiple hot spares was simply overlooked as something to check. Of course now is the time to add that to the check list, (and or automated GUI testing).

Since no one else did it, I created a bug on the issue:

Hopefully mine will be closed as a duplicate, (meaning iX / TrueNAS people already know about this problem). But, if not, they do now.

PS: You may have to log into Jira to see the bug

4 Likes

Would you be able to provide more specifics as to where to look. Middleware is quite big.

No problem, start here: middleware/src/middlewared/middlewared/plugins/pool_/format_disks.py at master · truenas/middleware · GitHub
And also look here: middleware/src/middlewared/middlewared/plugins/disk_/format.py at master · truenas/middleware · GitHub
But also check out the other code in pool_ and disk_.

I played around with Goldeye 25.10.0.1 in a VM, and yes, the Spare section in Add VDEV disappears after the first Hot Spare is added. I’ve added a screen shot to the Jira ticket showing the problem.

Weirdly enough, when I tried to add a second Cache / L2ARC device, it let me. So the functionality is in the GUI, just does not apply to Hot Spare devices.

Oh well, this is “Early Adopter” software… which clearly states that work around or bug reports may be needed.

Looks like the bug got attention in the other forum thread:

This problem is expected to be fixed in 25.10.1.

I’ve tested it in 25.10.0.1 this morning and it is still broken in that version. Looking at the release dates I think it’s the next maintenance release in 25.10.x that was being referred to.

Thanks for logging the bug and spotting my post to cross reference it here.

*Edited to corrected my typo due to not wearing my glasses ; ) Thanks

25.10.1 is not yet released. You probably tested 25.10.0.1 - different versions.

1 Like

And if I’d worn my glasses it would of helped me spot that error. Thanks.
edited my reply.

1 Like

I have confirmation that this was a very intentional change, linking to a JIRA ticket that I can’t access. NAS-134700 / 25.10 / Allow only one disk to be selected for Spare Vdevs when creating/editing pools by RehanY147 · Pull Request #11786 · truenas/webui · GitHub

Still doesn’t provide any reason, whatsoever, why this was even implemented in the first place, nor why this change wasn’t documented anywhere.

@Cyberpower678 - Weird.

The Pull Request even mentions that after 1 Hot Spare has been selected, no selection for another is allowed as the new expected behavior.

You are right, that appears to be an intentional change, without a reason given. (Though the “reason” could be in the hidden Jira ticket…)

When I administered SAN storage, I tended to have several Hot Spares allocated, (of each size, if the array had different sized disks). Even to the point of spreading the spares to different disk trays. Thus, I seriously wonder what was up when that Pull Request went through approvals and all.

Lets just say that doing something by mistake can still look very intentional. To shed a little more light on the situation, it seems like automated testing did catch an error with adding multiple hot spares early in the development process, but the fix misinterpreted the problem and made the GUI clarify a restriction instead of restoring the ability to add multiple.

In any case, it’s fixed now and will be included in 25.10.1.

4 Likes

Definitely been there before, when it comes to fixing problems. Thanks for getting this fixed. Now I won’t have to roll back to the previous release just to add spares. :stuck_out_tongue:

Well, the bug I opened is now closed, the Pull requests are integrated into the following versions:

  • 25.10.1
  • 25.10.2
  • 26.04

Not sure why 25.10.2 was included, but it is possible that their was a branch / fork, which required a separate Pull request.

This is a reminder to all. While the forums are a great place to discuss things, including verification that something is broke for more than 1 person, if a bug is not reported, it is not worked.

1 Like