Many modern SAN storage systems have a built-in snapshot capability. There are some valid use cases for such a capability but generally speaking, you’re not likely to run into those cases for volumes that are hosting LUNs for advanced filesystems like ZFS. Many of these advanced filesystems assume they have full control over the devices they’re managing and they therefore don’t handle out-of-space conditions on those devices well. One example is below.
An administrator asked for my help with a zpool that kept getting corrupted:
[root@ftpserv2:~]# zpool status -v ftpool
pool: ftpool
state: UNAVAIL
status: One or more devices are unavailable in response to persistent errors.
There are insufficient replicas for the pool to continue functioning.
action: Destroy and re-create the pool from a backup source. Manually marking
the device repaired using 'zpool clear' or 'fmadm repaired' may
allow some data to be recovered.
scan: none requested
config:
NAME STATE READ WRITE CKSUM
ftpool UNAVAIL 0 0 0
c1d1 UNAVAIL 0 0 0
device details:
c1d1 UNAVAIL corrupted data
status: ZFS detected errors on this device.
The device has bad label or disk contents.Ruh-roh! There’s almost 700 gig of data down the proverbial toilet. But what’s causing it? I knew it wasn’t a failed hard drive because this “drive” is really a LUN on a SAN volume. Naturally, the first thing I did was take a look at the NetApp on which the LUN resided.
cdot::> df -h
Filesystem total used avail capacity Mounted on Vserver
< . . . >
/vol/vol_ftpserv2_ws/ 3161GB 3161GB 0B 100% --- fc
/vol/vol_ftpserv2_ws/.snapshot
166GB 2157MB 164GB 1% --- fcWell, there’s our problem — the volume that hosts the LUN is full. That’s not supposed to happen! Our problem is twofold. First, it turns out the administrator created the volume as thin-provisioned. Bad idea when it’s hosting LUNs. Second, company policy forbids the use of snapshots on volumes that contain LUNs precisely because of situations like this one, so we need to delete the snapshots and then disable future snapshotting. I also noticed that atime-update was still at its default value of true. Updating the atime doesn’t make much sense when all the volume is holding is LUNs. It also incurs a performance penalty (slight though it may be). For whatever reason, atime-update can only be changed in advanced privilege mode on a NetApp running their Clustered Data ONTAP (cDOT) operating system. If it weren’t for that, the vol modify shown below would not require the switch to advanced privilege.
cdot::> snapshot delete -vserver fc -volume vol_ftpserv2_ws -snapshot *
CDOT::> set -priv advanced
cdot::*> vol modify -vserver fc -volume vol_ftpserv2_ws -fractional-reserve 100 -space-guarantee volume -percent-snapshot-space 0 -snapshot-policy none -atime-update false
CDOT::*> set -priv admin
CDOT::>I’m not saying that snapshotting is inherently a bad practice but it has very limited usefulness for volumes that host LUNs. It’s better to use the client operating system’s native snapshot functionality instead. We’re fortunate that ZFS has dead-simple snapshotting capability baked in. One scenario where storage-level snapshots might make sense is duplicating a volume but I would recommend you only do that when the LUNs are unmounted (or if you’re booting from one of the LUNs, the client OS is shut down).
I’ll probably write a separate post on this but thin provisioning a zpool’s underlying storage is not a good idea, either.