ZFS-SA: Creating Pools from the Command Line Interface

Ever wondered if you could make pools from the Command Line?  Ever wanted to automate deployments completely but couldn't figure out the pool creation part?  This entry is for you.

Pools can be created from the CLI in a very similar manner to how they are created via the BUI.  If you wish to create an advanced layout scheme this is also possible via the CLI providing that you are aware of what the disk enclosure order is. FYI, the order is top to bottom (1 through x).  It is presented in the BUI under the Maintenance section (Maintenance Hardware with the CLI).  

Note: The enclosures, called chassis-xxx, list much easier to view in the BUI. As an added bonus, you can change the name of the tray or alias it. As you can see below, the enclosures are referred to as ID 1 through x, where ID 0 is the controller and contains the L2ARC SSD’s for the secondary read cache. This is the same order seen in the BUI or the CLI from top to bottom and internally referred to as Chassis-000 .. Chassis-0XX. 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

zs3-mgmt01b:configuration storage> config poolb

Verify and allocate devices. Verify that storage is correctly attached and functioning. If devices are missing or malfunctioning, they will not be available for use and cannot be added without reconfiguring the pool. It is recommended that you fix any problems before configuring storage on the appliance. Mixing device types and speeds is strongly discouraged.

Subcommands that are valid in this context:

help [topic]         => Get context-sensitive help. If [topic] is specified, it must be one of "builtins", "commands", "general", "help", "script" or "properties".

show                 => Show information pertinent to the current context

abort                => Abort this task (potentially resulting in a misconfigured system)

done                 => Finish operating on "verify"

get [prop]           => Get value for property [prop]. ("help properties" for valid properties.) If [prop] is not specified, returns values for all properties.

set [prop]           => Set property [prop] to [value]. ("help properties" for valid properties.) For properties taking list values, [value] should be a comma-separated list of

                           values.

zs3-mgmt01b:configuration storage verify> show

        ID     STATUS   ALLOCATION   DATA          LOG           CACHE       RPM  

        --    -------   ----------   -----------   -----------   ----------- -----

         0         ok       custom   0             0             2/2   2.91T      

         1         ok       custom   24/24 87.3T   0             0           7200 

         2         ok       custom   20/20 72.8T   2/2   137G    0           7200 

         3         ok       custom   24/24 87.3T   0             0           7200 

         4         ok       custom   20/20 72.8T   2/2   137G    0           7200 

                                     -----------   -----------   -----------

                                     88    320T    4     273G    2     2.91T

zs3-mgmt01b:configuration storage verify>

zs3-mgmt01b:configuration storage verify> set (press tab)

0        1        2        2-log    3-data   4-data   

0-cache  1-data   2-data   3        4        4-log    

zs3-mgmt01b:configuration storage verify> set 0-cache= (press tab)

0  1  2  

zs3-mgmt01b:configuration storage verify> set 0-cache=2

                       0-cache = 2

zs3-mgmt01b:configuration storage verify> set 1-data= (press tab)

0   10  12  14  6  18  2   21  23  3   5   7   9   

1   11  13  15  17  19  20  22  24  4   6   8   

zs3-mgmt01b:configuration storage verify> set 1-data=12

                        1-data = 12

zs3-mgmt01b:configuration storage verify> set 2-data=10

                        2-data = 10

zs3-mgmt01b:configuration storage verify> set 3-data=12

                        3-data = 12

zs3-mgmt01b:configuration storage verify> set 4-data=10

                        4-data = 10

zs3-mgmt01b:configuration storage verify> set 2-log= (press tab)

0  1  2  

zs3-mgmt01b:configuration storage verify> set 2-log=1

                         2-log = 1

zs3-mgmt01b:configuration storage verify> set 4-log=1

                         4-log = 1

zs3-mgmt01b:configuration storage verify> show

ID     STATUS   ALLOCATION   DATA          LOG           CACHE       RPM  

--    -------   ----------   -----------   -----------   ----------- -----

0         ok       custom   0             0             2/2   2.91T      

1         ok       custom   12/24 87.3T   0             0           7200 

2         ok       custom   10/20 72.8T   1/2   137G    0           7200 

3         ok       custom   12/24 87.3T   0             0           7200 

4         ok       custom   10/20 72.8T   1/2   137G    0           7200 

-----------   -----------   -----------

44    160T    2     137G    2     2.91T

zs3-mgmt01b:configuration storage verify>

zs3-mgmt01b:configuration storage verify> done

Choose Storage Profile. Configure available storage into a pool by defining its underlying redundancy profile. Carefully read the profile descriptions to understand how each balances the inherent trade-offs between availability,performance, and capacity, and select the profile that best fits your workload. If available, NSPF indicates no single point of failure, which affords certain profiles the ability for a pool to survive through loss of a single disk shelf.

Subcommands that are valid in this context:

help [topic]         => Get context-sensitive help. If [topic] is specified, it must be one of "builtins", "commands", "general", "help", "script" or "properties".

show                 => Show information pertinent to the current context

abort                => Abort this task (potentially resulting in a misconfigured system)

done                 => Finish operating on "config"

get [prop]           => Get value for property [prop]. ("help properties" for valid properties.) If [prop] is not specified, returns values for all properties.

set [prop]           => Set property [prop] to [value]. ("help properties" for valid properties.) For properties taking list values, [value] should be a comma-separated list of

                           values.

zs3-mgmt01b:configuration storage config> show

                 PROFILE          CAPCTY NSPF DESCRIPTION

       profile = mirror_nspf      75.2T  yes  Mirrored

                 mirror           75.2T  no   Mirrored

                 mirror3_nspf     50.1T  yes  Triple mirrored

                 mirror3          50.1T  no   Triple mirrored

                 raidz1           107T   no   Single parity, narrow stripes

                 raidz2_nspf      107T   yes  Double parity

                 raidz2           129T   no   Double parity

                 raidz3_nspf_max  100T   yes  Triple parity, wide stripes

                 raidz3_max       140T   no   Triple parity, wide stripes

                 stripe           158T   no   Striped

   log_profile = log_mirror_nspf  68.4G  yes  Mirrored log

                 log_mirror       68.4G  no   Mirrored log

                 log_stripe       137G   no   Striped log

 cache_profile = cache_stripe     2.91T  -    Striped cache

zs3-mgmt01b:configuration storage config>

zs3-mgmt01b:configuration storage config> set log_profile=log_stripe

                   log_profile = log_stripe

zs3-mgmt01b:configuration storage config> show

                 PROFILE          CAPCTY NSPF DESCRIPTION

       profile = mirror_nspf      75.2T  yes  Mirrored

                 mirror           75.2T  no   Mirrored

                 mirror3_nspf     50.1T  yes  Triple mirrored

                 mirror3          50.1T  no   Triple mirrored

                 raidz1           107T   no   Single parity, narrow stripes

                 raidz2_nspf      107T   yes  Double parity

                 raidz2           129T   no   Double parity

                 raidz3_nspf_max  100T   yes  Triple parity, wide stripes

                 raidz3_max       140T   no   Triple parity, wide stripes

                 stripe           158T   no   Striped

                log_mirror_nspf  68.4G  yes  Mirrored log

                log_mirror       68.4G  no   Mirrored log

   log_profile = log_stripe       137G   no   Striped log

 cache_profile = cache_stripe     2.91T  -    Striped cache

zs3-mgmt01b:configuration storage config> done

zs3-mgmt01b:configuration storage> show

Properties:

                          pool = poolb

                        status = online

                        errors = 0

                         owner = zs3-mgmt01b

                       profile = mirror_nspf

                   log_profile = log_stripe

                 cache_profile = cache_stripe

                         scrub = none requested

zs3-mgmt01b:configuration storage> 

. . .

Active/Active: Creating the Pool on the other controller

zs3-mgmt01a:configuration storage> config poola

Verify and allocate devices. Verify that storage is correctly attached and functioning. If devices are missing or malfunctioning, they will not be available for use and cannot be added without reconfiguring the pool. It is recommended that you fix any problems before configuring storage on the appliance. Mixing device types and speeds is strongly discouraged.

Subcommands that are valid in this context:

help [topic]         => Get context-sensitive help. If [topic] is specified, it must be one of "builtins", "commands", "general", "help", "script" or "properties".

show                 => Show information pertinent to the current context

abort                => Abort this task (potentially resulting in a misconfigured system)

done                 => Finish operating on "verify"

get [prop]           => Get value for property [prop]. ("help properties" for valid properties.) If [prop] is not specified, returns values for all properties.

set [prop]           => Set property [prop] to [value]. ("help properties" for valid properties.) For properties taking list values, [value] should be a comma-separated list of

                           values.

zs3-mgmt01a:configuration storage verify> show

ID     STATUS   ALLOCATION   DATA          LOG           CACHE       RPM  

--    -------   ----------   -----------   -----------   ----------- -----

0         ok       custom   0             0             2/2   2.91T      

1         ok       custom   12/12 43.7T   0             0           7200 

2        ok       custom   10/10 36.4T   1/1   68.4G   0           7200 

3         ok       custom   12/12 43.7T   0             0           7200 

4        ok       custom   10/10 36.4T   1/1   68.4G   0           7200 

                            -----------   -----------   -----------

                            44    160T    2     137G    2     2.91T

zs3-mgmt01a:configuration storage verify> done

Choose Storage Profile. Configure available storage into a pool by defining its underlying redundancy profile. Carefully read the profile descriptions to understand how each balances the inherent trade-offs between availability, performance, and capacity, and select the profile that best fits your workload. If available, NSPF indicates no single point of failure, which affords certain profiles the ability for a pool to survive through loss of a single disk shelf.

Subcommands that are valid in this context:

help [topic]         => Get context-sensitive help. If [topic] is specified, it must be one of "builtins", "commands", "general", "help", "script" or "properties".

show                 => Show information pertinent to the current context

abort                => Abort this task (potentially resulting in a misconfigured system)

done                 => Finish operating on "config"

get [prop]           => Get value for property [prop]. ("help properties" for valid properties.) If [prop] is not specified, returns values for all properties.

set [prop]           => Set property [prop] to [value]. ("help properties" for valid properties.) For properties taking list values, [value] should be a comma-separated list of

                           values.

zs3-mgmt01a:configuration storage config> show

                 PROFILE          CAPCTY NSPF DESCRIPTION

       profile = mirror_nspf      75.2T  yes  Mirrored

                 mirror           75.2T  no   Mirrored

                 mirror3_nspf     50.1T  yes  Triple mirrored

                 mirror3          50.1T  no   Triple mirrored

                 raidz1           107T   no   Single parity, narrow stripes

                 raidz2_nspf      107T   yes  Double parity

                 raidz2           129T   no   Double parity

                 raidz3_nspf_max  100T   yes  Triple parity, wide stripes

                 raidz3_max       140T   no   Triple parity, wide stripes

                 stripe           158T   no   Striped

   log_profile = log_mirror_nspf  68.4G  yes  Mirrored log

                 log_mirror       68.4G  no   Mirrored log

                 log_stripe       137G   no   Striped log

 cache_profile = cache_stripe     2.91T  -    Striped cache

zs3-mgmt01a:configuration storage config> set log_profile=log_stripe  

                   log_profile = log_stripe

zs3-mgmt01a:configuration storage config> done

zs3-mgmt01a:configuration storage (poolb)> set pool=poola

zs3-mgmt01a:configuration storage (poola)> show

Pools:

   POOL             OWNER         DATA PROFILE  LOG PROFILE  STATUS   ERRORS

-> poola             zs3-mgmt01a  mirror_nspf   log_stripe   online   0

   poolb             zs3-mgmt01b  -             -            exported -

Properties:

                          pool = poola

                        status = online

                        errors = 0

                         owner = zs3-mgmt01a

                       profile = mirror_nspf

                   log_profile = log_stripe

                 cache_profile = cache_stripe

                         scrub = none requested

zs3-mgmt01a:configuration storage (poola)>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Task Completed: 2 pools created via the CLI.  Automating this is simply done by batching the commands and piping them in via ssh.  You can get more fancy than a batch script if you wish and the upcoming API can also be used.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Mike Triska, Storage Solutions Architect, blogs creative thoughts to help you get the most out of your Oracle storage

Search

Categories
Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today