Add And Remove ZILs Live!

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-12162483-1"); pageTracker._trackPageview(); } catch(err) {}</script>

Rationale

Ever been playing with separate logs (separate ZIL, logzilla, etc...) and had to rebuild the pool everytime you wanted to yank the slog off ?

Not so anymore! The zil can now be added and removed as you like! Truly fantastic to tinker with it and observe its actual impact on performance. A quick walk through one of the most painless migrations of all times.

Bird's Eye View

As ZILs get more and more exposure to production environments, technical staff is getting to experiment more and more to be able to make recommendations and the new removal feature adds a lot more flexibility to try creative combinations.

The Meat

Let's suppose you have a pool with a separate log:

arnaud@ioexception:/data/dsee7.0/instances$ zpool status data
  pool: data
 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
    data                      ONLINE       0     0     0
      c8d0                    ONLINE       0     0     0
    logs
      /dev/ramdisk/zil-drive  ONLINE       0     0     0

errors: No known data errors

If you try to remove the log by removing the actual separate log device, you'll get the following error:

arnaud@ioexception:/data/dsee7.0/instances$ pfexec ramdiskadm -d zil-drive
ramdiskadm: couldn't delete ramdisk "zil-drive": Device busy

If you now try to use the zpool remove command, you will also hit a wall:


arnaud@ioexception:/data/dsee7.0/instances$ zpool remove data log /dev/ramdisk/zil-drive
cannot remove log: no such device in pool
cannot remove /dev/ramdisk/zil-drive: pool must be upgrade to support log removal

So let's just follow up on the suggestion and upgrade the pool: 



arnaud@ioexception:/data/dsee7.0/instances$ pfexec zpool upgrade data
This system is currently running ZFS pool version 22.

Successfully upgraded 'data' from version 14 to version 22

arnaud@ioexception:/data/dsee7.0/instances$ zpool status data
  pool: data
 state: ONLINE
 scrub: none requested
config:

    NAME                      STATE     READ WRITE CKSUM
    data                      ONLINE       0     0     0
      c8d0                    ONLINE       0     0     0
    logs
      /dev/ramdisk/zil-drive  ONLINE       0     0     0

errors: No known data errors

Wow, that's quick, easy and smooth. Gotta love migrations of that sort. Let's now try to remove our separate log:


arnaud@ioexception:/data/dsee7.0/instances$ pfexec zpool remove data log /dev/ramdisk/zil-drive
cannot remove log: no such device in pool
arnaud@ioexception:/data/dsee7.0/instances$ zpool status data  pool: data
 state: ONLINE
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    data        ONLINE       0     0     0
      c8d0      ONLINE       0     0     0

errors: No known data errors

So even though it barfed an error message, my separate log has been removed from my pool and I will be able to decommission my device.

arnaud@ioexception:/data/dsee7.0/instances$ pfexec ramdiskadm -d zil-drive
arnaud@ioexception:/data/dsee7.0/instances$

And I can now create a new device and do some more testing. Props to the ZFS for the ever improving level of service this file system brings to the table!

Comments:

I would like to underscore that I don't "recommend" this pool configuration in particular but I am merely pointing out that the separate log can be added and removed at will now. This pool has a single drive and that in particular isn't recommended if you care about your data but in the case at hand, this machine has only one disk. So that was that.

The fact is that depending on your server's usage pattern, you may need to change your pool configuration depending on the life cycle phase you are in.
For example, if you will have a Directory Server running, you will want to have as big a ZIL as you can for the import phase and then later, you would yank the zil out of the pool, repartition your SSD to have a smaller ZIL and use the rest as L2ARC. I'll post a separate article on how to do so.

Posted by arnaud on December 14, 2009 at 07:48 AM MST #

Just to add..

If you need to remove a mirrored slog. You'll have to remove the top-level mirrored device. Ex:

storit:/gpool$ zpool status gpool
pool: gpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
gpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c5d0p2 ONLINE 0 0 0
c5d1p2 ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
c4t2d0p1 ONLINE 0 0 0
c4t3d0p1 ONLINE 0 0 0

storit:/gpool$ pfexec zpool remove gpool mirror-1

storit:/gpool$ zpool status gpool
pool: gpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
gpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c5d0p2 ONLINE 0 0 0
c5d1p2 ONLINE 0 0 0

errors: No known data errors

Posted by Alan V on May 31, 2010 at 04:40 AM MDT #

What version of Solaris can you upgrade to ZFS 22? I'm running OpenSolaris 2009.06 under support and I still don't have an update that provides the ZFS upgrade.

Posted by Michael Schenck on June 02, 2010 at 03:50 AM MDT #

arnaud@ioexception:/data/dsee7.0/instances$ pfexec zpool remove data log /dev/ramdisk/zil-drive
cannot remove log: no such device in pool

The reason for this error message is that the arguments to "zpool remove" are the devices you want to remove; so it tries to remove "log", which doesn't exist, and then "/dev/ramdisk/zil-drive" which is successfully removed.

@Michael: I suppose you'll need to upgrade to the dev tree, or wait for the next OpenSolaris release.

Posted by Tristan Seligmann on July 24, 2010 at 02:32 PM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Directory Services Tutorials, Utilities, Tips and Tricks

Search

Archives
« April 2014
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
   
       
Today