5 Replies Latest reply: May 2, 2013 8:38 AM by sacrom RSS

    raidz rootzpool on a Solaris 11.1 zone

    sacrom
      Hello all,

      I've been searching for this and I've not been able to find a solution. So I thought that may be a guru in here may help me.

      I've created a zone on the internal disks of a Solaris 11.1, using the rootzpool to create the zpool for me:

      +# zonecfg -z online01 info+
      zonename: online01
      zonepath: /zonas/online01
      brand: solaris
      +...+
      rootzpool:
      storage: dev:dsk/c0t5000C5001D684DCBd0s3
      storage: dev:dsk/c0t5000C5001D68670Bd0s3
      +...+

      Now I'm in the need to move the internal disk mirror to a raidz zpool on 5 shared disks. My idea was to create the raidz online01_rpool with the same contents as the current mirrored one (zfs send | zfs receive). And hope the zone will import that pool at boot. But the wrong storage devices and the impossibility to specify a raidz make me somehow "nervous".

      Is possible to use a raidz zpool on rootzpool? Did somebody tried it? How?

      If this is not possible, I guess I can create the raidz pool and mount it at */zonas/online01* removing the rootzpool, is this right?

      Best regards and thanks,
      Marcos
        • 1. Re: raidz rootzpool on a Solaris 11.1 zone
          Bjoern Rost
          what exactly is your main goal here? Move the zone to a different zpool or migrate the boot zfs (rpool) to raidz? I don't know if the latter is supported, I think zfs boot only supports single and mirrored devices but not raid-z for the boot pool.

          Moving the zone can be done in (at least) two different ways. You could use "zoneadm clone" to create a clone of the old zone (and after verifying that everything works with the clone, drop the old one). And solaris 11 even has a "zoneadm move" command specifically to move the zonepath.
          Your suggestion (zfs send/receive, then switch mountpoints) is also very likely to work but may be a bit confusing with mounts points all switched up.

          Let us know how you did it

          cheers
          bjoern
          • 2. Re: raidz rootzpool on a Solaris 11.1 zone
            sacrom
            Thanks for the quick reply!
            Bjoern Rost wrote:
            what exactly is your main goal here? Move the zone to a different zpool or migrate the boot zfs (rpool) to raidz? I don't know if the latter is supported, I think zfs boot only supports single and mirrored devices but not raid-z for the boot pool.
            Well I wanted to change the zone rootzpool from a local disk mirrored configuration to a raidz on shared disks (SAN), there is no initial need on a different zpool.
            Moving the zone can be done in (at least) two different ways. You could use "zoneadm clone" to create a clone of the old zone (and after verifying that everything works with the clone, drop the old one). And solaris 11 even has a "zoneadm move" command specifically to move the zonepath.
            Your suggestion (zfs send/receive, then switch mountpoints) is also very likely to work but may be a bit confusing with mounts points all switched up.
            The "zoneadm move" may be the easiest solution. I can create a raidz zpool mount it on /zonas/online01_new and move the zone to that new mountpoint. But there is a note on the documentation that I don't understand ( [http://docs.oracle.com/cd/E26502_01/html/E29024/gbwym.html#scrolltoc] ):

            Note - You cannot move a zone on shared storage with a rootzpool resource to a different location on the system. A rename of the zonepath is supported.

            I'm not sure it'll work as the zoneadm move implies the removal of the rootzpool "resource"...

            Thanks and best regards!
            Marcos
            • 3. Re: raidz rootzpool on a Solaris 11.1 zone
              Mgerdts-Oracle
              Hi Marcos,

              That's a great question that you asked - one that I've been meaning to blog about for a while. Rather than answering your question here, I've written that long overdue blog entry.

              https://blogs.oracle.com/zoneszone/entry/cold_storage_migration_with_zones

              Mike
              • 4. Re: raidz rootzpool on a Solaris 11.1 zone
                sacrom
                Thank you Mike!

                That answer exceed all my expectations. You made all my work!

                I´ll be doing this in two days, I´ll let you know how it went.

                Best regards and thank you very much!
                Marcos
                • 5. Re: raidz rootzpool on a Solaris 11.1 zone
                  sacrom
                  Hi All,

                  At the end I followed Mike procedure, and it worked flawlessly. Here you've my exact commands:
                  ~# zpool list
                  NAME             SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
                  online03_rpool  40.2G  16.7G  23.6G  41%  1.00x  ONLINE  -
                  rpool           55.5G  25.8G  29.7G  46%  1.00x  ONLINE  -
                  
                  ~# zoneadm list -iv
                    ID NAME             STATUS     PATH                           BRAND    IP
                     0 global           running    /                              solaris  shared
                     - online03         installed  /zonas/online03                solaris  excl
                  
                  ~# zpool create -m none hdspool raidz c0t60060E80042C470000002C4700001040d0 c0t60060E80042C470000002C4700001042d0 c0t60060E80042C470000002C4700001044d0 c0t60060E80042C470000002C4700001046d0 c0t60060E80042C470000002C4700001048d0
                  
                  ~# zpool list
                  NAME             SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
                  hdspool          100G   212K   100G   0%  1.00x  ONLINE  -
                  online03_rpool  40.2G  16.7G  23.6G  41%  1.00x  ONLINE  -
                  rpool           55.5G  25.8G  29.7G  46%  1.00x  ONLINE  -
                  
                  ~# zpool status hdspool
                    pool: hdspool
                   state: ONLINE
                    scan: none requested
                  config:
                  
                          NAME                                       STATE     READ WRITE CKSUM
                          hdspool                                    ONLINE       0     0     0
                            raidz1-0                                 ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001040d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001042d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001044d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001046d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001048d0  ONLINE       0     0     0
                  
                  
                  ~# zfs snapshot -r online03_rpool@migrate
                  
                  ~# zfs send -R online03_rpool@migrate | zfs recv -u -F hdspool
                  
                  ~# zonecfg -z online03 info > o3_info.txt
                  
                  ~# zonecfg -z online03 export -f o3_export.txt
                  
                  ~# zoneadm -z online03 detach
                  Exported zone zpool: online03_rpool
                  
                  ~# zpool export hdspool
                  
                  ~# zonecfg -z online03
                  zonecfg:online03> info rootzpool
                  rootzpool:
                          storage: dev:dsk/c0t5000C5001D684DCBd0s4
                          storage: dev:dsk/c0t5000C5001D68670Bd0s4
                  zonecfg:online03> remove rootzpool
                  zonecfg:online03> add rootzpool
                  zonecfg:online03:rootzpool> add storage dev:dsk/c0t60060E80042C470000002C4700001040d0
                  zonecfg:online03:rootzpool> add storage dev:dsk/c0t60060E80042C470000002C4700001042d0
                  zonecfg:online03:rootzpool> add storage dev:dsk/c0t60060E80042C470000002C4700001044d0
                  zonecfg:online03:rootzpool> add storage dev:dsk/c0t60060E80042C470000002C4700001046d0
                  zonecfg:online03:rootzpool> add storage dev:dsk/c0t60060E80042C470000002C4700001048d0
                  zonecfg:online03:rootzpool> end
                  zonecfg:online03> verify
                  zonecfg:online03> commit
                  zonecfg:online03> exit
                  
                  ~# zoneadm -z online03 attach
                  Imported zone zpool: online03_rpool
                  Progress being logged to /var/log/zones/zoneadm.20130502T113147Z.online03.attach
                      Installing: Using existing zone boot environment
                        Zone BE root dataset: online03_rpool/rpool/ROOT/solaris
                                       Cache: Using /var/pkg/publisher.
                    Updating non-global zone: Linking to image /.
                  Processing linked: 1/1 done
                    Updating non-global zone: Auditing packages.
                  No updates necessary for this image.
                  
                    Updating non-global zone: Zone updated.
                                      Result: Attach Succeeded.
                  Log saved in non-global zone as /zonas/online03/root/var/log/zones/zoneadm.20130502T113147Z.online03.attach
                  
                  ~# zpool list
                  NAME             SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
                  online03_rpool   100G  21.1G  78.9G  21%  1.00x  ONLINE  -
                  rpool           55.5G  25.8G  29.7G  46%  1.00x  ONLINE  -
                  
                  ~# zpool status online03_rpool
                    pool: online03_rpool
                   state: ONLINE
                    scan: none requested
                  config:
                  
                          NAME                                       STATE     READ WRITE CKSUM
                          online03_rpool                             ONLINE       0     0     0
                            raidz1-0                                 ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001040d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001042d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001044d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001046d0  ONLINE       0     0     0
                              c0t60060E80042C470000002C4700001048d0  ONLINE       0     0     0
                  
                  errors: No known data errors
                  
                  ~# zoneadm -z online03 boot
                  
                  ~# zlogin -C online03
                  Thanks for your Help!
                  Marcos