Skip to content
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

Feature: zpool status to output full path to VDevs #6792

Closed
lukebigum opened this issue Oct 27, 2017 · 3 comments
Closed

Feature: zpool status to output full path to VDevs #6792

lukebigum opened this issue Oct 27, 2017 · 3 comments

Comments

@lukebigum
Copy link

lukebigum commented Oct 27, 2017

Distribution Name | CentOS
Distribution Version | 6
Linux Kernel | 2.6.32
Architecture | x86_64
ZFS Version | 0.7.1-1
SPL Version | 0.7.1-1

Describe the problem you're observing

This is more feature request than bug. The problem I have is the zpool command doesn't have a way to output the full path to it's VDevs. Under normal use you'd never need this, however it would be very useful if you are trying to do zpool management from any sort of automation or configuration management tool.

Describe how to reproduce the problem

Consider the creation of a zpool like so with any arbitrary device as a vdev, then checking the status:

$ zpool create zpool1 /dev/vg_os/lv_zfs
$ zpool status zpool1
...
	NAME        STATE     READ WRITE CKSUM
	zpool1      ONLINE       0     0     0
	  lv_zfs    ONLINE       0     0     0

The output of "zpool status" shows the vdev name as "lv_zfs". A human being can figure out that this is actually /dev/vg_os/lv_zfs, no problem there, and I acknowledge that with ZFS metadata there generally shouldn't be a need to display the full path. However, configuration management tools like Puppet struggle with relative paths. If Puppet is told to go create 'zpool1' with a single vdev called '/dev/vg_os/lv_zfs', it will think it has failed (or has more work to do) because "lv_zfs" != "/dev/vg_os/lv_zfs".

You can work around the problem by making the tools and scripts smarter by searching through paths in /dev and looking for 'lv_zfs'. However that doesn't solve the actual problem because I could legitimately have device nodes called /dev/sda, /dev/vg_os/sda, and /dev/foo/sda, and then the problem becomes a lot harder to solve.

It's an edge case, but if there was some option to 'zpool status' that translates the VDev to a full device path, this would make it a lot easier to integrate into scripts and tools that reference full device paths.

@loli10K
Copy link
Contributor

loli10K commented Oct 27, 2017

he problem I have is the zpool command doesn't have a way to output the full path to it's VDevs.

Doesn't zpool status -P already do this?

[root@zfsonlinux ~]# lvcreate centos -n zol1 -L1G
  Logical volume "zol1" created.
[root@zfsonlinux ~]# zpool create testpool /dev/mapper/centos-zol1
[root@zfsonlinux ~]# zpool status
  pool: testpool
 state: ONLINE
  scan: none requested
config:

	NAME           STATE     READ WRITE CKSUM
	testpool       ONLINE       0     0     0
	  centos-zol1  ONLINE       0     0     0

errors: No known data errors
[root@zfsonlinux ~]# zpool status -P
  pool: testpool
 state: ONLINE
  scan: none requested
config:

	NAME                       STATE     READ WRITE CKSUM
	testpool                   ONLINE       0     0     0
	  /dev/mapper/centos-zol1  ONLINE       0     0     0

errors: No known data errors
[root@zfsonlinux ~]# 

@lukebigum
Copy link
Author

It does, thank you. I'm a bit embarrassed that that option escaped our notice!

@behlendorf
Copy link
Contributor

@lukebigum it looks like it escaped your notice because the full description was accidentally dropped from the zpool status section of the man page. We'll need to fix that.

behlendorf added a commit that referenced this issue Oct 27, 2017
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.
    
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6792 
Closes #6794
scotws pushed a commit to scotws/zfs that referenced this issue Oct 28, 2017
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.
    
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792 
Closes openzfs#6794
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Nov 4, 2017
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792
Closes openzfs#6794
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Nov 6, 2017
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792
Closes openzfs#6794
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Nov 21, 2017
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.
    
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792 
Closes openzfs#6794
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Jan 29, 2018
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792
Closes openzfs#6794
Nasf-Fan pushed a commit to Nasf-Fan/zfs that referenced this issue Feb 13, 2018
The 'zpool status' command supports the -P option for printing full
path names.  It does not support the -p parsable option for printing
exact values.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#6792
Closes openzfs#6794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants