25.04 Wizard Adds Wrong Physical Devices to new VDEV

When i had a new mirror to a pool.

I select SSD…


but it add the identically sized HDDS instead

selecting the same size hdd also does the sam,e, as it should (i.e. its not that its swapped identification)

manually adding the disks like this works, funny bug! it really confused me when making my disks id script… couldn’t figure out why it insisted my nvme pool had hdd in it :slight_smile:

1 Like

Super weird, I just reproduced this. Test pool used the HDDs instead of the selected SSDs. Will do some digging.


1 Like
  findSuitableDisks(category: PoolManagerTopologyCategory): DetailsDisk[] {
    const categoryDiskSize = Number(category.diskSize);
    if (category.treatDiskSizeAsMinimum) {
      const matchingDisks: DetailsDisk[] = [];
      [DiskType.Hdd, DiskType.Ssd].forEach((type) => {
        const disksByType = this.diskMap[type];
        for (const diskSize of Object.keys(disksByType)) {
          if (categoryDiskSize <= Number(diskSize)) {
            matchingDisks.push(...disksByType[diskSize]);
          }
        }
      });
      return matchingDisks;
    }

    return [...this.diskMap.HDD[categoryDiskSize] || [], ...this.diskMap.SSD[categoryDiskSize] || []];
  }

findSuitableDisks() just doesn’t seem to consider disk type at all.
In fact, it looks like it prioritizes HDD if there are both types of the same size.

return [...this.diskMap.HDD[categoryDiskSize] || [], ...this.diskMap.SSD[categoryDiskSize] || []];

No idea if this is intentional or not, I assume it isn’t. I’ve got a fix working in my development environment to only return disks of a specified type:

I will raise a ticket and see what iX say.

2 Likes

NAS-135875 raised. Assuming iX are okay with the fix I suggested I’ll put a PR in, though they may have another preferred approach

1 Like

thanks! marked as solution seems like a reasonable code change you requested as this could seriously paint some customers into a corner if the add is permanent for a special vdev?

i wonder if this was a regression or has always been like this!

It is always possible to replace a drive, in any kind of vdev, so no-one would ever end up locked with an unwanted configuration.

to make sure i understand - so remove an HDD from the mirror and then add the SSD to the mirror? Will this redistribute data etc?

cool!

In the UI, you should just have the option to just click and replace:

So while it’s an annoying bug, it’s workable, and you only run into it if you have two disks (mixed types of SSD/HDD) of the same size.

On a related note I’ve raised a PR to fix this for 25.10, so hopefully that gets merged in.

1 Like

“Replace” does not redistribute anything: Data is copied and then the drive is removed (or data is reconstructed from remaining drives in the vdev if you removed the drive first).