README for snapshot-plugin
---------------------------

The snapshot-plugin is used for backup using snapshots.
Any snapshot plugin should implement the following action
a) get-vm-device-details
b) create-snapshot
c) mount
d) umount
e) remove-snapshot

The details of each of these actions are as follows

a) get-vm-device-details
-------------------------
The action get-vm-device-details is used by ZRM to find out details of the 
logical volume the given directory is residing on. If the plugin does not 
output any data, it assumes that the given directory does not reside on a 
logical volume.The data that it expects from the plugin are

a) The device path that the filesytem resides on
b) The device path that would be created when the snapshot is created 
   (The snapshot name is passed to the plugin by ZRM)
c) The mount point that the volume is mounted on
d) The type of filesystem that the volume contains

--action get-vm-device-details requires 2 inputs
--directory <path>
--sname <name of snapshot>
directory specifies the name of the directory that is on the logical volume
sname specifies the identifier that ZRM will use for this particular snapshot.

If the given directory is not on a logical volume, 
no output should be generated.

Else the following 4 lines should be output on STDOUT
device=<device path>
snapshot-device=<snapshot device path>
device-mount-point=<where the device is mounted>
filesystem-type=<type of filesystem created on the device>

For e.g. the output should look like
device=/dev/system/mysql_volume
snapshot-device=/dev/system/zrm_snapshot
device-mount-point=/var/lib/mysql
filesystem-type=xfs

b) create-snapshot
-------------------
The action create-snapshot is used by ZRM to actually create the snapshot.
No output is expected
--action create-snapshot requires 3 inputs
--dev <device>
--size <size of snapshot>
--sname <name of snapshot>
dev define the device for which snapshot is to be created
size defines the size of the snapshot volume to be created
sname is the name of the snapshot to be created

No output is expected.
If there is an error in creating of the snapshot call printAndDie() 
with appropriate error message

c) mount
---------
The action mount is used by ZRM to mount the snapshot on a given directory.
--action mount requires 3 inputs
--dev <device>
--directory <mount point>
--fstype <type>
dev specifies the device to be mounted
directory specifes the directory on which the device should be mounted.
fstype specifies the type of filesystem on the volume

No output is expected.
If there is an error in creating of the snapshot call printAndDie() 
with appropriate error message

d) umount
----------
The action umount is used by ZRM to unmount the snapshot
--action umount requires 1 input
--directory <path>
directory specifies the directory to be unmounted.

No output is expected.
If there is an error in creating of the snapshot call printAndDie() 
with appropriate error message

e) remove-snapshot
-------------------
The action remove-snapshot is used by ZRM to remove the snapshot
--action remove-snapshot requites 1 input
--dev <device>
dev specifies the snapshot device to be removed.

No output is expected.
If there is an error in creating of the snapshot call printAndDie() 
with appropriate error message

