Arquivo

Archive for outubro \30\UTC 2014

Virtual SCSI

outubro 30, 2014 Deixe um comentário

Virtual SCSI

VIRTUAL SCSI

Virtual SCSI is based on a client/server relationship. The Virtual I/O Server owns the physical resources and acts as server or, in SCSI terms, target device. The client logical partitions access the virtual SCSI backing storage devices provided by the Virtual I/O Server as clients.

Virtual SCSI server adapters can be created only in Virtual I/O Server. For HMC-managed systems, virtual SCSI adapters are created and assigned to logical partitions using partition profiles.

The vhost SCSI adapter is the same as a normal SCSI adapter. You can have multiple disks assigned to it. Usually one virtual SCSI server adapter mapped to one virtual SCSI client adapter will be configured, mapping backing devices through to individual LPARs. It is possible to map these virtual SCSI server adapters to multiple LPARs, which is useful for creating virtual optical and/or tape devices, allowing removable media devices to be shared between multiple client partitions.

on VIO server:
root@vios1: / # lsdev -Cc adapter
vhost0  Available       Virtual SCSI Server Adapter
vhost1  Available       Virtual SCSI Server Adapter
vhost2  Available       Virtual SCSI Server Adapter

The client partition accesses its assigned disks through a virtual SCSI client adapter. The virtual SCSI client adapter sees the disks, logical volumes or file-backed storage through this virtual adapter as virtual SCSI disk devices.

on VIO client:
root@aix21: / # lsdev -Cc adapter
vscsi0 Available  Virtual SCSI Client Adapter

root@aix21: / # lscfg -vpl hdisk2
hdisk2           U9117.MMA.06B5641-V6-C13-T1-L890000000000  Virtual SCSI Disk Drive

In SCSI terms:
virtual SCSI server adapter: target
virtual SCSI client adapter: initiator
(Analogous to server client model, where client is the initiator.)

Physical disks presented to the Virtual I/O Server can be exported and assigned to a client partition in a number of different ways:
– The entire disk is presented to the client partition.
– The disk is divided into several logical volumes, which can be presented to a single client or multiple different clients.
– With the introduction of Virtual I/O Server 1.5, files can be created on these disks and file-backed storage can be created.
– With the introduction of Virtual I/O Server 2.2 Fixpack 24 Service Pack 1 logical units from a shared storage pool can be created.

The IVM and HMC environments present 2 different interfaces for storage management under different names. Storage Pool interface under IVM is essentially the same as LVM under HMC. (These are used sometimes interchangeably.) So volume group can refer to both volume groups and storage pools, and logical volume can refer to both logical volumes and storage pool backing devices.

Once these virtual SCSI server/client adapter connections have been set up, one or more backing devices (whole disks, logical volumes or files) can be presented using the same virtual SCSI adapter.

When using Live Partition Mobility storage needs to be assigned to the Virtual I/O Servers on the target server.

—————————-

File Backed Virtual SCSI Devices

Virtual I/O Server (VIOS) version 1.5 introduced file-backed virtual SCSI devices. These virtual SCSI devices serve as disks or optical media devices for clients.

In the case of file-backed virtual disks, clients are presented with a file from the VIOS that it accesses as a SCSI disk. With file-backed virtual optical devices, you can store, install and back up media on the VIOS, and make it available to clients.

—————————-

Check VSCSI adapter mapping on client:

root@bb_lpar: / # echo “cvai” | kdb | grep vscsi                             <–cvai is a kdb subcommand
read vscsi_scsi_ptrs OK, ptr = 0xF1000000C01A83C0
vscsi0     0x000007 0x0000000000 0x0                aix-vios1->vhost2        <–shows which vhost is used on which vio server for this client
vscsi1     0x000007 0x0000000000 0x0                aix-vios1->vhost1
vscsi2     0x000007 0x0000000000 0x0                aix-vios2->vhost2

—————————-

Managing VSCSI devices (server-client mapping)

1. HMC -> VIO Server -> DLPAR -> Virtual Adapter (create vscsi adapter, name the client which can use it, then create the same in profile)
(the profile can be updated: configuration -> save current config.)
(in case of an optical device, check out any client partition can connect)
2. HMC -> VIO Client -> DLPAR -> Virtual Adapter (create the same adapter as above, the ids should be mapped, do it in the profile as well)
3. cfgdev (VIO server), cfgmgr (client)                        <–it will bring up vhostX on vio server, vscsiX on client
4. create needed disk assignments:
-using physical disks:
mkvdev -vdev hdisk34 -vadapter vhost0 -dev vclient_disk    <–for easier identification useful to give a name with the -dev flag
rmvdev -vdev <backing dev.>                                <–back. dev can be checked with lsmap -all (here vclient_disk)

-using logical volumes:
mkvg -vg testvg_vios hdisk34                               <–creating vg for lv
lsvg                                                       <–listing a vg
reducevg <vg> <disk>                                       <–deleting a vg

mklv -lv testlv_client testvg_vios 10G                     <–creating lv what will be mapped to client
lsvg -lv <vg>                                              <–lists lvs under a vg
rmlv <lv>                                                  <–removes an lv

mkvdev -vdev testlv_client -vadapter vhost0 -dev <any_name>        <–for easier identification useful to give a name with the -dev flag
(here backing device is an lv (testlv_client)
rmvdev -vdev <back. dev.>                                  <–removes an assignment to the client

-using logical volumes just with storage pool commands:
(vg=sp, lv=bd)

mksp <vgname> <disk>                                       <–creating a vg (sp)
lssp                                                       <–listing stoarge pools (vgs)
chsp -add -sp <sp> PhysicalVolume                          <–adding a disk to the sp (vg)
chsp -rm -sp bb_sp hdisk2                                  <–removing hdisk2 from bb_sp (storage pool)

mkbdsp -bd <lv> -sp <vg> 10G                               <–creates an lv with given size in the sp
lssp -bd -sp <vg>                                          <–lists lvs in the given vg (sp)
rmbdsp -bd <lv> -sp <vg>                                   <–removes an lv from the given vg (sp)

mkvdev…, rmvdev… also apllies

-using file backed storage pool
first a normal (LV) storage pool should be created with: mkvg or mksp, after that:
mksp -fb <fb sp name> -sp <vg> -size 20G                   <–creates a file backed storage pool in the given storage pool with given size
(it wil look like an lv, and a fs will be created automatically as well)
lssp                                                       <–it will show as FBPOOL
chsp -add -sp clientData -size 1G                          <–increase the size of the file storage pool (ClientData) by 1G

mkbdsp -sp fb_testvg -bd fb_bb -vadapter vhost2 10G        <–it will create a file backed device and assigns it to the given vhost
mkbdsp -sp fb_testvg -bd fb_bb1 -vadapter vhost2 -tn balazs 8G <–it will also specify a virt. target device name (-tn)

lssp -bd -sp fb_testvg                                     <–lists the lvs (backing devices) of the given sp
rmbdsp -sp fb_testvg -bd fb_bb1                            <–removes the given lv (bd) from the sp
rmsp <file sp name>                                        <–remove s the given file storage pool

removing it:
rmdev -dev vhost1 -recursive
—————————-

On client partitions, MPIO for virtual SCSI devices currently only support failover mode (which means only one path is active at a time:
root@bb_lpar: / # lsattr -El hdisk0
PCM             PCM/friend/vscsi                 Path Control Module        False
algorithm       fail_over                        Algorithm                  True

Dual VIO VSCSI mapping (multi-pathing):

0. on VIO server: chdev -dev fscsi0 -attr fc_err_recov=fast_fail dyntrk=yes -perm
for checking: lsdev -dev fscsi0 -attr (reboot needed)

1. create VSCSI adapters on vios1 and vios2 and on client
(after that cfgdev and cfgmgr)

2. change reserve policy for disks on vio server to no_reserve:
lsdev -dev hdisk32 -attr
chdev -dev hdisk32 -attr reserve_policy=no_reserve

3. create mapping on vio servers (vios1 and vios2):
mkvdev -vdev hdisk34 -vadapter vhost0 -dev BUD_vg

4. after cfgmgr on client, and lspath will show dualpath:
/root # lspath
Enabled hdisk0 vscsi0
Enabled hdisk0 vscsi1

5. on client set the attributes:

  ON DISK:
-health check, health check mode: (path status updated automatically)
hcheck_mode=noncative    <–heath check commands using those paths which have no active I/O
hcheck_interval=60       <–how often the health check is performed (60 seconds)
(if it is 0, healthchecking is disabled and path will not come back automatically after it is again enabled)

chdev -l hdisk0 -a hcheck_interval=60 -a hcheck_mode=nonactive -P

-queue_depth: (it determines how many request the disk queue to the virtual SCSI client driver)
this value on the client should be matched with the value used for the physical disk on the VIO Server

chdev -l hdisk0 -a queue_depth=20 -P

ON ADAPTER:
path timeout feature on vscsi adapters:(it allows the client to check the health of the VIO Server adapter)
chdev -l vscsi0 -a vscsi_path_to=30 -P
(30 is minimum)

-set error recovery to fast_fail
chdev -l vscsi0 -a vscsi_err_recov=fast_fail -P

———–

SET PATH PRIORITIES:
By default all the paths are defined with priority 1 meaning that traffic will go through the first path.
(Priority 1 is the highest priority, and you can define a priority from 1 to 255)

If you have dual paths the first path is using vscsi0
If you want to control the paths ‘path priority’ has to be updated.
Priority of the VSCSI0 path is changed to 2 so that it becomes a lower priority.
Priority for the VSCSI1 devices remains at 1 so that it is the primary path.

# chpath -l hdisk0 -p vscsi0 -a priority=2
path Changed

 # lspath -AHE -l hdisk0 -p vscsi0
attribute value description user_settable
priority  2     Priority    True

 # lspath -AHE -l hdisk0 -p vscsi1
attribute value description user_settable
priority  1     Priority    True

———–

6. testing:
if vios1 or vios2 is rebooteed (or the backing devce removed (rmvdev)), on the client 1 path will go down:
(because this vios has the higher priority)
# lspath
Enabled hdisk0 vscsi0
Failed  hdisk0 vscsi1

in errpt, there will be an entry:
DE3B8540   0201121211 P H hdisk0         PATH HAS FAILED

 

 

Fonte: https://aixexpert.wordpress.com/aix-virtualization-2/in-virtualisation/

Categorias:AIX

Aix reserve disk policies

outubro 29, 2014 Deixe um comentário

reserve_policy:
chdev -l hdiskX -a reserve_policy=no_reserve
no_reserve: Input/Output can be sent from all the pahts of the MPIO device. This is the default for SDDPCM
For HDLM: Ignores a reservation and does not reserve a LUN (for VIO and RAC this is needed)

exclusive host access: only 1 path can be selected with fail_over. When the active path fails, thealternative path is selected
PR_exclusive: a uniques PR_key is set for this host. Other hosts with different PR_key cannot access.
I/O is routed to all path of the MPIO device, because all paths are registered with the same PR_key.
In a non-concurrent HACMP environment this should be selected.

PR_shared: A PR_key is registered, but it can be accessed by other hosts.
In a concurrent HACMP environment this should be used.
(chdev -l hdiskX -a PR_key_value=0x1234 -a reserve_policy=PR_shared)

The default attribute of reserve_policy of the hdlm driver is PR_exclusive. This is set automatically during cfgmgr to the ODM.
Because of the virtualisation requirements, we have to change it to “no_reserve”.
So the chdev command sets a SCSI reservation(PR_exclusive) to change the attribute.
All LPARs, which are writing exact at this moment to this disk will receive not-recoverable errors (The virtualisation disk outage

Categorias:AIX

Habilitar e desabilitar o Audit no AIX

outubro 29, 2014 Deixe um comentário

Habilitar e desabilitar o Audit no AIX

1 – audit off
2 – audit shutdown
3 – audit on

Caso a opção 1 e 2 não funcione, use o comando #> /audit/trail

e inicie o audit.

Categorias:AIX, AUDIT, Miscelânea

Habilitando e Limpando o PVID do disco

outubro 24, 2014 Deixe um comentário

Para limpar o PVID use o comando
#chdev -l hdisk2 -a pv=clear

Criando o PVID no disco
chdev -l hdisk2 -a pv=yes

Categorias:AIX

Return code do Linux e AIX

outubro 23, 2014 Deixe um comentário

Comando:
# perl -le ‘print $!+0, “\t”, $!++ for 0..127’
0
1 Operation not permitted
2 No such file or directory
3 No such process
4 Interrupted system call
5 Input/output error
6 No such device or address
7 Argument list too long
8 Exec format error
9 Bad file descriptor
10 No child processes
11 Resource temporarily unavailable
12 Cannot allocate memory
13 Permission denied
14 Bad address
15 Block device required
16 Device or resource busy
17 File exists
18 Invalid cross-device link
19 No such device
20 Not a directory
21 Is a directory
22 Invalid argument
23 Too many open files in system
24 Too many open files
25 Inappropriate ioctl for device
26 Text file busy
27 File too large
28 No space left on device
29 Illegal seek
30 Read-only file system
31 Too many links
32 Broken pipe
33 Numerical argument out of domain
34 Numerical result out of range
35 Resource deadlock avoided
36 File name too long
37 No locks available
38 Function not implemented
39 Directory not empty
40 Too many levels of symbolic links
41 Unknown error 41
42 No message of desired type
43 Identifier removed
44 Channel number out of range
45 Level 2 not synchronized
46 Level 3 halted
47 Level 3 reset
48 Link number out of range
49 Protocol driver not attached
50 No CSI structure available
51 Level 2 halted
52 Invalid exchange
53 Invalid request descriptor
54 Exchange full
55 No anode
56 Invalid request code
57 Invalid slot
58 Unknown error 58
59 Bad font file format
60 Device not a stream
61 No data available
62 Timer expired
63 Out of streams resources
64 Machine is not on the network
65 Package not installed
66 Object is remote
67 Link has been severed
68 Advertise error
69 Srmount error
70 Communication error on send
71 Protocol error
72 Multihop attempted
73 RFS specific error
74 Bad message
75 Value too large for defined data type
76 Name not unique on network
77 File descriptor in bad state
78 Remote address changed
79 Can not access a needed shared library
80 Accessing a corrupted shared library
81 .lib section in a.out corrupted
82 Attempting to link in too many shared libraries
83 Cannot exec a shared library directly
84 Invalid or incomplete multibyte or wide character
85 Interrupted system call should be restarted
86 Streams pipe error
87 Too many users
88 Socket operation on non-socket
89 Destination address required
90 Message too long
91 Protocol wrong type for socket
92 Protocol not available
93 Protocol not supported
94 Socket type not supported
95 Operation not supported
96 Protocol family not supported
97 Address family not supported by protocol
98 Address already in use
99 Cannot assign requested address
100 Network is down
101 Network is unreachable
102 Network dropped connection on reset
103 Software caused connection abort
104 Connection reset by peer
105 No buffer space available
106 Transport endpoint is already connected
107 Transport endpoint is not connected
108 Cannot send after transport endpoint shutdown
109 Too many references: cannot splice
110 Connection timed out
111 Connection refused
112 Host is down
113 No route to host
114 Operation already in progress
115 Operation now in progress
116 Stale NFS file handle
117 Structure needs cleaning
118 Not a XENIX named type file
119 No XENIX semaphores available
120 Is a named type file
121 Remote I/O error
122 Disk quota exceeded
123 No medium found
124 Wrong medium type
125 Operation canceled
126 Required key not available
127 Key has expired

AIX:

Comando:
# perl -le ‘print $!+0, “\t”, $!++ for 0..127’
0
1 Not owner
2 No such file or directory
3 No such process
4 Interrupted system call
5 I/O error
6 No such device or address
7 Arg list too long
8 Exec format error
9 Bad file number
10 No child processes
11 Resource temporarily unavailable
12 Not enough space
13 Permission denied
14 Bad address
15 Block device required
16 Device busy
17 File exists
18 Cross-device link
19 No such device
20 Not a directory
21 Is a directory
22 Invalid argument
23 File table overflow
24 Too many open files
25 Not a typewriter
26 Text file busy
27 File too large
28 No space left on device
29 Illegal seek
30 Read-only file system
31 Too many links
32 Broken pipe
33 Argument out of domain
34 Result too large
35 No message of desired type
36 Identifier removed
37 Channel number out of range
38 Level 2 not synchronized
39 Level 3 halted
40 Level 3 reset
41 Link number out of range
42 Protocol driver not attached
43 No CSI structure available
44 Level 2 halted
45 Deadlock condition if locked
46 Device not ready
47 Write-protected media
48 Unformatted or incompatible media
49 No locks available
50 Cannot Establish Connection
51 Connection Down
52 Missing file or filesystem
53 Requests blocked by Administrator
54 Operation would block
55 Operation now in progress
56 Operation already in progress
57 Socket operation on non-socket
58 Destination address required
59 Message too long
60 Protocol wrong type for socket
61 Protocol not available
62 Protocol not supported
63 Socket type not supported
64 Operation not supported on socket
65 Protocol family not supported
66 Addr family not supported by protocol
67 Address already in use
68 Can’t assign requested address
69 Network is down
70 Network is unreachable
71 Network dropped connection on reset
72 Software caused connection abort
73 Connection reset by peer
74 No buffer space available
75 Socket is already connected
76 Socket is not connected
77 Can’t send after socket shutdown
78 Connection timed out
79 Connection refused
80 Host is down
81 No route to host
82 Restart the system call
83 Too many processes
84 Too many users
85 Too many levels of symbolic links
86 File name too long
87 Directory not empty
88 Disk quota exceeded
89 Invalid file system control data detected
90 For future use
91 For future use
92 For future use
93 Item is not local to host
94 For future use
95 For future use
96 For future use
97 For future use
98 For future use
99 For future use
100 For future use
101 For future use
102 For future use
103 For future use
104 For future use
105 For future use
106 For future use
107 For future use
108 For future use
109 Function not implemented
110 Media surface error
111 I/O completed, but needs relocation
112 No attribute found
113 Security Authentication Denied
114 Not a Trusted Program
115 Too many references: can’t splice
116 Invalid wide character
117 Asynchronous I/O cancelled
118 Out of STREAMS resources
119 System call timed out
120 Next message has wrong type
121 Error in protocol
122 No message on stream head read q
123 fd not associated with a stream
124 Unsupported attribute value
125 Multihop is not allowed
126 The server link has been severed
127 Value too large to be stored in data type

Categorias:AIX, LINUX

Comandos HAMCP

outubro 23, 2014 Comentários desligados

PowerHA(HACMP) Commands

Ver informações do Cluster
lssrc -ls clstrmgrES
lssrc -a

listar informações sobre heartbeat
lssrc -ls topsvcs

Listando a topologia do cluster
lssrc -ls topsvcs

How to start cluster daemons (options in that order:
clstrmgr, clsmuxpd, broadcast message, clinfo, cllockd)
clstart -m -s -b -i -l
How to show cluster state and substate (depends on clinfo)
clstat
SNMP-based tool to show cluster state
cldump
Similar to cldump, perl script to show cluster state
cldisp
How to list the local view of the cluster topology
cltopinfo
How to list the local view of the cluster subsystems
clshowsrv -a
How to show all necessary info about HACMP
clshowsrv -v
How to show HACMP version
lslpp -L | grep cluster.es.server.rte

How to verify the HACMP configuration
/usr/es/sbin/cluster/diag/clconfig -v -O

How to list app servers configured including start/stop scripts
cllsserv

How to locate the resource groups and display their status
clRGinfo -v

How to rotate some of the log files
clcycle

A cluster ping program with more arguments
cl_ping

Cluster rsh program that take cluster node names as argument
clrsh

How to find out the name of the local node
get_local_nodename

rHow to check the HACMP ODM
clconfig

How to put online/offline or move resource groups
clRGmove

How to list the resource groups
cllsgrp

How to create a large snapshot of the hacmp configuration
clsnapshotinfo

How to show short resource group information
cllsres

How to list the cluster manager state
lssrc -ls clstrmgrES

Cluster manager states

ST_NOT_CONFIGURED Node never started
ST_INIT Node configured but down – not running
ST_STABLE Node up and running
ST_RP_RUNNING
ST_JOINING
ST_BARRIER
ST_CBARRIER
ST_VOTING
ST_RP_FAILED Node with event error

How to show heartbeat information
lssrc -ls topsvcs

How to check logs related to hacmp
odmget HACMPlogs

How to list all information from topology HACMP
lssrc -ls topsvcs

How to show all info about group
lssrc -ls grpsvcs

How to list the logs
cllistlogs

How to list the resources defined for all resource group
clshowres

How to show resource information by resource group
clshowres -g’RG’

How to show resource information by node
clshowres -n’NODE’

How to locate the resource groups and display status (-s)
clfindres

How to list interface name/interface device name/netmask associated with a specified ip label / ip address of a specific
node
clgetif

Cluster verification utility
clverify

How to list cluster topology information
cllscf

X utility for cluster configuration
xclconfig

X utility for hacmp management
xhacmpm

X utility for cluster status
xclstat

How to force shutdown cluster immediately without releasing resources
lclstop -f -N

How to do graceful shutdown immediately with no takeover
clstop -g -N

How to do graceful shutdown immediately with takeover
clstop -gr -N

How to sync the cluster topology
cldare -t

How to do the mock sync of topology
cldare -t -f

How to sync the cluster resources
cldare -r

How to do the mock sync of resources
cldare -r -f

How to list the name and security level of the cluster
cllsclstr

How to list the info about the cluster nodes
cllsnode
How to list info about node69
cllsnode -i node69

How to list the PVID of the shared hard disk for resource group dataRG
cllsdisk -g dataRG

How to list all cluster networks
cllsnw

How to list the details of network ether1
cllsnw -n ether1

How to show network ip/nonip interface information
cllsif

How to list the details of network adapter node1_service
cllsif -n node1_service

How to list the shared vgs which can be accessed by all nodes
cllsvg

How to list the shared vgs in resource group dbRG
cllsvg -g dbRG

How to list the shared lvs
cllslv

How to list the shared lvs in the resource group dbRG
cllslv -g dbRG

How to list the PVID of disks in the resource group appRG
cllsdisk -g appRG

How to list the shared file systems
cllsfs

How to list the shared file systems in the resource group sapRG
cllsfs -g sapRG

How to show info about all network modules
cllsnim

How to show info about ether network module
cllsnim -n ether

How to list the runtime parameters for the node node1
cllsparam -n node1

How to add a cluster definition with name dcm and id 3
claddclstr -i 3 -n dcm

How to create resource group sapRG with nodes n1,n2 in cascade
claddgrp -g sapRG -r cascading -n n1 n2

Creates an application server ser1 with startscript as /usr/start and stop script as /usr/stop
claddserv -s ser1 -b /usr/start -e /usr/stop

How to change cluster definitions name to dcmds and id to 2
clchclstr -i 2 -n dcmds

How to change the cluster security to enhanced
clchclstr -s enhanced

How to delete the resource group appRG and related resources
clrmgrp -g appRG

How to remove the node node69
clrmnode -n node69

How to remove the adapter named node69_svc
clrmnode -a node69_svc

How to remove all resources from resource group appRG
clrmres -g appRG

How to remove the application server app69
clrmserv app69

How to remove all applicaion servers
clrmserv ALL

How to list the nodes with active cluster manager processes from cluster manager on node node1clgetaddr node1 returns a pingable address from node node1
clgetactivenodes -n node1

How to list the info about resource group sapRG
clgetgrp -g sapRG

How to list the participating nodes in the resource group sapRG
clgetgrp -g sapRG -f nodes

How to get the ip label associated to the resource group
clgetip sapRG

How to list the network for ip 192.168.100.2, netmask 255.255.255.0
clgetnet 192.168.100.2 255.255.255.0

How to list the VG of LV nodelv
clgetvg -l nodelv

How to add node5 to the cluster
clnodename -a node5

How to change the cluster node name node5 to node3
clnodename -o node5 -n node3

Categorias:AIX, HACMP Tags:

Solaris disk events:

outubro 2, 2014 Deixe um comentário

Recoverable errors:
Recoverable errors do not cause data loss, so I report an amber warning state to indicate that a retry was required to get the data. Retries will increase the disk service time.

Predictive failure analysis:
This state is reported back from the disk drive itself; I think it means that the disk has not yet had a problem, but it will have one soon. Therefore, I report a red problem state and tell you to get a new disk before it fails on you.

Device not ready:
The device has gone offline, or perhaps it has died completely. The SCSI bus has become disconnected, or the Fibre Channel laser has died. I report a black state, as the disk is down. Check power and cables then try replacing the disk.

Media error:
The media is the surface of the disk, so a media error is often caused by a head crash or misalignment due to overheating. This is a black state, as a new disk is required.

Illegal request:
An illegal request could be caused by corruption of the command, or by a software bug. I report a black state, but I’m not sure what to do about it.

Categorias:Solaris