vendredi 8 avril 2011

TRUE COPY avec PowerHA sur AIX en NPIV

En cours de rédaction 


True copy on AIX with NPIV :

  • Installation CCI + HACMP XD + option TC (j'ai été obligé de creer un fichier bidon pour l'install)
  • Le VG partagé doit etre en mode normal, et non en concurrent (c'est logique, mais il est important de le configurer tel quel)
  •  Une coupure entre les 2 sites, entraine une bascule des données sur le second site, alors meme que le premier continue la production. Il est impossible pour le cluster de faire la difference. Il est alors de la responsibilité de l'admin de repositionner la paire correctement (P-VOL / S-VOL). 
  • La ressource TC est configurée en AUTO, je n'ai pas trouvé d'autre moyen de la faire basculer lors d'une coupure de serveur.


testPSI1 :

/etc/horcm0.conf
HORCM_MON
#ip_address        service         poll(10ms)     timeout(10ms)
192.168.1.1     horcm0             1000            3000


HORCM_CMD
#UnitID 0 (LDEV# * Serial# 60011)
# \\.\CMD-numerodela baie- hdisk
#
\\.\CMD-18345:/dev/rhdisk7



HORCM_LDEV
#dev_group        dev_name        serial#          CU:LDEV(LDEV#)        MU#
testPSI1_TC       dev_C007           18345                C0:07

#test2_shadow      disk1           CL4-G                0          28         0
#

HORCM_INST
#dev_group        ip_address      service
testPSI1_TC       192.168.1.2         horcm0

testPSI2 :

/etc/horcm0.conf

HORCM_MON
#ip_address        service         poll(10ms)     timeout(10ms)
192.1687.1.2             horcm0          1000              3000


HORCM_CMD
#UnitID 0 (LDEV# * Serial# 60011)
# \\.\CMD-numerodela baie- CU lDEV en decimal
#
\\.\CMD-29511:/dev/rhdisk6



HORCM_LDEV
#dev_group        dev_name        serial#          CU:LDEV(LDEV#)        MU#
testPSI1_TC       dev_C007           29511                C0:07

#test2_shadow      disk1           CL4-G                0          28         0
#

HORCM_INST
#dev_group        ip_address      service
testPSI1_TC       192.168.1.2         horcm0


sur les 2 serveurs , dans /etc/services

horcm0   66666/udp


sur testPSI1 :

/opt/CCI/HORCM/usr/bin/horcmstart.sh 0

sur testPSI2 :

/opt/CCI/HORCM/usr/bin/horcmstart.sh 0

sur testPSI1 :


/opt/CCI/HORCM/usr/bin/pairdisplay -ITC0 -g testPSI1_TC -fcx

Group   PairVol(L/R) (Port#,TID, LU),Seq#,LDEV#.P/S,Status,Fence,   %,P-LDEV# M
testPSI1_TC     dev_C007(L) (CL7-K-1, 0,   5)18345  c007.P-VOL PAIR NEVER ,  100  c007 -
testPSI1_TC     dev_C007(R) (CL3-F-1, 0,   5)29511  c007.S-VOL PAIR NEVER ,  100  c007 –


lsdev -C -c disk | grep hdisk | /opt/CCI/HORCM/usr/bin/inqraid -CLI $PHY
DEVICE_FILE     PORT    SERIAL  LDEV CTG  H/M/12  SSID R:Group PRODUCT_ID
hdisk0          -            -     -   -       -     -       - VDASD
hdisk1          -            -     -   -       -     -       - VDASD
hdisk2          -            -     -   -       -     -       - VDASD
hdisk3          -            -     -   -       -     -       - VDASD
hdisk4          -            -     -   -       -     -       - VDASD
hdisk5          -            -     -   -       -     -       - VDASD
hdisk6          -            -     -   -       -     -       - VDASD
hdisk7          CL7-K    78787 49171   -       -  A3C0 A:00050 OPEN-V-CM
hdisk8          CL7-K    78787 49159   -  P/s/ss  A3C0 A:00050 OPEN-V

paircreate -ITC0 -g testPSI1_TC -d dev_34566 -vl -f never
pairdisplay -ITC0 -g testPSI1_TC -fe
pairsplit -ITC0 -g testPSI1_TC  -S (les 2 disques passent en simplex)


root:/root# pairdisplay -ITC0 -g testPSI1_TC -fcx
Group   PairVol(L/R) (Port#,TID, LU),Seq#,LDEV#.P/S,Status,Fence,   %,P-LDEV# M
testPSI1_TC     dev_34566(L) (CL1-J-1, 0,   7)55555  8706.P-VOL PSUE NEVER ,   99  8706 -
testPSI1_TC     dev_34566(R) (CL4-P-2, 0,   7)66666  8706.S-VOL PAIR NEVER ,  100  8706 -
root:/root# pairresync -ITC0 -g testPSI1_TC
root:/root# pairdisplay -ITC0 -g testPSI1_TC -fcx
Group   PairVol(L/R) (Port#,TID, LU),Seq#,LDEV#.P/S,Status,Fence,   %,P-LDEV# M
testPSI1_TC     dev_34566(L) (CL1-J-1, 0,   7)55555  8706.P-VOL COPY NEVER ,   99  8706 -
testPSI1_TC     dev_34566(R) (CL4-P-2, 0,   7)66666  8706.S-VOL COPY NEVER ,-----  8706 -
root:/root# pairdisplay -ITC0 -g testPSI1_TC -fcx
Group   PairVol(L/R) (Port#,TID, LU),Seq#,LDEV#.P/S,Status,Fence,   %,P-LDEV# M
testPSI1_TC     dev_34566(L) (CL1-J-1, 0,   7)55555  8706.P-VOL PAIR NEVER ,  100  8706 -
testPSI1_TC     dev_34566(R) (CL4-P-2, 0,   7)66666  8706.S-VOL PAIR NEVER ,  100  8706 -




mardi 22 mars 2011

Définir NPIV sur une partition

Sur la partition virtuelle : définir une patte FIBRE CHANNEL adapter  (avec le meme slot comme pour un scsi adapter)
Il faut installer le mpio/hdlm dans la partition et non plus dans le vio server.

Pour connaitre le wwn : manage profiles -> edit -> FC adapter -> properties

Dans le vio server :

vfcmap -vadapter vfhost0 -fcp fcs0  => pour activer npiv sur fcs0

lsmap -all -npiv
lsnports (pour montrer les ports pgysiques qui supportent NPIV)

ATTENTION : le wwn est regeneré a chaque fois que le VFC est créé. Il faut donc sauvegarder précieusement les profiles.

D'autre part, il ne faut ABSOLUMENT pas mettre les wwn des cartes 8go elles memes dans le zoning, mais bien le wwn généré dans  le profile de la partition.

Il semblerait, non testé, que si le profile de la partition est détruit, on perde le wwn, et du coup, les disques ne sont plus zonés correctement. Il faut donc sauvegarder rigoureusement tous les profiles (partition et Vioserver) dès la moindre modification.

Useful NPIV commands

 vfcmap -vadapter vfchostN -fcp fcsX

►  maps the virtual FC to the physical FC port

 vfcmap -vadapter vfchostN -fcp

►  un-maps the virtual FC from the physical FC port

 lsmap –all –npiv

►  shows the mapping of virtual and physical adapters and current status

 lsmap  –npiv –vadapter vfchostN

►shows same ofr one VFC

 lsdev -dev vfchost*

►  lists all available virtual Fibre Channel server adapters

 lsdev -dev fcs*

►  lists all available physical Fibre Channel server adapters

 lsdev –dev fcs*  -vpd

►  shows all physical FC adapter properties 

 lsnports

►  shows the Fibre Channel adapter NPIV readiness of the adapter and the SAN
switch.

 lscfg -vl fcsx

►  In AIX client lpar, shows virtual fibre channel properties

jeudi 17 février 2011

Booter sur un spot en mode debug

Passer le spot en mode debug :
nim -Fo check -a debug=yes spot_53_tl8

parametrer nim pour booter le serveur en mode maintenance :
nim -o maint_boot -a spot=spot_53_tl8 monserveur

booter le serveur en mode SMS et le faire booter en réseau sur l'adresse du serveur nim
Aller sur la console :
 (le serveur doit avoir booté en mode debug)

et taper :

mw enter_dbg
>42
>.
>g

... la suite est explicite...


Pour rebasculer le spot en mode normal :   nim -Fo check spot_53_tl8
Power on rapide d'une partition en ligne de commande :

Lister les Pseries :
lssyscfg -r sys -F name

Lister les partitions d'un pseries :
lssyscfg -m Nomdemonpseries -r lpar

Lister les caracteristiques d'une partition précise :
lssyscfg -m Nomdemonpseries -r lpar --filter "lpar_names=nomdemalpar"

Power on de la partition :
chsysstate -r lpar -m Nomdemonpseries -o on -n nomdemalpar  -f profile_du_profile_nomdemalpar -b normal

Ouverture d'un terminal : 
mkvterm -m Nomdemonpseries -p nomdemalpar

jeudi 13 janvier 2011

Changing queue depth in the ODM


Prendre un disque USPV :


lsdev -Ccdisk
...
hdisk6  Available 04-01-02 Hitachi MPIO Disk USP V (Fibre)
...


reperer le type d'un disque :

odmget -q name=hdisk6 CuDv
CuDv:
        name = "hdisk6"
        status = 1
        chgstatus = 2
        ddins = "scsidisk"
        location = "04-01-02"
        parent = "fscsi1"
        connwhere = "W_1"
        PdDvLn = "disk/fcp/htcuspvmpio"


récuperer l'objet odm correspondant :

odmget -q "uniquetype=disk/fcp/htcuspvmpio and attribute=queue_depth" PdAt

PdAt:
        uniquetype = "disk/fcp/htcuspvmpio"
        attribute = "queue_depth"
        deflt = "2"
        values = "1-32,1"
        width = ""
        type = "R"
        generic = "UD"
        rep = "nr"
        nls_index = 30

Pour récupérer l'odm :

odmget -q "uniquetype=disk/fcp/htcuspvmpio  and attribute=queue_depth" PdAt |sed s/deflt\ =\ \"2\"/deflt\ =\ \"XX\"/g > /tmp/change_qd

Pour le changer


odmchange -o PdAt -q "uniquetype=disk/fcp/htcuspvmpio and attribute=queue_depth" /tmp/change_qd

jeudi 21 octobre 2010

Save current profiles via command line on the HMC

to save and make it the default profile :

for i in $(lssyscfg -r lpar -m P570 -F name);
 do
    echo $i
    mksyscfg -r prof -m P570 -o save -p $i  -n ${i}_A_JOUR_AU_211010  
    chsyscfg -r lpar -m P570 -i "name=$i,default_profile=${i}_A_JOUR_AU_211010"
 done


to validate :

lssyscfg -r lpar  -m P570 -F name,default_profile

mercredi 20 octobre 2010

Vio commands : list VTD/vsa on same line :

lsmap -all -field vtd backing -fmt :

vhost4:hdisk55:hdisk11
vhost5:hdisk53:hdisk54:hdisk12
vhost6:hdisk58:hdisk59:hdisk60:hdisk61:hdisk62:hdisk63:hdisk64:hdisk65:hdisk66:hdisk13

lsmap -all -field vtd svsa -fmt :

vhost0:dapart1d1:dapart1d2:dapart1r1
vhost1:dapart2d1:dapart2r1
vhost2:dapart3d1:dapart3d2:dapart3d3:dapart3r1

For virtual SCSI (default), the following fields are supported:
svsa
Server virtual adapter.
physloc
The physical location code of the server virtual adapter.
clientid
Client partition ID.
vtd
Virtual target device.
lun
Logical unit number.
backing
Backing device.
bdphysloc
The physical location code of the backing device.
status
Virtual target device status


useful for shells

MERCI  CHRISTOPHE !

jeudi 16 septembre 2010

mardi 14 septembre 2010

mksysb on one copy

If you have a system mirrored on two or three disks, and you want to restore it on a single disk system :
first create the image.data :
mkszfile
edit image.data to remove all hdisk1 and hdisk2 occurences


vi /image.data

VG_SOURCE_DISK_LIST= hdisk0 hdisk1
...
LV_SOURCE_DISK_LIST= hdisk0 hdisk1
in each lv step, you must have copie=1

divide all PP per 2 or 3 (depends on the original copy number)  "PP= XX" ( PP number must be LV numbers)
Do a mksysb with
Generate new /image.data file? à NO
Disable software packing of backup? à YES <= there is a bug in aix 5.2 which prevent reinstall sometimes, when packing is done...