2009-07-24 04:22 AM - last edited on 2014-09-26 07:47 PM by alissa
The problem I am facing has been mentioned below:
I am using Snapdrive For Linux 4.1.
To create a snapshot of a lun I use the following command.
snapdrive snap create -lun <filer:lunname> -snapname <name of snapshot>
The above command successfull creates the snapshot of a lun.
I want to take a snapshot of a lun through the netapp API's but I am unable to find the API that produces the exact output as the snapdrive command mentioed above.
The API 's i am currently using is Manage ONTAP SDK 3.0R for JAVA .
I would like to know can implement the above commant using an API ? If Yes Please tell the appropriate API that can be used ?
I have tried taking snapshot of a volume with the help of API's and it successfully created the snapshot.
2009-07-25 11:32 AM
There is no such thing as "snapshot of LUN" - you always take snapshot of a volume. Snapdrive just resolves volume name from LUN name and hides from you gory details. Additionally on Windows it makes filesystem sync; I am not sure whether it does it on Linux; AFAIK not.
So to create crash-consistent snapshot of a LUN just create snapshot of a volume containing this LUN.
2009-07-27 04:56 AM
Now I have taken the snapshot of the whole volume with the help of Manage ONTAP API.
Can you tell me how can I create a LUN from this snapshot copy.
There is an API called lun-create-from-snapshot which takes the following inputs:
1. path <string> the path of the LUN (this is the path of the new lun that will be created after restore . Correct me if i am wrong)
2. snapshot-lun-path <string> LUN path in the snapshot to be created from. (?)
the other 2 are optional inputs.
The statement ie marked in bold is not clear to me.
the following details might be useful
Filer name : Tolkien
volume name: /vol/test_zimbra
LUN name : zimserver
name of the snapshot : snap_from_api ( this is a snapshot of a volume).
2009-07-29 08:58 PM
snapshot-lun-path is as shown in this example below:
C:\manage-ontap-sdk-3.5P1\bin\nt>apitest.exe <IP address> <user> <pwd> lun-create-from-snapshot path /vol/voltest/lun3_from_lun2 snapshot-lun-path /vol/voltest/.snapshot/snap_for_lun_connect/lun2 space-reservation-enabled false
In your case it would be: /vol/test_zimbra/.snapshot/snap_from_api/zimserver
2012-04-04 09:54 PM
It takes the snapshot of the entire volume but only the LUN is crash-consistent.
When you execute a snap create operation for a LUN using snapdrive, it freezes I/O on the specific LUN before taking the snapshot of the volume where the LUN resides.
Thus if there are other LUNs or files (which may be connected or mounted to different hosts) present in the same volume, I/O on these entities are not frozen during snapshot creation.