Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7208

Use VDev full path names for zpools

    Details

    • Template:
    • Team:
      Platform OS
    • Story Points:
      1
    • Sprint:
      Platform OS Kanban
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      When you create a zpool with disks using a full file system path, the zpool provider is not idempotent because it is not querying the status of zpools in a compatible way. Consider the following code and Puppet run:

      zpool { 'zpool1':
        disk => '/dev/vg_os/lv_zfs',
      }
      

      [root@host ~]# puppet apply test.pp 
      Notice: Compiled catalog for bunyip.yb.lmax in environment production in 0.06 seconds
      Error: zpool disk can't be changed. should be /dev/vg_os/lv_zfs, currently is lv_zfs
      Error: /Stage[main]/Main/Zpool[zpool1]/disk: change from lv_zfs to /dev/vg_os/lv_zfs failed: zpool disk can't be changed. should be /dev/vg_os/lv_zfs, currently is lv_zfs
      Notice: Finished catalog run in 0.76 seconds
      

      The problem comes from the provider using the "zpool status POOLNAME" command in order to find out what VDevs are in the pool. That command will always return a relative path, so if the zpool is created with a fully qualified path the resource will always fail on a subsequent run.

      The fix is to run "zpool status -P POOLNAME" which will return the full path, and I've got a PR for that coming.

      The problem is if people have been doing this:

      zpool { 'zpool1':
        disk => 'sda1',
      }
      

      Which works right now, but after the PR will cause the same problem. I would argue that using relative paths to disk is not the best idea anyway (and the ZFS community has somewhat decided that using WWNs under /dev/disk/by-id/ is the way forward). However it's still a breaking change.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                lukebigum Luke Bigum
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: