[zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread adele....@oracle.com

Hi all,

My cu has following question.


Assume I have allocated a LUN from external storage to two hosts ( by 
mistake ). I create a zpool with this LUN on host1 with no errors. On 
host2 when I try to create a zpool by
using the same disk ( which is allocated to host2 as well ), zpool 
create - comes back with an error saying   /dev/dsk/cXtXdX is part of 
exported or potentially active ZFS pool test.
Is there a way for me to check what zpool disk belongs to from 'host2'. 
Do the disks in a zpool have a private region that I can read to get a 
zpool name or id?



Steps required to reproduce the problem

Disk doubly allocated to host1, host2
host1 sees disk as disk100
host2 sees disk as disk101
host1# zpool create host1_pool disk1 disk2 disk100
returns success ( as expected )
host2# zpool create host2_pool disk1 disk2 disk101
invalid dev specification
use '-f' to overrite the following errors:
/dev/dsk/disk101 is part of exported or potentially active ZFS pool 
test. Please see zpool


zpool did catch that the disk is part of an active pool, but since it's 
not on the same host I am not getting the name of the pool to which 
disk101 is allocated. It's possible we might go ahead and use '-f' 
option to create the zpool and start using this filesystem. By doing 
this we're potentially destroying filesystems on host1, host2 which 
could lead to severe downtime.


Any way to get the pool name to which the disk101 is assigned ( with a 
different name on a different host )? This would aid us tremendously in 
avoiding a potential issue. This has happened with Solaris 9, UFS once 
before taking out two Solaris machines.


What happens if diskis assigned to a AIX box and is setup as part of a 
Volume manager on AIX and we try to create 'zpool' on Solaris host. Will 
ZFS catch this, by saying something wrong with the disk?


Regards,
Adele

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread Jim Klimov

Take a look at ZDB (the ZFS Debugger). Probably the zdb -l
(label dump) option would suffice for your task, i.e.:

# zdb -l /dev/dsk/c4t1d0s0 | egrep 'host|uid|name|devid|path'
name: 'rpool'
pool_guid: 12076177533503245216
hostid: 13583512
hostname: 'bofh-sol'
top_guid: 1792815639752064612
guid: 1792815639752064612
guid: 1792815639752064612
path: '/dev/dsk/c4t1d0s0'
devid: 'id1,sd@SATA_ST3808110AS_5LR557KB/a'
phys_path: '/pci@0,0/pci8086,2847@1c,4/pci1043,81e4@0/disk@1,0:a'

(repeats for all 4 labels, values should match for a healthy pool)

2012-01-12 18:51, adele@oracle.com wrote:

Hi all,

My cu has following question.


Assume I have allocated a LUN from external storage to two hosts ( by
mistake ). I create a zpool with this LUN on host1 with no errors. On
host2 when I try to create a zpool by
using the same disk ( which is allocated to host2 as well ), zpool
create - comes back with an error saying  /dev/dsk/cXtXdX is part of
exported or potentially active ZFS pool test.
Is there a way for me to check what zpool disk belongs to from 'host2'.
Do the disks in a zpool have a private region that I can read to get a
zpool name or id?


Steps required to reproduce the problem

Disk doubly allocated to host1, host2
host1 sees disk as disk100
host2 sees disk as disk101
host1# zpool create host1_pool disk1 disk2 disk100
returns success ( as expected )
host2# zpool create host2_pool disk1 disk2 disk101
invalid dev specification
use '-f' to overrite the following errors:
/dev/dsk/disk101 is part of exported or potentially active ZFS pool
test. Please see zpool

zpool did catch that the disk is part of an active pool, but since it's
not on the same host I am not getting the name of the pool to which
disk101 is allocated. It's possible we might go ahead and use '-f'
option to create the zpool and start using this filesystem. By doing
this we're potentially destroying filesystems on host1, host2 which
could lead to severe downtime.

Any way to get the pool name to which the disk101 is assigned ( with a
different name on a different host )? This would aid us tremendously in
avoiding a potential issue. This has happened with Solaris 9, UFS once
before taking out two Solaris machines.

What happens if diskis assigned to a AIX box and is setup as part of a
Volume manager on AIX and we try to create 'zpool' on Solaris host. Will
ZFS catch this, by saying something wrong with the disk?

Regards,
Adele

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

HTH,
//Jim Klimov
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread Jim Klimov

Followup: namely, the 'hostname' field should report the
host which has last (or currently) imported the pool,
and the 'name' field is the pool name as of last import
(can be changed by like zpool import pool1 testpool2).

HTH,
//Jim Klimov
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread Hung-Sheng Tsao (laoTsao)
if the disks are assigned by two hosts
may be just do zpool import should see the zpool in other hosts? not sure

as for AIX, control hdd, zpool will need partition that solaris could understand
i do not know what AIX used for partition should not be the same for solaris



Sent from my iPad

On Jan 12, 2012, at 9:51, adele@oracle.com adele@oracle.com wrote:

 Hi all,
 
 My cu has following question.
 
 
 Assume I have allocated a LUN from external storage to two hosts ( by mistake 
 ). I create a zpool with this LUN on host1 with no errors. On host2 when I 
 try to create a zpool by
 using the same disk ( which is allocated to host2 as well ), zpool create - 
 comes back with an error saying   /dev/dsk/cXtXdX is part of exported or 
 potentially active ZFS pool test.
 Is there a way for me to check what zpool disk belongs to from 'host2'. Do 
 the disks in a zpool have a private region that I can read to get a zpool 
 name or id?
 
 
 Steps required to reproduce the problem
 
 Disk doubly allocated to host1, host2
 host1 sees disk as disk100
 host2 sees disk as disk101
 host1# zpool create host1_pool disk1 disk2 disk100
 returns success ( as expected )
 host2# zpool create host2_pool disk1 disk2 disk101
 invalid dev specification
 use '-f' to overrite the following errors:
 /dev/dsk/disk101 is part of exported or potentially active ZFS pool test. 
 Please see zpool
 
 zpool did catch that the disk is part of an active pool, but since it's not 
 on the same host I am not getting the name of the pool to which disk101 is 
 allocated. It's possible we might go ahead and use '-f' option to create the 
 zpool and start using this filesystem. By doing this we're potentially 
 destroying filesystems on host1, host2 which could lead to severe downtime.
 
 Any way to get the pool name to which the disk101 is assigned ( with a 
 different name on a different host )? This would aid us tremendously in 
 avoiding a potential issue. This has happened with Solaris 9, UFS once before 
 taking out two Solaris machines.
 
 What happens if diskis assigned to a AIX box and is setup as part of a Volume 
 manager on AIX and we try to create 'zpool' on Solaris host. Will ZFS catch 
 this, by saying something wrong with the disk?
 
 Regards,
 Adele
 
 ___
 zfs-discuss mailing list
 zfs-discuss@opensolaris.org
 http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread adele....@oracle.com

Jim and LaoTsao,

Thanks a  lot for your quick response.

zdb might be good enough to get zpoll name or id from any disk in 
zool. CU will try it this afternoon.


As of second situation - one host is AIX and the second disk is Solaris, 
CU wonders if zdb will show anything.


I will also post questions to Oracle internal zfs alias to see if they 
have any input.


Best regards,
Adele


On 1/12/2012 9:58 AM, Jim Klimov wrote:

Take a look at ZDB (the ZFS Debugger). Probably the zdb -l
(label dump) option would suffice for your task, i.e.:

# zdb -l /dev/dsk/c4t1d0s0 | egrep 'host|uid|name|devid|path'
name: 'rpool'
pool_guid: 12076177533503245216
hostid: 13583512
hostname: 'bofh-sol'
top_guid: 1792815639752064612
guid: 1792815639752064612
guid: 1792815639752064612
path: '/dev/dsk/c4t1d0s0'
devid: 'id1,sd@SATA_ST3808110AS_5LR557KB/a'
phys_path: '/pci@0,0/pci8086,2847@1c,4/pci1043,81e4@0/disk@1,0:a'

(repeats for all 4 labels, values should match for a healthy pool)

2012-01-12 18:51, adele@oracle.com wrote:

Hi all,

My cu has following question.


Assume I have allocated a LUN from external storage to two hosts ( by
mistake ). I create a zpool with this LUN on host1 with no errors. On
host2 when I try to create a zpool by
using the same disk ( which is allocated to host2 as well ), zpool
create - comes back with an error saying  /dev/dsk/cXtXdX is part of
exported or potentially active ZFS pool test.
Is there a way for me to check what zpool disk belongs to from 'host2'.
Do the disks in a zpool have a private region that I can read to get a
zpool name or id?


Steps required to reproduce the problem

Disk doubly allocated to host1, host2
host1 sees disk as disk100
host2 sees disk as disk101
host1# zpool create host1_pool disk1 disk2 disk100
returns success ( as expected )
host2# zpool create host2_pool disk1 disk2 disk101
invalid dev specification
use '-f' to overrite the following errors:
/dev/dsk/disk101 is part of exported or potentially active ZFS pool
test. Please see zpool

zpool did catch that the disk is part of an active pool, but since it's
not on the same host I am not getting the name of the pool to which
disk101 is allocated. It's possible we might go ahead and use '-f'
option to create the zpool and start using this filesystem. By doing
this we're potentially destroying filesystems on host1, host2 which
could lead to severe downtime.

Any way to get the pool name to which the disk101 is assigned ( with a
different name on a different host )? This would aid us tremendously in
avoiding a potential issue. This has happened with Solaris 9, UFS once
before taking out two Solaris machines.

What happens if diskis assigned to a AIX box and is setup as part of a
Volume manager on AIX and we try to create 'zpool' on Solaris host. Will
ZFS catch this, by saying something wrong with the disk?

Regards,
Adele

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

HTH,
//Jim Klimov

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Do the disks in a zpool have a private region that I can read to get a zpool name or id?

2012-01-12 Thread Jim Klimov

2012-01-12 20:21, adele@oracle.com пишет:

Jim and LaoTsao,

Thanks a lot for your quick response.

zdb might be good enough to get zpoll name or id from any disk in
zool. CU will try it this afternoon.

As of second situation - one host is AIX and the second disk is Solaris,
CU wonders if zdb will show anything.

I will also post questions to Oracle internal zfs alias to see if they
have any input.


What happens if diskis assigned to a AIX box and is setup as part of a
Volume manager on AIX and we try to create 'zpool' on Solaris host. Will
ZFS catch this, by saying something wrong with the disk?


I think you'd be relatively lucky if Solaris and AIX use
compatible disk partitioning schemes - even top-level
ones like GPT/MBR for partitioning and EFI/SMI for further
labelling of slices.

While it is likely that most systems use (and understand)
the same set of partitioning layouts, internals like
slice labelling (if any) are usually OS-centric, and
most large-vendor OSes (unlike opensource OSes or FS
driver projects) don't understand competitiors' labels
and FSes.

ZFS and related Solaris tools (format) do warn you about
disk usages that Solaris understands and tracks, i.e.
that a device (disk, slice) is actively busy or passively
formatted with ZFS, UFS, SVM, swap, etc. Maybe also it
will also report VxFS and pcfs = FAT? That's probably
it. I would be surprised if it found any other FSes,
be it AIX, or NTFS, or ext3/ext4/xfs/reiserfs, or
whatever else out there is popular.

Good luck, and let us know if your practice proves my
generic rant wrong! ;)
//Jim Klimov
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss