Thursday, June 17, 2010

Scsetup - Modifications

#------------------------------------------------------------
# delete a metaset...

# check status
metastat -p -s Kencu1-DG

# remove all soft partitions and concats...
metaclear -s Kencu1-DG d1
metaclear -s Kencu1-DG d2
metaclear -s Kencu1-DG d3
metaclear -s Kencu1-DG d0

# remove all disks from the metaset...
metaset -s Kencu1-DG -d /dev/did/rdsk/d5

# you might have to force it "-f"
metaset -s Kencu1-DG -d -f /dev/did/rdsk/d5

# remove all hosts from diskset
metaset -s Kencu1-DG -d -h test
metaset -s Kencu1-DG -d -h test1
metaset -s Kencu1-DG -d -f -h test2

# check that the diskset no longer exists
metaset
scstat -D

#------------------------------------------------------------
# create a new diskset

# create metaset and mediators
metaset -s new-cu1 -a -h PKEND022 PKEND023
metaset -s new-cu1 -a -m PKEND022 PKENd023

# add disk to the metaset
metaset -s new-cu1 -a /dev/did/rdsk/d5

# check status
metaset -s new-cu1
metadb -s new-cu1
medstat -s new-cu1

# create the first concat
metainit -s new-cu1 d0 1 1 /dev/did/rdsk/d5s0

# create soft partitions (If required In our case its not required )
metainit -s new-cu1 d1 -p d0 100m
metainit -s new-cu1 d2 -p d0 2g
metainit -s new-cu1 d3 -p d0 2g
metainit -s new-cu1 d4 -p d0 1.5g

#------------------------------------------------------------
# create resource group
scrgadm -a -g Kencu1-DG -h PKEND022,PKEND023 -y RG_description="KENCU1-DG"

# create StoragePlus resource
scrgadm -a -j kencu1-hasp-rs -t SUNW.HAStoragePlus -g Kencu1-DG \
-x FileSystemMountPoints=/s1/kencu2/oracle,/s1/kencu2/oradata01,/s1/kencu2/oradata02 \
-x AffinityOn=true

# create logical hostname resource
scrgadm -a -L -g Kencu1-DG -j kencu1-lh-rs -l PKENCU2

# Resource Group commands

# check status of all resource groups/resources
scstat -g

# shutdown a resource group
scswitch -F -g

# start a resource group
scswitch -Z -g

# failover a resource group to another node
scswitch -z -g -h

# restart a resource group
scswitch -R -g -h

# evacuate all resources and resource groups from a node
scswitch -S -h

#------------------------------------------------------------
# Resource commands

# disable a resource and its fault monitor
scswitch -n -j

# enable a resource and its fault monitor
scswitch -e -j

# clear the STOP_FAILED flag of a resource
scswitch -c -j -h -f STOP_FAILED

#------------------------------------------------------------
# Shutdown the ENTIRE cluster
scshutdown

#------------------------------------------------------------
# View properties of Resource Groups/Resources
# Use "-v" to increase verbosity
scrgadm -p -g
scrgadm -p -j


#------------------------------------------------------------
# Add in ipmp tests and maintenance procedures

#------------------------------------------------------------
# Add a new LUN on the fly...

# probe/display all fibre attached devices
cfgadm -al

# look for the WWN numbers given by storage

root@PKEND022 # cfgadm -al
Ap_Id Type Receptacle Occupant Condition
c0 scsi-bus connected configured unknown
c0::dsk/c0t0d0 CD-ROM connected configured unknown
c1 fc-private connected configured unknown
c1::210000008741a927 disk connected configured unknown
c1::2100000087968e21 disk connected configured unknown
c2 fc-fabric connected configured unknown
c2::50060e80042d0a24 disk connected configured unusable
c3 fc-fabric connected unconfigured unknown
c3::50060e80042d0a06 disk connected unconfigured unknown unknown <-- and this one
c4 fc-fabric connected configured unknown
c4::50060e80042d0a34 disk connected configured unusable
c5 fc-fabric connected unconfigured unknown
c5::50060e80042d0a16 disk connected unconfigured unknown
c7 scsi-bus connected unconfigured unknown
c8 scsi-bus connected unconfigured unknown
usb0/1 unknown empty unconfigured ok
usb0/2 unknown empty unconfigured ok
usb0/3 unknown empty unconfigured ok
usb0/4 unknown empty unconfigured ok
root@PKEND022 #


# if it's not already configured then configure the disk
cfgadm -c configure c3::50060e80042d0a06 c5::50060e80042d0a16

# this one shows lun hex id's too!!
cfgadm -al -o show_FCP_dev c3::50060e80042d0a06

# else confirm with...
# format
Searching for disks...done

c6t500060E80000000000009CBB00000484d0: configured with capacity of 96.28GB
c6t500060E80000000000009CBB00000492d0: configured with capacity of 96.28GB


AVAILABLE DISK SELECTIONS:
0. c1t0d0
/ssm@0,0/pci@18,600000/scsi@2/sd@0,0
1. c1t1d0
/ssm@0,0/pci@18,600000/scsi@2/sd@1,0
2. c6t500060E80000000000009CBB0000043Dd0
/scsi_vhci/ssd@g500060e80000000000009cbb0000043d
3. c6t500060E80000000000009CBB00000051d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000051
4. c6t500060E80000000000009CBB00000141d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000141
5. c6t500060E80000000000009CBB00000430d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000430
6. c6t500060E80000000000009CBB00000442d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000442
7. c6t500060E80000000000009CBB00000443d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000443
8. c6t500060E80000000000009CBB00000444d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000444
9. c6t500060E80000000000009CBB00000445d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000445
10. c6t500060E80000000000009CBB00000480d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000480
11. c6t500060E80000000000009CBB00000484d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000484
12. c6t500060E80000000000009CBB00000492d0
/scsi_vhci/ssd@g500060e80000000000009cbb00000492
Specify disk (enter its number):

# the label of the disk should give you an indication of which one you are after (ie 128Gb = OPEN-9*14)

# then confirm your suspicions with...
# luxadm display /dev/rdsk/c6t500060E80000000000009CBB00000492d0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c6t500060E80000000000009CBB00000492d0s2
Vendor: HITACHI
Product ID: OPEN-9*14 -SUN
Revision: 0117
Serial Num: 40123
Unformatted capacity: 103384.352 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x0
Device Type: Disk device
Path(s):

/dev/rdsk/c6t500060E80000000000009CBB00000492d0s2
/devices/scsi_vhci/ssd@g500060e80000000000009cbb00000492:c,raw
Controller /devices/ssm@0,0/pci@18,600000/SUNW,qlc@1/fp@0,0
Device Address 500060e8029cbb08,c <-- check this line
Host controller port WWN 210000e08b0a3bfe
Class primary
State ONLINE

# the Device Address line above should correlate with the WWN and Hex address that
# the Storage boys supply you with.

# create new did instances for these devices on each node
# scdidadm -r
did instance 21 created.
did subpath mulloway:/dev/rdsk/c6t500060E80000000000009CBB00000484d0 created for instance 21.
did instance 22 created.
did subpath mulloway:/dev/rdsk/c6t500060E80000000000009CBB00000492d0 created for instance 22.
root@pkend023:/root
root@pkend022:/root
# scdidadm -r
did subpath /dev/rdsk/c6t500060E80000000000009CBB00000484d0s2 created for instance 21.
did subpath /dev/rdsk/c6t500060E80000000000009CBB00000492d0s2 created for instance 22.
root@pkend022:/root
root@pkend022:/root
# scdidadm -L|grep c6t500060E80000000000009CBB00000484d0
21 manta:/dev/rdsk/c6t500060E80000000000009CBB00000484d0 /dev/did/rdsk/d21
21 mulloway:/dev/rdsk/c6t500060E80000000000009CBB00000484d0 /dev/did/rdsk/d21
21 marlin:/dev/rdsk/c6t500060E80000000000009CBB00000484d0 /dev/did/rdsk/d21
root@pkend022:/root
#

# update the global devices namespace
scgdevs

# if it's a new LUN size you've been given, create a new label in /etc/format.dat.
# These 100Gb ones didn't seem to work using an explicit entry in /etc/format.dat.
# In this case, just add the type manually thru "format".
# Use the Hitachi disk spec manual for values.
# At any rate, label and partition the disks. Make slice 7 20Mb, and add the rest of the disk into
# slice 0.

#------------------------------------------------------------
# Remove a LUN on the fly...
# If you don't know the diskset/device(s) to remove, the storage
# boys will provide you with the WWN and LUN ID
# ie 50060e80042d0a06, LUN x'06'

# Issue a luxadm display using the WWN
# All luns on that port will be displayed.
# Look at the "Device Address" filed to find the right lun.

DEVICE PROPERTIES for disk: 50060e80042d0a06
Vendor: HITACHI
Product ID: OPEN-9 -SUN
Revision: 0119
Serial Num: 40123
Unformatted capacity: 7384.597 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x0
Device Type: Disk device
Path(s):

/dev/rdsk/c6t500060E80000000000009CBB00000444d0s2
/devices/scsi_vhci/ssd@g500060e80000000000009cbb00000444:c,raw
Controller /devices/ssm@0,0/pci@18,600000/SUNW,qlc@1/fp@0,0
Device Address 500060e8029cbb08,6
Host controller port WWN 210000e08b0aa6fd
Class primary
State ONLINE
Controller /devices/ssm@0,0/pci@19,700000/SUNW,qlc@3/fp@0,0
Device Address 500060e8029cbb18,6
Host controller port WWN 210000e08b0e0622
Class primary
State ONLINE

DEVICE PROPERTIES for disk: 500060e8029cbb08
Vendor: HITACHI
Product ID: OPEN-9 -SUN
Revision: 0119
Serial Num: 40123
Unformatted capacity: 7384.597 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x0
Device Type: Disk device
Path(s):

/dev/rdsk/c6t500060E80000000000009CBB00000445d0s2
/devices/scsi_vhci/ssd@g500060e80000000000009cbb00000445:c,raw
Controller /devices/ssm@0,0/pci@18,600000/SUNW,qlc@1/fp@0,0
Device Address 500060e8029cbb08,7
Host controller port WWN 210000e08b0aa6fd
Class primary
State ONLINE
Controller /devices/ssm@0,0/pci@19,700000/SUNW,qlc@3/fp@0,0
Device Address 500060e8029cbb18,7
Host controller port WWN 210000e08b0e0622
Class primary
State ONLINE

# Once you have this info, you have the disk device name like...
/dev/rdsk/c6t500060E80000000000009CBB00000444d0s2

# Use this to find the did device name
scdidadm -L |grep c6t500060E80000000000009CBB00000444d0
4 pkend022:/dev/rdsk/c6t500060E80000000000009CBB00000444d0 /dev/did/rdsk/d4
4 pkend023:/dev/rdsk/c6t500060E80000000000009CBB00000444d0 /dev/did/rdsk/d4
4 pkend024:/dev/rdsk/c6t500060E80000000000009CBB00000444d0 /dev/did/rdsk/d4

scdidadm -L |grep c6t500060E80000000000009CBB00000444d0
9 pkend022:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9
9 pkend023:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9
9 pkend024:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9

# So it's d4 and d9 I want to remove
# Check for their existence in metasets

metaset|grep d9

# If there's any output, you'd better take a close look at the whole output
# to find which metaset it belongs to.
# If it belongs to a metaset, remove all filesystems partitions etc.
# Finally delete the metaset.

# If you have HDS SCSI reserve errors when trying to deallocate the lun...


# Check for SCSI3 reserves using the undocumented utility /usr/cluster/lib/sc/reserve.
# Use either the did or the OS device file.
root@marlin:/usr/cluster/lib/sc
$ ./reserve -c inkeys -z /dev/did/rdsk/d9s2
Reservation keys(3):
0x3f8a0ed500000003
0x3f8a0ed500000001
0x3f8a0ed500000002
root@pkend022:/usr/cluster/lib/sc
$ scdidadm -L|grep d9
9 manta:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9
9 marlin:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9
9 mulloway:/dev/rdsk/c6t500060E80000000000009CBB00000445d0 /dev/did/rdsk/d9
root@pkend023:/usr/cluster/lib/sc
$ ./reserve -c inkeys -z /dev/rdsk/c6t500060E80000000000009CBB00000445d0s2
Reservation keys(3):
0x3f8a0ed500000003
0x3f8a0ed500000001
0x3f8a0ed500000002
root@marlin:/usr/cluster/lib/sc
$




root@marlin:/usr/cluster/lib/sc
$ ./reserve -c scrub -z /dev/rdsk/c6t500060E80000000000009CBB00000445d0s2
Reservation keys currently on disk:
0x3f8a0ed500000003
0x3f8a0ed500000001
0x3f8a0ed500000002
Attempting to remove all keys from the disk...
May 26 17:44:57 marlin last message repeated 1 time
May 26 17:46:44 marlin scsi: WARNING: /scsi_vhci/ssd@g500060e80000000000009cbb00000445 (ssd5):
May 26 17:46:44 marlin Error for Command: Error Level: Informational
Scrubbing complete, use 'reserve -c inkeys -z /dev/rdsk/c6t500060E80000000000009CBB00000445d0s2' to verify success
root@marlin:/usr/cluster/lib/sc
$ May 26 17:46:44 marlin scsi: Requested Block: 0 Error Block: 0
May 26 17:46:44 marlin scsi: Vendor: HITACHI Serial Number: 04009CBB0445
May 26 17:46:44 marlin scsi: Sense Key: Unit Attention
May 26 17:46:44 marlin scsi: ASC: 0x2a (), ASCQ: 0x4, FRU: 0x0

root@marlin:/usr/cluster/lib/sc
$ ./reserve -c inkeys -z /dev/rdsk/c6t500060E80000000000009CBB00000445d0s2
Reservation keys(0):
root@marlin:/usr/cluster/lib/sc

# run devfsadm to remove device files
devfsadm -C -c disk

# clean up the did devices
scdidadm -C


#------------------------------------------------------------
# create a new diskset

# create metaset and mediators
metaset -s ds04 -a -h manta mulloway marlin
metaset -s ds04 -a -m mulloway manta

# add disk to the metaset
metaset -s ds04 -a /dev/did/rdsk/d21 /dev/did/rdsk/d22

# check status
metaset -s ds04
metadb -s ds04
medstat -s ds04

# create the first concat
metainit -s ds04 d0 2 1 /dev/did/rdsk/d21s0 1 /dev/did/rdsk/d22s0

# create soft partitions
root@manta:init.d
# metainit -s ds04 d1 -p d0 10g
d1: Soft Partition is setup
root@manta:init.d
# metainit -s ds04 d2 -p d0 10g
d2: Soft Partition is setup
root@manta:init.d
#

# create default ufs filesystems
newfs /dev/md/ds04/rdsk/d1
newfs /dev/md/ds04/rdsk/d2

# check required filesystem settings using...
# mkfs -m /dev/md/ds04/rdsk/d1
mkfs -F ufs -o nsect=120,ntrack=56,bsize=8192,fragsize=1024,cgsize=16,free=1,rps=166,nbpi=8239,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16 /dev/md/ds04/rdsk/d1 20971520


# create resource group
scrgadm -a -g super1 -h manta,mulloway,marlin -y RG_description="Summit Production"

# create StoragePlus resource
scrgadm -a -j super1-ds04 -t SUNW.HAStoragePlus -g super1 \
-x FileSystemMountPoints=/opt/smt,/opt/oraclest \
-x AffinityOn=true


# create logical hostname resource
scrgadm -a -L -g super1 -j super1-ip -l super1


# create the super1 apache application resource
scrgadm -a -j super1-apache -t EUM.super1 -g super1 -y Resource_dependencies=super1-ds04 -x Eum_admin_dir=/opt/smt/admin/bin

No comments: