Monday, April 7, 2014

Working with VxVM mirroring

How to make RAID 1 in simple steps. 

In Lab i have:


1- RHEL 6 system
2- two 2GB disks
   i - disk_4 -> i'll refer this disk as p_disk
  ii - disk_5 -> i'll refer this disk as s_disk

Note: disk_4 and disk_5 are names reported by OS in vxdisk -e list

"Making Mirror"
1- Create a disk group "mdg" with disk_4 as p_disk
vxdg init mdg p_disk=disk_4

check vxprint output for new DG

vxprint -g mdg 
Output is as follow:
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -


2- Now add second disk in "mdg" as s_disk
vxdg -g mdg adddisk s_disk=disk_5

Verify disk addition in vxprint output:
[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -
dm s_disk       disk_5       -        4099840  -        -        -       -


3- Create a volume in DG "mdg" on disk s_disk named "mvol"
vxassist -g mdg make mvol 4099840 s_disk

Verify volume creation from vxprint output
[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -
dm s_disk       disk_5       -        4099840  -        -        -       -

v  mvol         fsgen        ENABLED  4099840  -        ACTIVE   -       -
pl mvol-01      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd s_disk-01    mvol-01      ENABLED  4099840  0        -        -       -


4- Add mirror to "mvol" on disk p_disk
vxassist -g mdg -b mirror mvol p_disk

Verify status using vxprint as follow:
[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -
dm s_disk       disk_5       -        4099840  -        -        -       -

v  mvol         fsgen        ENABLED  4099840  -        ACTIVE   ATT1    -
pl mvol-01      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd s_disk-01    mvol-01      ENABLED  4099840  0        -        -       -
pl mvol-02      mvol         ENABLED  4099840  -        TEMPRMSD ATT     -
sd p_disk-01    mvol-02      ENABLED  4099840  0        -        -       -



NOTE: "TEMPRMSD" status of mvol-02 states that mirror is in process of sync.

verify sync process from vxtask list
[root@lab1 ~]# vxtask list
TASKID  PTID TYPE/STATE    PCT   PROGRESS
   191     -     ATCOPY/R 23.33% 0/4099840/956416 PLXATT mvol mvol-02 mdg auto-throttled


vxprint output after sync is complete:
[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -
dm s_disk       disk_5       -        4099840  -        -        -       -

v  mvol         fsgen        ENABLED  4099840  -        ACTIVE   -       -
pl mvol-01      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd s_disk-01    mvol-01      ENABLED  4099840  0        -        -       -
pl mvol-02      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd p_disk-01    mvol-02      ENABLED  4099840  0        -        -       -



Removing Mirror

Decide which disk is to remain active - Let's say i want p_disk to remain in DG and remove s_disk (remember we created volume originally on s_disk and then add p_disk for mirror - so logically p_disk is a secondary copy which will be primary after removal of s_disk from DG)

1- Remove mirror copy on disk s_disk
vxassist -g mdg remove mirror mvol '!s_disk'

NOTE: '!s_disk'  --  single quotes have been used since any command starting with ! on linux sometimes refers to some shell keyword and consequently failing of the command.

Verify results from vxprint:
[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -
dm s_disk       disk_5       -        4099840  -        -        -       -

v  mvol         fsgen        ENABLED  4099840  -        ACTIVE   -       -
pl mvol-02      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd p_disk-01    mvol-02      ENABLED  4099840  0        -        -       -


Note: "mvol" is left with just one copy on plex mvol-02 while mvol-01 is removed. although mirror is removed but disk s_disk is still part of DG "mdg".

2- Let's remove s_disk from DG as well.
vxdg -g mdg rmdisk s_disk

Verify results from vxprint:

[root@lab1 ~]# vxprint -g mdg
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg mdg          mdg          -        -        -        -        -       -

dm p_disk       disk_4       -        4099840  -        -        -       -

v  mvol         fsgen        ENABLED  4099840  -        ACTIVE   -       -
pl mvol-02      mvol         ENABLED  4099840  -        ACTIVE   -       -
sd p_disk-01    mvol-02      ENABLED  4099840  0        -        -       -



Good Luck with VERITAS mirroring.

Saturday, December 14, 2013

Where did i go wrong!

Being in IT support business and especially data center support, life is always a rush. While on the way back to home, escaping from the same rush, and feeling bit hot, I just randomly started thinking about the cold days those we used to have round the old house "Angeethi" or furnace in December and January. What a life and peace experience that was.

In fact, now a days we experience cold only for two weeks or so if I compare it with the one in childhood. Suddenly my eyes got blinded with the light emerging from head lights of a fancy car driven by some young chap - lo and behold - suddenly my thoughts emerged like of a taste on tongue of a person experiencing extreme acidity and stomach disorder. In struggle to keep myself at peace, I just started reasoning, why this young chap needed these gloomy head lights for his car? The only reason came to my mind was upcoming fog days, perhaps. By the way, one can find people on road in summer hot days with more bright light than coming out of this car’s head lights.

Believe me it was a revelation telling me if I’ll use these head light for my car, those can make some other driver or passer by blind, I’ll NOT be blessed with fog and peace of childhood. It was the moment of realization, being able to afford 50k budget for my house electricity needs only, doesn't make me eligible to have it. In big canvas I am something odd and this odd outlook is what is forbidden for me (May be in Islam too).

May Allah Bless us all with wisdom to know the reality of these worldly materials and to use them for better.

Tuesday, October 29, 2013

What if i was given the chance to make “prime” decisions about Pakistan – Please not funny!


Don’t judge me – its just a list of things, as i think, can fix Pakistani problems and highlight our features as a nations. Here goes the list

>    Own the religion – by saying this i mean take ownership of every masjid and madrasa from “private” owners and make them “public”.
>    Hurting someone on basis of faith difference – make it a most harsh of crimes and punish it accordingly
>    Define criteria for a person to be speaker in mosque. Punish badly if happens contrary.
>    >Define a strict criteria on basis of education and research, both, specially research for a person to be a preacher (well this is most important of all).
>    Ban all gatherings on the basis of religions – annual gatherings (tableeghi jamat, dawat-e-Islamic, dawah etc). Gathering can be allowed after proper permission and a reason to gather like some procession etc.
>    Ban recitation of all the books like “fazail-e-amal”, “faizan-e-sunnat” etc. in gatherings and push the nation to read more from Quran.
>    Make financial figures of religious institutions public and accountable.
>    Make criteria for being “Molana”, “Hazrat” etc. right now it looks like we say in punjabi “anni riyooriyaaN wandh di paee ay” mean a blind woman is distributing sweets.


Well I'll add more to the list. Mind it – it is an opinion and wish and don’t be offended.

comments are welcome.

Sunday, September 29, 2013

Arranged Vs Love marriage



Arranged Vs Love marriage


I have been discussing this topic in my own teenage / adulthood and used to be very confused. Although there is not much to be confused about it but you know the teenage!. Most prominent feelings of those days used to be “what to do if I fall in love with someone?” Please don’t be judgmental as, it never happened for myself. As life is being squeezed with every mark of year and is evolved too – at last found the answer of few questions. So sharing those answers is agenda of this little writing and may this be a guide to the young ones (although it might not be the case).
I’ll not hook myself with this ongoing debate of
Ø  Being in love and then marriage OR
Ø  Being in love and be married with someone who is chosen by parents OR
Ø  Being in frame of reference where emotions do not matter and one binds himself or herself with the choice of parents OR anything that one can think of.  
One will have to give space and margin to the second party in order to make the relation a success; any relation from friendship to wife/husband. If we consider this a rule of thumb then look at the marriage choices above. The choice that gives maximum chance to this rule – can be a way forward.
Please don’t choose partner on the basis of material. “She is so hot” “damn he is so beautiful and rich” “she got the figures man” could all these typos be a reason/basis of a relation like marriage?
People please consider marriage a sacred relation and do not ruin it because of “fatal illness” called “jawani”. Why I’ll use “illness” for the part of life which is full of joy and energy? It’s because of surroundings and things those affects/directs our decisions and emotions.

Friday, August 16, 2013

Thinking rational and requesting pardon


This Friday on Jumma prayer, it happened – I concentrated the "dua" which Imam sb was requesting to Allah. It was all about our sins that we may have done due to which we are flooded every year. I really didn't find any objection within myself over this philosophy but I thought – our sins might not be the only reason for these earthly disasters. On a closer look, EU and US have these problems too. For instance, I thought of the Japan and its last disaster.
I think, it's our negligence and lack of interest to fix the issue that is playing. On a stronger note, it's our struggle to not to change and to resist every factor that tends to change ourselves. Even this attitude encompasses Godly hints that encourage us to look upon ourselves and make us understand the need to adapt.
Birth of every single child is a clear sign that Allah has accounted for the recent technology changes and social evolution, we are passing through. Children were not so "fast and furious" even a decade back. I am 36 and I see people above 50 years are quite afraid of these latest technology and gadgets, even if they want to learn it.

 

May Allah bless us with right words while praying!

Configure CFS cluster and CFS mount point


Summary:

This LAB was a hands-on for CFS implementation/configuration. CFS cluster will be configured and one mount point will be added.

Prerequisites:

Before you starting configuring VERITAS CFS cluster and start adding new CFS mount point for active-active disk usage; make sure you have:
  1. SF installed with right set of license keys
  2. You have configured VCS on all participant servers (in my case I have two servers guest1 and guest3 with RHEL 5)
  3. You have checked cluster status with "/opt/VRTSvcs/bin/hastatus –summary"
  4. Make sure you virtual IP is accessible
  5. Make sure you have disks presented on cluster participants/nodes. Storage is shared. Just for reference I used iSCSI storage.
  6. Take note of the disks those you have plans to configure in CFS cluster.
  7. Take note of the mount point and volume names.

Cluster Configuration

Following are the steps to configure CFS cluster on both LAB Servers (guest1 and guest3).
  1. Run "/opt/VRTSvxfs/cfs/bin/cfscluster status" to check if CFS is not already configured
    1. "[root@guest3 bin]# /opt/VRTSvxfs/cfs/bin/cfscluster status
    NODE CLUSTER MANAGER STATE CVM STATE
    guest1 running         not-running
    guest3 running         not-running

     
    Error: V-35-41: Cluster not configured for data sharing application
  2. Check cluster status by running "/opt/VRTSvcs/bin/hastatus -summary" and make sure cluster nodes are online.
    1. /opt/VRTSvcs/bin/hastatus –summary
      -- SYSTEM STATE
      -- System State Frozen

       

      A guest1 RUNNING 0
      A guest3 RUNNING 0

       

      -- GROUP STATE
      -- Group System Probed AutoDisabled State

       

      B ClusterService guest1 Y N ONLINE
      B ClusterService guest3 Y N OFFLINE

 

  1. Run "/opt/VRTSvxfs/cfs/bin/cfscluster config" to configure the CFS cluster services (cluster VERITAS volume manager)
    1. Let the configuration complete
  2. Check the CFS cluster services status with "/opt/VRTSvxfs/cfs/bin/cfscluster status"

     

    [root@guest3 bin]# /opt/VRTSvxfs/cfs/bin/cfscluster status


     

    Node         : guest1
    Cluster Manager     : running
    CVM state         : running
    No mount point registered with cluster configuration

     


     

    Node         : guest3
    Cluster Manager     : running
    CVM state         : running
    No mount point registered with cluster configuration
  3. Check which node is master with "vxdctl –c mode"
    [root@guest3 bin]# vxdctl -c mode
    mode: enabled: cluster active - SLAVE
    master: guest1

     

    In my case I am shifting my console to guest1 and will be adding new disks and mount points from there.
    [root@guest1 bin]# vxdctl -c mode
    mode: enabled: cluster active - MASTER
    master: guest1
  4. Check the available disks with "vxdisk list"
  5. Initialize the disk with "/opt/VRTS/bin/vxdisksetup –i disk_2" #in my case its disk_2 that initialize. It could be different from system to system on the bases of SAN.
  6. Verify that disk is initialized with "vxdisk list" – here is expected outcome "disk_2 auto:cdsdisk - - online"
  7. Add new disk group with "vxdg –s init cfsdg disk01=disk_2". Here cfsdg is the name of new disk group with disk_2 added as disk01 and –s is used to make it a shared DG.
  8. Verify the disk group with "vxdg list cfsdg"
  9. Verify the same from "vxprint –hrt output".
    [root@guest1 bin]# vxprint -hrt

    Disk group: cfsdg

     

    DG NAME NCONFIG NLOG MINORS GROUP-ID
    ST NAME STATE DM_CNT SPARE_CNT APPVOL_CNT
    DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
    RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
    RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
    CO NAME CACHEVOL KSTATE STATE
    VT NAME RVG KSTATE STATE NVOLUME
    V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
    SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    DC NAME PARENTVOL LOGVOL
    SP NAME SNAPVOL DCO
    EX NAME ASSOC VC PERMS MODE STATE
    SR NAME KSTATE

     

    dg cfsdg default default 9000 1376650536.16.guest1

     

    dm disk01 disk_2 auto 65536 2017024 -

    Note:
    Veritas volume manager reports available disk space in 512 byte blocks. There we have 2017024 blocks which calculates to about 985MB of space. #Hope math is easy J
  10. Create volume using "vxassist -g cfsdg make cfsvol 984M" and verify volume creation from "vxprint –hrt". Check for the line
    "sd disk01-01 cfsvol-01 disk01 0 2015232 0 disk_2 ENA"
  11. Create file system on new volume using
    "mkfs -t vxfs /dev/vx/rdsk/cfsdg/cfsvol" make sure you use right FStype switch and it varies across UNIX platforms
  12. Make new shared DG part of CFS using
    "/opt/VRTS/bin/cfsdgadm add cfsdg all=sw"
    Disk Group is being added to cluster configuration...
  13. Verify the above with
    [root@guest1 bin]# /opt/VRTS/bin/cfsdgadm display cfsdg

    NODE NAME ACTIVATION MODE
    guest1 sw
    guest3 sw
  14. Next is to add this volumes/filesystems to the cluster configuration so they can be mounted on any or all nodes. Mount points will be automatically created
    [root@guest1 bin]# /opt/VRTS/bin/cfsmntadm add cfsdg cfsvol /cfs all=cluster

    Mount Point is being added...
    /cfs added to the cluster-configuration
  15. Verify the newly added mount point with
    [root@guest1 bin]# /opt/VRTS/bin/cfscluster status


     

    Node : guest1
    Cluster Manager     : running
    CVM state         : running
    MOUNT POINT SHARED VOLUME DISK GROUP STATUS
    /cfs cfsvol cfsdg NOT MOUNTED

     


     

    Node : guest3
    Cluster Manager     : running
    CVM state         : running
    MOUNT POINT SHARED VOLUME DISK GROUP STATUS

    /cfs cfsvol cfsdg NOT MOUNTED
  16. Mount newly added mount point on both cluster nodes using
    [root@guest1 bin]# /opt/VRTS/bin/cfsmount all

    Mounting...
    [/dev/vx/dsk/cfsdg/cfsvol] mounted successfully at /cfs on guest1
    Mounting...
    [/dev/vx/dsk/cfsdg/cfsvol] mounted successfully at /cfs on guest3
  17. Check cfscluster status
    [root@guest1 bin]# /opt/VRTS/bin/cfscluster status

     

    Node : guest1
    Cluster Manager : running
    CVM state : running
    MOUNT POINT SHARED VOLUME DISK GROUP STATUS

    /cfs cfsvol cfsdg MOUNTED


     


     

    Node : guest3
    Cluster Manager : running
    CVM state : running
    MOUNT POINT SHARED VOLUME DISK GROUP STATUS

    /cfs cfsvol cfsdg MOUNTED
  18. Verify local mounts as
    #df –h
    /dev/vx/dsk/cfsdg/cfsvol
    984M 36M 890M 4% /cfs

     


     

    Congratulations! CFS cluster and CFS file system is configured and ready to for Active-Active usage (on both nodes in my case).