Showing posts with label zpool. Show all posts
Showing posts with label zpool. Show all posts

Thursday, July 11, 2013

Importing a zpool into a ldom

Importing a zpool into a ldom

Identify the disk to create the zpool on source server.

lrwxrwxrwx   1 root     root          67 Aug 22 12:47 /dev/rdsk/c6t6072482462EDF0001432HH90000203Bd0s2 -> 
../../devices/scsi_vhci/ssd@g60760e80164ef90000014ef90000203b:c,raw


Create the zpool and zfs

(MySource:/)# zpool create MyZpool /dev/rdsk/c6t6072482462EDF0001432HH90000203Bd0
(MySource:/)#

(MySource:/)# df -h /MyFilesystem
Filesystem             size   used  avail capacity  Mounted on
MyZpool/MyFilesystem
                        98G    62G    36G    63%    /MyFilesystem
(MySource:/)#


(MySource:/)# zpool get all MyZpool
NAME          PROPERTY       VALUE               SOURCE
MyZpool  size           99.5G               -
MyZpool  capacity       61%                 -
MyZpool  altroot        -                   default
MyZpool  health         ONLINE              -
MyZpool  guid           917911360396256368  -
MyZpool  version        32                  default
MyZpool  bootfs         -                   default
MyZpool  delegation     on                  default
MyZpool  autoreplace    off                 default
MyZpool  cachefile      -                   default
MyZpool  failmode       wait                default
MyZpool  listsnapshots  on                  default
MyZpool  autoexpand     off                 default
MyZpool  free           38.0G               -
MyZpool  allocated      61.5G               -
MyZpool  readonly       off                 -
(MySource:/)#


Export the zpool

(MySource:/)# zpool export MyZpool
(MySource:/)#


/// On the physical host of the ldom's map this disk and then map the disks to the virtual disk services

Physical host - MyTargetPhy

lrwxrwxrwx   1 root     root          67 Aug 22 16:39 /dev/rdsk/c12t6072482462EDF0001432HH90000203Bd0s2 -> 
../../devices/scsi_vhci/ssd@g60760e80164ef90000014ef90000203b:c,raw


(MyTargetPhy:/root)# zpool import
  pool: MyZpool
    id: 917911360396256368
 state: UNAVAIL
status: The pool is formatted using an incompatible version.
action: The pool cannot be imported.  Access the pool on a system running newer
        software, or recreate the pool from backup.
   see: http://www.sun.com/msg/ZFS-8000-A5
config:

        MyZpool                              UNAVAIL  newer version
          c12t6072482462EDF0001432HH90000203Bd0  ONLINE




status: The pool is formatted using an incompatible version. 

=> the zpool was created in a machine with a higher version and the target physical host has a lower version of OS that is unable to import it. However the ldom is in the same level as of the source and the zpool can be imported into the ldom



Source:

(MySource:/)# cat /etc/release
                   Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013
(MySource:/)#


Destination - Physical 

(MyTargetPhy:/root)# cat /etc/release
                   Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
  Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
                            Assembled 23 August 2011
(MyTargetPhy:/root)#


Destination LDOM

(MyLdom:/root)# cat /etc/release
                   Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013
(MyLdom:/root)#




Map the disk to the ldom using the virtual disk service


(MyTargetPhy:/root)# ldm add-vdsdev /dev/rdsk/c12t6072482462EDF0001432HH90000203Bd0s2 ZP-MyLdom-temp@primary-vds0
(MyTargetPhy:/root)#
(MyTargetPhy:/root)# ldm add-vdisk ZP-MyLdom-temp ZP-MyLdom-temp@primary-vds0 MyLdom
(MyTargetPhy:/root)#

(MyTargetPhy:/root)# ldm list -l primary | grep MyLdom
                     MyLdom-boot                                    /dev/rdsk/c12t6072482462EDF0001432HH900004530d0s2
                     ZP-MyLdom-temp                                 /dev/rdsk/c12t6072482462EDF0001432HH90000203Bd0s2
(MyTargetPhy:/root)#


Check if the zpool is visible in the ldom


(MyLdom:/root)# zpool import
  pool: MyZpool
    id: 917911360396256368
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

        MyZpool  ONLINE
          c0d5      ONLINE
(MyLdom:/root)#


Import the zpool

(MyLdom:/root)# zpool import MyZpool


(MyLdom:/root)# df -h /MyFilesystem
Filesystem             size   used  avail capacity  Mounted on
MyZpool/MyFilesystem
                        98G    62G    36G    63%    /MyFilesystem
(MyLdom:/root)#



Thursday, August 9, 2012

Mirroring a zpool and installing bootblk



Mirroring a zpool and installing bootblk in the new mirror


Destroy one pool which is not in usem ie, rpool and add the disk as mirror of rpool-ABE


SolarisHost:/root# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
sol10-update8                   yes      no     no        yes    -
sol10-update8-new               yes      yes    yes       no     -
SolarisHost:/root#


SolarisHost:/root# zpool status | grep rpool
  pool: rpool
        rpool       ONLINE       0     0     0
  pool: rpool-ABE
        rpool-ABE   ONLINE       0     0     0
SolarisHost:/root#


SolarisHost:/root# zpool status rpool
  pool: rpool
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c1t1d0s0  ONLINE       0     0     0

errors: No known data errors

SolarisHost:/root# zpool status rpool-ABE
  pool: rpool-ABE
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rpool-ABE   ONLINE       0     0     0
          c1t0d0s0  ONLINE       0     0     0

errors: No known data errors


Destroy the unused zpool

SolarisHost:/root#
SolarisHost:/root# zpool destroy rpool
SolarisHost:/root#

Mirror the zpool

SolarisHost:/root# zpool attach rpool-ABE c1t0d0s0 c1t1d0s0
Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
SolarisHost:/root#


SolarisHost:/root# zpool status rpool-ABE
  pool: rpool-ABE
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 0h0m, 1.37% done, 0h28m to go

config:

        NAME          STATE     READ WRITE CKSUM
        rpool-ABE     ONLINE       0     0     0
          mirror      ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0  343M resilvered

errors: No known data errors
SolarisHost:/root#


Install bootblk on the newly added mirror (SPARC Machine):

SolarisHost:/usr/platform/SUNW,T5240/lib/fs/zfs# installboot -F zfs bootblk /dev/rdsk/c1t1d0s0


Check the mirror status:

SolarisHost:/root# zpool status rpool-ABE
  pool: rpool-ABE
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 0h2m, 9.24% done, 0h27m to go
config:

        NAME          STATE     READ WRITE CKSUM
        rpool-ABE     ONLINE       0     0     0
          mirror      ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0  2.28G resilvered

errors: No known data errors
SolarisHost:/root#


Mirrored:

SolarisHost:/root#
SolarisHost:/root# zpool status rpool-ABE
  pool: rpool-ABE
 state: ONLINE
 scrub: resilver completed after 1h19m with 0 errors on Fri Oct 29 10:59:51 2010
config:

        NAME          STATE     READ WRITE CKSUM
        rpool-ABE     ONLINE       0     0     0
          mirror      ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0  24.5G resilvered

errors: No known data errors
SolarisHost:/root#

Tuesday, July 31, 2012

Replacing a disk in zpool

Replacing a disk in zpool using a new disk.



(PhyHost1:/)# zpool status zone1-pool
  pool: zone1-pool
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scrub: resilver completed after 0h4m with 0 errors on Mon Apr 16 21:02:41 2012
config:

        NAME                        STATE     READ WRITE CKSUM
        zone1-pool                  ONLINE       0     0     0
          c2t60050974071C599Cd84s2  ONLINE       0     0     0  4.80G resilvered

errors: No known data errors
(PhyHost1:/)#


New disk

(PhyHost1:/)# ls -l /dev/rdsk/c2t60050974071C599Cd165s2
lrwxrwxrwx   1 root     root          76 Apr 18 16:11 /dev/rdsk/c2t60050974071C599Cd165s2 -> ../../devices/pci@fc,600000/SUNW,qlc@1/fp@0,0/ssd@w50000974081b599c,a5:c,raw
(PhyHost1:/)# /etc/vx/diag.d/vxdmpinq /dev/rdsk/c2t60050974071C599Cd165s2

Inquiry for /dev/rdsk/c2t60050974071C599Cd165s2, evpd 0x0, page code 0x0
        Vendor id                        : EMC
        Product id                       : SYMMETRIX
        Revision                         : 5874
        Serial Number                    : 50999000@
(PhyHost1:/)#
(PhyHost1:/)# zpool status | grep c2t60050974071C599Cd165
(PhyHost1:/)#
(PhyHost1:/)# vxdisk -o alldgs -e list | grep c2t60050974071C599Cd165
(PhyHost1:/)# vxdisk -o alldgs -e list | grep c2t60050974071C599Cd165s2
(PhyHost1:/)# vxdisk -o alldgs -e list | grep c5t50000974081B59A0d165s2
(PhyHost1:/)#


(PhyHost1:/)# zpool replace zone1-pool c2t60050974071C599Cd84s2 c2t60050974071C599Cd165s2

(PhyHost1:/)#




(PhyHost1:/)# zpool status zone1-pool
  pool: zone1-pool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 0h2m, 57.92% done, 0h1m to go
config:

        NAME                           STATE     READ WRITE CKSUM
        zone1-pool                     ONLINE       0     0     0
          replacing-0                  ONLINE       0     0     0
            c2t60050974071C599Cd84s2   ONLINE       0     0     0
            c2t60050974071C599Cd165s2  ONLINE       0     0     0  2.78G resilvered

errors: No known data errors
(PhyHost1:/)#
(PhyHost1:/)# zpool status zone1-pool
  pool: zone1-pool
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scrub: resilver completed after 0h4m with 0 errors on Wed Apr 18 16:46:19 2012
config:

        NAME                         STATE     READ WRITE CKSUM
        zone1-pool                   ONLINE       0     0     0
          c2t60050974071C599Cd165s2  ONLINE       0     0     0  4.80G resilvered

errors: No known data errors
(PhyHost1:/)#

The old disk will be automatically removed from the zpool

(PhyHost1:/)#
(PhyHost1:/)# zpool status zone1-pool
  pool: zone1-pool
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scrub: resilver completed after 0h4m with 0 errors on Wed Apr 18 16:46:19 2012
config:

        NAME                         STATE     READ WRITE CKSUM
        zone1-pool                   ONLINE       0     0     0
          c2t60050974071C599Cd165s2  ONLINE       0     0     0  4.80G resilvered

errors: No known data errors
(PhyHost1:/)#
(PhyHost1:/)#


Old disk can be released from system and recuperated.