Thursday, February 28, 2013

Mounting Snapshot LUNS on the Same Host as the SRC LUNs (Linux)


This steps will surely help guys who are having dev/test environment and also will save lot of time then restoring the whole data from the backups

Preparing the DB for Snapshot

1. Shutdown or Begin Hot backup on the DB you want to snap

Create the Snapshot on the Storage

2. Create the Snapshot on the LUNs related to <VGNAME>

Change the PVID and VGID on the DB Host

3. Unmount the file systems in the VG

4. Deactivate the Original VG
a. vgchange -a n <VGNAME>

5. Change the UUID of the PVs(Disks) in the VG (Make sure to do it on all Disks in the VG)
b. pvchange -u <DISKSinVG>

6. Change the UUID of the Original VG
c. vgchange -u <VGNAME>

7. Rename the original VG
d. vgrename <VGNAME> <VGNAME>_orig

Map the Snapshot to the DB Host

8. Make sure the PVIDs and VGIDs of the Original VG are changed before presenting the Snapshot
LUN to the Host.

9. On the Storage System, export/map the new Snapshot LUN to the DB Host .

Importing the Snapshot VG to the Host

10. Scan for the new Snapshot LUN
e. echo "- - -" > /sys/class/scsi_host/<hostX>/scan

11. Create Multipath devices for Snapshot LUN
f. multipath

12. Scan for the PVs(It shouldn't show any duplicate UUIDs)
a. pvscan

13. Import the Snapshot VG
g. vgimport <VGNAME>

14. Rename the VG on the Snapshot LUN
a. vgrename <VGNAME> <VGNAME>_Snap1

15. Generate a new PVID for Snapshot LUNs
a. pvchange -u <DISKSinSNAPVG>

16. Generate a new VGID for the Snapshot VG
a. vgchange -u <VGNAME>_Snap1

17. Generate a new VGID for Snapshot VG

18. Rename the Original VG to its actual name
b. vgrename <VGNAME>_orig <VGNAME>

19. Activate Original VG as well as Snapshot VG
a. vgchange -a y <VGNAME>
b. vgchange -a y <VGNAME>_Snap1

20. Add FSTAB Entries for the Snapshot VG

21. Mount the file systems in Original VG as well as the Snapshot VG.

Unified share in VNX


Today I would like to share something which i was not able to find on the manuals, I got a request to share a filesystem on our VNX so that the users using Windows and Linux clients can access the share.

I was searching for ideas and with the help of one of my colleague was able to find a way to do it. So, in order to do this we have to create a Virtual Datamover which will server the data for our Windows client and for the NFS request from Linux clients.

I really liked the concept of EMC Celerra to create a Virtual Datamover (VDMs) which adds more security by letting the clients access the filesystem from VDMs ip and not populate of the physical DMs.

Lets just create a new VDM

[nasadmin@cs0 ~]$nas_server -name VDM01 -type vdm -create server_2

[nasadmin@cs0 ~]$ nas_server -l -a
id      type  acl  slot groupID  state  name
1        1    0     2              0    server_2
2        4    0     3              0    server_3

id       acl  server    mountedfs       rootfs  name
8        0    1         1               1       VDM01

We will create a new pool for this purpose and a new shared filesystem 

[nasadmin@cs0 ~]$nas_pool -create -name clar_r5_media -volumes d7,d8

[nasadmin@cs0 ~]$nas_fs -name unify_fs -create size=800G pool=clar_r5_media

Here we are creating a CIFS server under the VDM and adding it to domain which will let user which are part of the active directory access the filesystem

[nasadmin@cs0 ~]$server_cifs VDM01 -Join compname=cifs01,domain=ad.test.com,admin=Administrator,ou="ou=Computers:ou=EMC Celerra"

There are three simple steps which we have to do once the filesystem is created, creating a mountpoint, mounting the filesystem and exporting it to the clients

Lets just do it for windows clients which will be using CIFS protocol access the files

[nasadmin@cs0 ~]$server_mountpoint VDM01 -create /unify_fs

[nasadmin@cs0 ~]$server_mount VDM01 -option accesspolicy=MIXED_COMPAT unify_fs /unify_fs

[nasadmin@cs0 ~]$server_export VDM01 -Protocol cifs -name unify_fs /unify_fs

Now, lets just do it for Linux clients which will be accessing the share using NFS but before we do that we have to find the root path of the VDM so that we can add it with the shared filesystem

[nasadmin@hct-cs0 ~]$ nas_fs -l |grep VDM01
24        y    1   0     157       root_fs_vdm_VDM01   1

[nasadmin@cs0 ~]$ server_df server_2 root_fs_vdm_VDM01
server_2 :
Filesystem          kbytes         used        avail capacity Mounted on
root_fs_vdm_VDM01
                1907824776         8576   1907816200    0%    /root_vdm_8/.etc

Here's another way to find that

[nasadmin@cs0 ~]$ server_mount server_2 |grep VDM01
root_fs_vdm_VDM01 on /root_vdm_8/.etc uxfs,perm,rw

Now, we can create mountpoint, mount the share and export

[nasadmin@cs0 ~]$server_mountpoint server_2 -create  /root_vdm_8/unify_fs

[nasadmin@cs0 ~]$server_mount VDM01 -option accesspolicy=MIXED_COMPAT unify_fs /root_vdm_8/unify_fs

[nasadmin@cs0 ~]$server_export server_2 -Protocol nfs -name unify_fs /root_vdm_8/unify_fs


[nasadmin@cs0 ~]$ server_export VDM01
VDM01 :
share "unify_fs" "/unify_fs" type=Global umask=022 maxusr=4294967295 netbios=CIFS01


[nasadmin@cs0 ~]$ server_export server_2
server_2 :
export "/root_vdm_8/unify_fs" name="/unify_fs"


That was pretty easy!!

Sunday, December 30, 2012

IPMP on solaris 11



With the introduction of Solaris 11 the network configuration are managed by network configuration policies (NCPs), there are two policies which can be implemented Fixed which are statically implemented and reactive which are dynamically implemented. The network configuration commands that are used are ipadm and dladm which offers lot of new feature like Link aggregation, vlan tagging, ip tunneling, bridging and IPMP, also the setps involved in configuring them are less and which makes it less burden on system administrators.
Just wanted to touch base on configuring few of these feature.

******
IPMP
******

IPMP (IP multipathing) is a grouping of the network interface into single logical interface. The IPMP can be configured in two types of failure detection Link based (layer 2) & probe based (layer 3)
The IPMP feature enable us to achieve the distribution of data address (active-active) & transparent access failover (active-passive). These feature enable us for achieve high availability on our network interface when there is a failure or failover the interface when we are doing any maintenance.


A. Link-Based IPMP

===========
Active/Active
===========

1. Check if the network automatic configuration is disbaled and the default is enabled.

root@suntest:~# netadm list
TYPE        PROFILE        STATE
ncp         Automatic      disabled
ncp         DefaultFixed   online

2. list all the physical interfaces available.

root@suntest:~# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net1              Ethernet             up         1000   full      e1000g1
net0              Ethernet             up         1000   full      e1000g0

3. Add the ip in the /etc/hosts so that it remains persistent across the reboot

root@suntest:~# echo "192.168.75.25 testipmp0" >> /etc/hosts

4. Create the ipmp group & add the interface to the group

root@suntest:~# ipadm create-ipmp ipmp0
root@suntest:~# ipadm create-ip net0
root@suntest:~# ipadm create-ip net1
root@suntest:~# ipadm add-ipmp -i net0 -i net1 ipmp0

5. Assign the ip address for the ipmp interface which is configured.

root@suntest:~# ipadm create-addr -T static -a 192.168.75.21/24 ipmp0/v4

6. Review the configurtion.

root@suntest:~# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        --        net1 net0

root@suntest:~# ipmpstat -a
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
suntest                   up     ipmp0       net1        net1 net0

root@suntest:~# ipmpstat -i
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net0        yes     ipmp0       -------   up        disabled  ok
net1        yes     ipmp0       --mbM--   up        disabled  ok

As you can see both the network interfaces are active here and part of ipmp group

===============
Active/Passive
===============

For configuring the Active/Passive link based ipmp group perform the same step from 1 to 4 and then

5. Make one of the interface as standby from the ipmp group and then assign the ip

root@suntest:~# ipadm set-ifprop -p standby=on -m ip net1
root@suntest:~# ipadm create-addr -T static -a 192.168.75.21/24 ipmp0/v4

6. Review the configurtion.

root@suntest:~# ipmpstat -g
GROUP       GROUPNAME   STATE     FDT       INTERFACES
ipmp0       ipmp0       ok        --        net0 (net1)

root@suntest:~# ipmpstat -a
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
suntest                   up     ipmp0       net0        net0

root@suntest:~# ipmpstat -in
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net1        no      ipmp0       is-----   up        disabled  ok
net0        yes     ipmp0       --mbM--   up        disabled  ok


B. Probe-base IPMP

The probe-based IPMP that is supported in Solaris 11 are two kind with Test ip on interfaces & Transitive probing.

*** Configuring Probe-based with Test addresses (Active/Active) ***

1. Confirm if the transitive probling is not started, which by default is set to test address

root@suntest:~# svccfg -s svc:/network/ipmp listprop config/transitive-probing
config/transitive-probing boolean     false

2. Create the ipmp group and add the interface

root@suntest:~# ipadm create-ipmp ipmp0
root@suntest:~# ipadm create-ip net0
root@suntest:~# ipadm create-ip net1
root@suntest:~# ipadm add-ipmp -i net0 -i net1 ipmp0

3. Assign the ip for the ipmp interface and test address for the physical interfaces/

root@suntest:~# ipadm create-addr -T static -a 192.168.75.21/24 ipmp0/v4
root@suntest:~# ipadm create-addr -T static -a 192.168.75.2/24 net0/test1
root@suntest:~# ipadm create-addr -T static -a 192.168.75.3/24 net1/test2

4. Add a target to which the interfaces will probe.

root@suntest:~# route add default 192.168.75.1

5. Review if everything is working as you wanted.

root@suntest:~# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.75.21             up     ipmp0       net0        net1 net0

root@suntest:~# ipmpstat -tn
INTERFACE   MODE       TESTADDR            TARGETS
net1        routes     192.168.75.3        192.168.75.1
net0        routes     192.168.75.2        192.168.75.1

root@suntest:~# ipmpstat -in
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net1        yes     ipmp0       -------   up        ok        ok
net0        yes     ipmp0       --mbM--   up        ok        ok


For configuring Probe-based with Test adresses (Active/passive) just do one step after 3

root@suntest:~# ipadm set-ifprop -p standby=on -m ip net1

and the difference you will see as below

root@suntest:~# ipmpstat -in
INTERFACE   ACTIVE  GROUP       FLAGS     LINK      PROBE     STATE
net1        no      ipmp0       is-----   up        ok        ok
net0        yes     ipmp0       --mbM--   up        ok        ok

root@suntest:~# ipmpstat -an
ADDRESS                   STATE  GROUP       INBOUND     OUTBOUND
192.168.75.21             up     ipmp0       net0        net0


*** Configuring Transtive probing using Active/Active method ***

1. Enable the transitive probing

root@suntest:~# svccfg -s svc:/network/ipmp setprop config/transitive-probing=true
root@suntest:~# svcadm refresh ipmp

2. Create the ipmp group and add the interface

root@suntest:~# ipadm create-ipmp ipmp0
root@suntest:~# ipadm create-ip net0
root@suntest:~# ipadm create-ip net1
root@suntest:~# ipadm add-ipmp -i net0 -i net1 ipmp0

3. Assign the ip for the ipmp interface

root@suntest:~# ipadm create-addr -T static -a 192.168.75.21/24 ipmp0/v4

4. Review the configuration

root@sunclu1:~# ipmpstat -tn
INTERFACE   MODE       TESTADDR            TARGETS
net1        transitive <net1>              <net0>
net0        routes     192.168.75.21       192.168.75.1

root@sunclu1:~# ipmpstat -pn
TIME      INTERFACE   PROBE  NETRTT    RTT       RTTAVG    TARGET
0.77s     net1        t247   1.92ms    1.93ms    1.70ms    <net0>
0.77s     net0        i244   0.86ms    1.15ms    1.09ms    192.168.75.1
1.88s     net1        t248   1.68ms    1.69ms    1.70ms    <net0>
1.88s     net0        i245   0.73ms    1.21ms    1.11ms    192.168.75.1


Hope this document was helpful...