Monday, February 11, 2008

Setting Snapshots in DataONTAP

The Snapshot technology is a key element in implementation of WAFL file system.
Snapshot is a read-only space-efficient,point-in-time image of the data in a volume.
It is only a picture of the file system and doesn't contain actual data.
These are used for backups and error recovery.

Data ONTAP automatically creates and deletes snapshots of data in volumes.
Volumes:
Snapshot for traditional and flexible volumes are stored in special sub directories.These sub directories can be access by both Windows and UNIX clients.maximum of 255 snapshots per volume may be stored at any one time.

Aggregates:
5% of and aggregate is reserved for snapshots of the aggregate.DataONTAP automatically creates snapshots of aggregate to support commands related to the Snapmirror.

Snapshots are taken according to an automatic schedule.We can also can reset it mannually when we configuring the storage appliance.Schedule intervals are weekly,Daily and Hourly.We can perform backups on recently created snapshots with out taking the system offline,because the snapshots are stored independent of the Active File System(AFS).
Before the snapshot is taken we have a file systen tree pointing to data blocks containing content.After the snapshot is taken there is no significant impact on disk space,because file structure take little space and no data blocks need to be copy on disk.But snapshot begins to use space when data is deleted or modified.WAFL writes new data to a new block(D') and change the root structure point to the new block.Meanwhile snapshot still references the original block D.



Allocation of Disk space for flexible volumes

Each aggregate has 5% allocated for snap reserve and 10% allocated for WAFL.Each flexible volume has 20% allocated for snap reserve.The remainder used for client data.The amount of space allocated for snap reserve is adjustable.

Allocation of Disk space for Traditional Volumes

Each aggregate has 10% allocated for WAFL.Each traditional volume has 20% allocated for snap reserve.The remainder used for client data.


The space used for the snap reserve on a volume may expand downward into user space as required by system needs.

Commands use to create and manage Snapshots

If we omit the volume name,the command applies to the root volume.In the snap command the option A is used for aggregates and the option V is used for volumes.Volume is the default.

The snap list command displays a single line of information for each snapshot in a volume.

The "snap sched" command sets the schedule for automatically creating Snapshots and specifies how many of each type will be stored.When the limit is reached,the oldest for each interval is deleted as a new Snapshot is added.
We can also use the FilerView graphical interface to shedule snapshots.
  1. Volume-->Snapshot-->Configure
  2. Select the Volume
  3. Enter the number of snapshots to keep
  4. Use the clockfaces to select hours that snapshot will be taken
  5. Click Apply
To add snapshots:
Volumes->Snapshots->Add

To view a list of current Snapshots
Volumes->Snapshots->Manage

To delete snapshots manually
Volumes->Snapshots->Manage->check the snapshot->delete

We can enable snapshot in CIFS using the GUI
CIFS->Configure->Option->Show snapshots->set yes

Every volume in the file system contains a special Snapshot sub directory.This allow user to access earlier versions of the file system in case where they need to recover lost or damaged files.

UNIX clients

Snapshot sub-directory apears for NFS client as .snapshot.These directories are usually hidden.
To view the .snapshot directory:
  1. logging as root and nosnapdir option is set off: vol option vol0 nosnapdir off
  2. To view use ls -a

Windows clients

First configure the file manager to display hidden files,then navigate the root of the CIFS share and look for the directory folder.Snapshot sub-directory appears to CIFS client as ~snapshot.To restore a file from the ~snapshot rename or move original file then copy the file to the directory in which the file is originally existed.

No comments: