Friday, October 19, 2012

Snapshot management in openfiler


Hello Folks,

Continuing with the previous discussion on Openfiler volume management, here we would see how to create snapshots and access it. Now snapshots is nothing but backup of the existing exported volume which would be available in case the mounted volume gets deleted, corrupted or unavailable due to other reasons.

1. First we would fill up the existing exported volume with some junk binaries or data
After some data is written over the disk we can proceed with the snapshot creation.



2. Next we navigate to the Volume which needs to be backed up or snapshot to be taken.
3. Click on Create under Snapshots section which would bring us to snapshot management. Currently since its a new volume and no snapshots are been created, list of existing snapshot volume would be empty.
Also you could schedule a automatic creation of snapshots depending on hours and latest how many to keep.
We would navigate to the last section which deals which the manual snapshot creation.
Kindly make sure, there must be free space in the volume group prior to creation of snapshot.


Here we would create a snapshot 
Name                 : First_snapshot
Size                     : 300MB [We have created a partition of 500 MB on exported volume]
Share Contents : Yes [Should the snapshot be readily available for mounting after creation]

4. After creation of new snapshot the volume utilization changes and this can be verified by checking the Manage Volume again
Navigate to Volumes-->Manage Volumes
Click Manage and under List of existing snapshot volume, you can see the newly created snapshot. Click Save
5. After creation of snapshot we need to make either a existing LUN for create a new LUN
We would create a new LUN to differentiate the existing volume disks
Navigate to Volumes-->iSCSI Targets
Add a new iSCSI target value as : iqn.2006-01.snapshot
Next select the new target from drop-down list of Select a iSCSI Target
and click Change
Next go to LUN Mapping and map the new volume : /dev/iscsi/of.snapshot.iscsi_volume.first_snapshot [In my case, your might differ] to this new target
Next under Network ACL, select the appropriate share
In my case we would provide the share to ACL: Anirudha. Select Allow and Click Update

6. Now to access the new LUN, follow the similar procedure as show in previous article using Microsoft iSCSI initiator.

Navigate to Start==>Control Panel
Under Administrative Tools, you can find the iSCSI initiator
Click on it

7. Now to access the new LUN, go to Start==>Run==>diskmgmt.msc
This would launch the Disk Management MMC. Here you could see a new disk [Disk2] in offline mode.
Right click Disk2 and bring it Online
This was mounted a H: drive on my machine. When checked the contents of this drive, following were the contents
Which are same contents as that of the existing exported volume [F: drive]

This concludes the post on snapshot creation and access it. You can try creating an additional new snapshot after altering the existing exported volume [F: drive here] and mount it.
I tried it with an additional one package been added to F: drive, Please find the drive contents for all 3 of them
1. Existing exported volume - F: drive
2. First snapshot volume       - H: drive
3. Second snapshot volume   - I: drive




Next article preferably would be to create volumes, snapshots and access it on Linux server.

Thanks
Anirudha

LVM configuration in openfiler


Today, I'm going to post about the How-To to add new disks, create partition on them, create volume groups, and create logical volumes. Also how to map them in LUN [More about it] and access them [right now used the Windows ISCSI initiator]

From the previous article [Here] I have briefed about the installation procedure for Openfiler on virtual machine.

1. First we would need to add new disks to virtual machine.
Click the VM
Right click and go to Edit Setting
Click on Add ==>Click on Disk==> Click Next
Enter Disk Size=1GB, Click Next==>Finish
Please find the screenshot for adding the new disk to existing machine. The procedure may differ depending on the virtualization application like VirtualBox, VMware ESX etc.


2. Continue with the steps and add new disk of 1GB to existing machine. Thus the virtual disks /dev/sdb and /dev/sdc was added.





3.  Now currently there are no volume groups available on the server.




4. After the disks are detected we would need to create partitions on it.

[Now the partition type can be Physical Volume or RAID volumes. We are using PV in this case]

For this navigate to Volumes-->Block Devices 
Click on /dev/sdb
Navigate to bottom on page, Under Create a partition section
Mode                 : Primary
Partition Type : Physical Volume
Click on Create
Thus resembling the partition details as show below 


5. Proceed with the same procedure on another disk /dev/sdc. Thus resembling the similar partition details as show below



 6. Thus we have now created two Physical Volumes [PV] on two disks [namely sdb and sdc].

7. Next after the creation of PV's we should bind them together in a Volume Group [VG].
Navigate to Volumes-->Volume Groups
Under Volume Group Management, we are able to see the newly created PV's.

Name: ISCSI
Selected both the check-box for physical volumes to add
Click on Add volume group
Thus a new VG would be created which is similar to above screen. You may see the PV associated with it by Clicking View member PVs or could delete it using Delete

8. After creation of PV's and VG we are now in position to create Logical Volumes [LV] on them.
Navigate to Volume-->Add Volume
Under “Create a volume” section

Name                                     : iscsi_volume
Volume Description             : Volume for ISCSI
Required Space (MB)          : 1024 [i.e. 1GB]
Filesystem / Volume type  : iSCSI

The same can be verified by checking the Volume Groups again. This time a new VG and its associated LV will be available here.

9. Now only thing left is creation of LUN and mapping of corresponding LV to it so that iSCSI would access it.
For creation of LUN, Navigate to Volumes-->iSCSI Targets

 Here you would see that Add button is grayed out. This is due to fact that iSCSI target server service is disabled. To enable the service, navigate to Services and then Click Enable

10. Edit the Target IQN and add a descriptive name rather than bunch of characters.
Target IQN: iqn.2006-01.iscsi
Click on Add
11. Next Click on LUN Mapping
Keep the default values as it is
R/W mode        : write-thru 
Transfer Mode : blockio
Click on Map

Next we need to provide the ACL so that only selected hosts are able to access the LUN
For this first we need to create a share.

Navigate to System
Under Network Access Configuration
Name             : Anirudha
Network/Host : 10.0.0.0
Netmask         : 255.0.0.0
Type               : Share

Once the share is available, navigate to iSCSI target again. Under Network ACL, select the access name Anirudha as Allow and click Update
12. For accessing the iSCSI target one would require the iSCSI initiator. This was readily available on my Win7 desktop.
Navigate to Start==>Control Panel
Under Administrative Tools, you can find the iSCSI initiator
Click on it

In Target, enter the IP address of the openfiler and click on QuickConnect


It would throw a quickconnect dialog box with the detected LUN [iqn.2006-01.iscsi]
Click Done


This can be verified from openfiler portal
Navigate to Status-->iSCSI Targets


Clicking on View would show you the IP address of the Win7 machine
13. Now to access the new LUN, go to Start==>Run==>diskmgmt.msc
This would launch the Disk Management MMC and would launch a dialog box for Initialize Disk


Clicking OK would initialize the disk and make it available for formatting on the system
Right Click the new disk [1GB] and Click Simple Volume
Enter 500 in Simple volume size in MB, Click Next

Assign the Driver Letter : F [This might differ in your case]
Format the system using default settings
NTFS, Quick Format




After the disk is initialized, it is shown as In Use in openfiler portal

 Now the new disk could be used as a local disk on the system.
Next article would be about taking the snapshots on the existing volume and mounting the same so as to view the contents of its