Version 1.0 May 2013 Snapshot in Qsan Unified Storage
Copyright Copyright@2004~2013, Qsan Technology, Inc. All rights reserved. No part of this document may be reproduced or transmitted without written permission from Qsan Technology, Inc. Trademarks All products and trade names used in this manual are trademarks or registered trademarks of their respective companies. Qsan Technology, Inc. 4F., No.103, Ruihu St., Neihu Dist., Taipei City 114, Taiwan (R.O.C.) Tel: +886-2-7720-2118 Fax: +886-2-7720-0295 Email: Sales@QsanTechnology.com Website: www.qsantechnology.com 2
Introduction Data protection is one of the key functions that a professional storage system should have. Qsan unified storage systems provide the following protection features. RAID protection Snapshot: block-level backup of differential Replication: array-based, block-level backup BBM * : use a battery module to backup cache during unexpected power failure ZFS on-disk consistency: ZFS file system can fix silent corruption and provide upmost consistency and reliability. We will focus on snapshot in this application note. A snapshot is a read-only copy of a file system or volume at a given point in time. Based on ZFS technology, a snapshot can be created in a few seconds without taking up too much CPU resource. It s a block level and differential backup. In case of any logical errors (wrong deleting, overwriting, virus attack etc), snapshots serve as recovery points when users need to roll back to an earlier stage. Below is the maximum snapshot number supported by each Qsan unified storage system. Qsan unified storage model Total number of snapshots U110 2048 U210, U220, U221 U400Q, U600Q 4096 * BBM function is available only in U400Q and U600Q models. How to Take Snapshot Snapshot function can only be applied to a file system or volume, which are the items showing in ZFS tab below. You cannot take a snapshot for a folder or a share inside a file system. Every item in the ZFS tab is the target for taking a snapshot. In QCentral, there are 3 places where you can take snapshot. 3
1. In ZFS tab, select a file system or volume you want to take snapshot. Right click to bring out the menu and select Take snapshot. 2. In Snapshot tab, right click to bring out the menu and select Take snapshot. A dialog box will pop up. Select the file system or volume you want to take snapshot. Enter the name of the snapshot. 3. In Sharing -> Explorer tab, select the file system or volume. Right click to bring out the menu and select Take snapshot. 4
Setting a Scheduled Snapshot Task You can have the system automatically take snapshots according to the schedule you set previously. There are two places to set the snapshot schedule (create a scheduled snapshot task). 1. In ZFS tab, select a file system or volume you want to take snapshot. Right click to bring out the menu and select Auto snapshot. 2. In Sharing -> Explorer tab, select the file system or volume. Right click to bring out the menu and select Auto snapshot. View All the Snapshots in the System All the snapshots are organized and displayed in Snapshot tab. You can check on snapshots of specific file system or volume by selecting from the drop-down list Select ZFS. Total gives you the number of the snapshots of the file system or volume. If you choose All, Total represents the overall number of snapshots in the NAS system. 5
The name syntax is composed of three parts. [Pool] / [file system or volume] @ [snapshot name]. So you can easily identify which pool and which file system or volume this snapshot belongs to. Used (MB) : Refer (GB) : This number doesn t represent the size of the snapshot. In file sharing mode, it is the size of changes between current snapshot and the next snapshot. In iscsi mode, it varies depending on the different file systems the clients (iscsi initiator side) are using. In file sharing mode, it is the actual size of overall at the time the snapshot was taken. In Windows, you can check this by viewing the Used space in Properties dialog box in Windows Explorer. In iscsi mode, it varies depending on the different file systems the clients (iscsi initiator side) are using. Let s briefly describe how these snapshots are taken. Each folder (foldera, B, C, D, E, F) below contains the same file a 4.3GB file. fs1 (file system 1) is shared as network drive P using share name aaa. fs2 (file system 2) is shared as network drive Q using share name ppp. vol1 (iscsi volume 1) is attached as raw drive E. Original sizes of fs1, fs2, and vol1 are 100GB, 150GB, and 200GB respectively. fs1 action table below. Time Content of FS1 Snapshot Actions taken t1 foldera snap1 t2 folderb snap2 t3 folderc snap3 1. Create foldera 2. Copy 4.3GB file to foldera 3. Take snap1 1. Create folderb 2. Copy 4.3GB file to folderb 3. Delete foldera 4. Take snap2 1. Create folderc 2. Copy 4.3GB file to folderc 6
t4 folderd snap4 3. Delete folderb 4. Take snap3 1. Create folderd 2. Copy 4.3GB file to folderd 3. Delete folderc 4. Take snap4 At t4, in Windows Explorer, it looks like below. It was 100GB before snapshot was taken. fs2 action table below. Time Content of FS2 Snapshot Actions taken t5 foldera snap5 t6 foldera, B snap6 t7 folderc snap7 t8 folderc, D, E snap8 t9 folderf snap9 1. Create foldera 2. Copy 4.3GB file to foldera 3. Take snap5 1. Create folderb 2. Copy 4.3GB file to folderb 3. Take snap6 1. Create folderc 2. Copy 4.3GB file to folderc 3. Delete foldera and B 4. Take snap7 1. Create folderd 2. Copy 4.3GB file to folderd 3. Create foldere 4. Copy 4.3GB file to foldere 5. Take snap8 1. Create folder 2. Copy 4.3GB file to folderf 7
3. Delete folderc, D, and E 4. Take snap9 At t9, in Windows Explorer, it looks like below. It was 150GB before snapshot was taken. For vol1, we did exactly the same thing as fs1. Time Content of vol1 Snapshot Actions taken t10 foldera snap10 t11 folderb snap11 t12 folderc snap12 t13 folderd snap13 1. Create foldera 2. Copy 4.3GB file to foldera 3. Take snap10 1. Create folderb 2. Copy 4.3GB file to folderb 3. Delete foldera 4. Take snap11 1. Create folderc 2. Copy 4.3GB file to folderc 3. Delete folderb 4. Take snap12 1. Create folderd 2. Copy 4.3GB file to folderd 3. Delete folderc 4. Take snap13 At t13, in Windows Explorer, it looks like below. 8
200GB How to Rollback a Snapshot To rollback a snapshot means that the content of the file system and volume will be returned to the original state when the snapshot was taken. If you want to rollback to an earlier snapshot S3, the snapshots (S4, S5) that come after this earlier snapshot will be deleted automatically. This is to maintain the logic consistency and increase storage efficiency. Time Now S1 S2 S3 S4 Rollback S3 S5 Time Now S1 S2 S3 For example, let s roll back to snap2 for fs1. You will see snap4 and snap3 will be gone and fs1 will go back to its original state when snap2 was taken. It means that you will have folderb. Please be 9
aware that rollback will take immediate effect and the content of file system and volume will be changed forever. CAUTION: Rollback a volume will cause iscsi connection disconnected. You need to reconnect the volume again using iscsi initiator. Retrieve the Data from Snapshot Clone You can not directly access the in a snapshot. To access the inside a snapshot, you need to Clone the snapshot first. A clone is a writable file system or volume whose initial contents are the same as the snapshot from which it was created. Creating a clone is nearly instantaneous and initially consumes no additional disk space. For example, let s clone snap6 for fs2 and clone snap11 for vol1. The clones are named fs2snap6clone and vol1snap11clone respectively. Select the snapshot you want to perform clone function. Right click to bring out the menu and click Clone. After performing clone function, the snapshot itself still exists. You may clone the same snapshot again using a different clone name or roll back the snapshot. 10
In ZFS tab, the clone file system (fs2snap6clone) and clone volume (vol1snap11clone) are displayed here. They exist in the same pool as the file system or volume of the snapshot clones. In order to use the storage more efficiently, current design is that all clones will use thin provisioning and generic zero reclaim for block-level compression by default. This is why the Reserved(GB) column of both clones is none. You may change the clone properties by using Edit function in the right click menu. Because we max out the pool space on purpose, if you try to disable thin provisioning and allocate space more than 0.57GB, you will get warning message of not enough pool space. So where are the in clones stored? And why is the Used space of both clones 0? It is because these are still stored in fs1 and vol1. The snapshots and clones only refer to these by pointers. Now let s share the file system clone as network drive R and attach the volume clone as drive F. You can read the content out, but you can t write new more than 0,57GB into drive R or F because there is not enough free space left. 11
TIP: Taking snapshot of the clones is not allowed. CAUTION: Delete the snapshot. The NAS system will automatically delete the clone of the snapshot. Delete the file system or volume. The NAS system will automatically delete the related snapshots of the file system or volume. And of course, the related clones will be automatically deleted as well. How to Provision Snapshot Space Snapshot itself contains meta only and consumes less space usually 20KB to less than 100KB. It is the changes that will take up the most space. Snapshot will reside in the very same file system or volume that it was taken on. So snapshots plus changes (deleted or old ) will occupy the space of the file system or volume, which means that although these are deleted or overwritten, the system can NOT free up the space to store new because snapshot function is in action. The way file system and volume treat snapshot space is different. Let s summarize below. 12
Thin enabled ZFS File system Volume Behaviors of snapshot Both file system and volume behave the same. All required space is dynamically allocated from the storage pool. Calculate the size of the variation of each file system and volume in the storage. Add them up. Make sure the pool has enough free space to keep these. When pool space is not enough, warning message will be issued and further snapshot is not allowed to be taken. Free space of the pool = Sum of variation of all file system and volume over the snapshot period Thin disabled File system Volume Snapshots and the snapshots need to keep will occupy the space of the file system. The size of the file system appearing to the network share clients (CIFS, NFS, AFP, FTP, WebDAV) will become smaller and smaller. This is because file system is created with Quota limit. And file system size equals quota size. File system size = Data size + Size of variation over the snapshot period Snapshots and the snapshots need to keep will occupy the space of the volume. When the snapshot eat up the space of the volume, the volume can keep allocating free space from the pool to store new, snapshots, and the variation snapshots need to keep. The volume size remains the same to the clients (iscsi initiator). Free space in the pool = Size of variation over the snapshot period A concept graph demonstrates below. Thin provision enabled Storage pool File system File system Snapshot Volume Volume Snapshot Volume nominal size Free space Thin provision disabled Storage pool File system File system Snapshot Volume Volume Snapshot Size seen in Windows after snapshot Size seen in Windows before snapshot Volume nominal size 13
From earlier screenshot, fs1 shows only 86.9GB capacity at t4. fs1 was created with 100GB capacity. It was 100GB before snapshot was taken. How to Delete Snapshots Because each snapshot is independent of each other, you may delete any snapshot at any order at any time. Just select the snapshot(s) you want to delete. Right click to bring out the menu and select Delete. TIP: Deleting the snapshots will free up the space occupied by snapshots. CAUTION: Please be aware that deleting a huge amount of snapshots (over 500) may take a while to accomplish. Please be patient. 14
CAUTION: Please be aware that in Qsan SAN storage models (AegisSAN, AegisSAN LX), there is inter dependence between snapshots. Deleting a snapshot in the middle of a time sequence will make the snapshots ahead of the deleted one invalid. When the Maximum Limit is Reached When the total snapshot number is reached, no snapshot can be taken. A warning event log will be issued to notify the administrator. You need to delete old snapshots to allow new snapshots being taken. The system will NOT automatically remove the oldest snapshot to make room for the new snapshot. 15