Mostrando entradas con la etiqueta storage. Mostrar todas las entradas
Mostrando entradas con la etiqueta storage. Mostrar todas las entradas

jueves, 16 de enero de 2014

Overflow /tmp de 1.0M

Hola! Hoy he visto un tema que me ha parecido suficientemente importante como para escribir este post.
Resulta que un server tenía montado el /tmp como overflow. Viendo un df se ve claro:
root@server:/var/log# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda2      7.5G  2.4G  4.7G  34% /
udev            2.9G  4.0K  2.9G   1% /dev
tmpfs           1.2G  168K  1.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            3.0G     0  3.0G   0% /run/shm
overflow        1.0M  128K  896K  13% /tmp
Y dices... WTF!! Si el fstab no hay nada para el /tmp.

Pues resulta que es un sistema de protección contra quedarse sin espacio. En el caso que llegue a llenarse, se crea un nuevo punto de montaje /tmp en RAM. El tema es que no vuelve al estado original de forma automática.

Cómo tengas un JBOSS o algo que lo use, no vas a poder desmontarlo y habrá que hacer unos cuantos KILLS para poder llegar hacer un umount.

He visto que también se puede hacer:
echo 'MINTMPKB=0' > /etc/default/mountoverflowtmp 
Para desactivarlo definitivamente, pero bueno no se hasta que punto nos puede interesar dejarlo tal y como viene de serie. Que cada uno elija.

Saludos

miércoles, 28 de marzo de 2012

Manual de Supervivencia XenServer y Multipath + iscsi

El Storage como parte fundamental de la mayoría de entornos, hay que tenerlo muy controlado. Para ello la siguiente guía:

Para los que utilizamos multipath en XenServer, hay que tener en cuenta algunos trucos para realizar tareas sobre este daemon.

Como ver los caminos que tenemos configurados:
[root@xenserv ~]# multipath -ll
[size=1.5T][features=1 queue_if_no_path][hwhandler=1 emc][rw]
\_ round-robin 0 [prio=2][active]
 \_ 1:0:0:1 sdc 8:32  [active][ready]
 \_ 3:0:0:1 sdh 8:112 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 2:0:0:1 sde 8:64  [active][ready]
 \_ 4:0:0:1 sdi 8:128 [active][ready]
3600601601a4024006a4f2b3c2635e111 dm-3 DGC,VRAID
[size=500G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
\_ round-robin 0 [prio=1][active]
 \_ 2:0:0:2 sdj 8:144 [active][ready]

Si queremos ver con más detalle el estado actual de multipath:
[root@xenserv ~]# multipath -v3

Hay que tener en cuenta que multipath trabaja con los caminos que le sirve open-iscsi, por lo tanto, un reinicio de open-iscsi, afecta al servicio multipath. 
Si queremos logearnos a nuestra cabina de discos por solo un camino:
[root@xenserv ~]# iscsiadm -m node -l
Por ejemplo:
iscsiadm --mode node --targetname iqn.cabina... --portal 192.168.1.15 --login

Si por el contrario queremos logearnos en todos los caminos:
[root@xenserv ~]# iscsiadm -m node -L all

Si queremos eliminar caminos de multipath e iscsi, hemos de buscar en el directorio /etc/iscsi/nodes
iqn....com.emc:cx.ckm00103200040.a4
iqn....com.emc:cx.ckm00103200040.b4
iqn....com.emc:cx.ckm00103200040.b5

[root@xenserv ~]# rm -fr iqn....emc:cx.ckm00103200040.b5

Volvemos a logearnos a la cabina:
[root@xenserv ~]# iscsiadm -m node -l

Reinciar open-iscsi
[root@xenserv ~]#/etc/init.d/open-iscsi restart

 Reiniciar multipath
[root@xenserv ~]# /etc/init.d/multipath restart

Si solo queremos probar de quitar un camino unicamente "flush", por ejemplo del multipath sin que sea permanente como en el caso anterior, podemos hacerlo mediante:
[root@xenserv ~]# multipath -f sdm

Si queremos hacer este flush para todos los caminos (OJO que se los pule todos!)
[root@xenserv ~]# multipath -F

martes, 15 de marzo de 2011

VMWARE ESX - EMC ALUA

Dejo aquí un link a un blog de vmware donde explica muy bien como configurar el storage desde una cabina EMC para utilizar el tipo de array VMW_SATP_ALUA_CX el cual permite tener los caminos en activo/activo y Round Robin recomendado por EMC.


Lo que he podido ver es que en uno de los clusters ESX 4.0 el cambio no es automático, es decir, cuando en connectivity status desde la cabina, le decimos al host que utilice el failmode ALUA, los ESX no se dan cuenta hasta que se reinician el hosts. Proceso que se puede ir haciendo de uno en uno. 
Pero en otro cluster sí que ha sido automático, posiblemente porqué las máquinas de este cluster fueron atomaticamente registradas en la cabina y en ese momento ya se pusieron en modo ALUA.
Una vez VMWare ve que son ALUA, simplemente hay que configurar Round Robin mediante CLI o desde la consola VSphere.
Otro blog con más información en castellano: http://margotu.wordpress.com/2010/03/13/iscsi-con-vmware-vsphere/

miércoles, 4 de agosto de 2010

Powermt Management

Un pequeño script para escanear las HBAs y descubir los targets que hay asignados

lun_scan.sh



#!/bin/sh
#
#/*******************************************************************
# * This file is part of the Emulex Linux Device Driver for *
# * Fibre Channel Host Bus Adapters. *
# * Copyright (C) 2003-2005 Emulex. All rights reserved. *
# * EMULEX and SLI are trademarks of Emulex. *
# * www.emulex.com *
# * *
# * This program is free software; you can redistribute it and/or *
# * modify it under the terms of version 2 of the GNU General *
# * Public License as published by the Free Software Foundation. *
# * This program is distributed in the hope that it will be useful. *
# * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
# * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
# * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
# * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
# * TO BE LEGALLY INVALID. See the GNU General Public License for *
# * more details, a copy of which can be found in the file COPYING *
# * included with this package. *
# *******************************************************************/
#
# scripts/lun_scan Rev : 1.2
# This script is provided by Emulex to use with its 7.x and 8.x linux device
# drivers for Light Pulse Fibre Channel adapters.
#
# This script performs a scan on either specific lpfc HBAs or on all
# lpfc HBAs. When scanning an HBA, all discovered targets, and all
# luns will be probed.
#
#
# USAGE: The script is invoked with at least 1 argument. The arguments
# specify either the SCSI Host numbers corresponding to the specific
# lpfc HBA that are to be scanned, or the keyword "all" which indicates
# that all lpfc HBAs are to be scanned.
#

VERSION="1.2"
OS_REV=`uname -r | cut -c1-3`

usage()
{
echo ""
echo "Usage: lun_scan [ <#> [<#>] | all ]"
echo " where "
echo " <#> : is a scsi host number of a specific lpfc HBA that is to"
echo " be scanned. More than 1 host number can be specified. "
echo " all : indicates that all lpfc HBAs are to be scanned."
echo ""
echo " Example:"
echo " lun_scan all : Scans all lpfc HBAs"
echo " lun_scan 2 : Scans the lpfc HBA with scsi host number 2"
echo " lun_scan 2 4 : Scans the lpfc HBAs with scsi host number 2 and 4"
echo ""
echo " Warning: Scanning an adapter while performing a tape backup should"
echo " be avoided."
echo ""
}

abort_exit() {
echo ""
echo "Error: Cannot find an lpfc HBA instance with scsi host number : $host"
echo "... Aborting lun_scan."
echo ""
exit 2
}

# Validate argument list
if [ $# -eq 0 -o "$1" = "--help" -o "$1" = "-h" ] ; then
usage
exit 1
fi

# Get list of lpfc HBAs to scan
hosts=$*;

if [ ${OS_REV} = 2.4 ]; then
lowhost=0
ha=`ls /proc/scsi/lpfc/? 2> /dev/null | cut -f5 -d'/'`
hb=`ls /proc/scsi/lpfc/?? 2> /dev/null | cut -f5 -d'/'`
hc=`ls /proc/scsi/lpfc/??? 2> /dev/null | cut -f5 -d'/'`
all_hosts="$ha $hb $hc"
lowhost=`echo $all_hosts | sed "s/ .*//"`
else
all_hosts=`ls -1 -d /sys/bus/pci/drivers/lpfc/*/host* | sed -e "s/.*host//"`
fi

# If all option is used get all the lpfc host numbers.
if [ "$hosts" == "all" ] ; then
hosts="$all_hosts"
fi

if [ ${OS_REV} = 2.4 ]; then

for host in $hosts ; do
# Convert host number to lpfc instance number.
instance=`expr $host - $lowhost`

if [ ! -e /proc/scsi/lpfc/$host ] ; then
abort_exit
fi

echo Scanning lpfc$instance, scsi host number : $host;

max_lun=256

targets=`cat /proc/scsi/lpfc/$host | grep 'lpfc*t*' | cut -f2 -d't' | cut -f1 -d' '`

for target in $targets ; do
# Convert target ID to decimal from Hex format
let "dec_target = 0x$target"
echo " Scanning Target Id $dec_target..."
for ((lun=0; lun<$max_lun; lun++)) ; do echo "scsi add-single-device $host 0 $dec_target $lun" >/proc/scsi/scsi
done
done
done

else

for host in $hosts ; do
if [ ! -e /sys/bus/pci/drivers/lpfc/*/host$host ] ; then
abort_exit
fi

echo Scanning lpfc HBA instance with scsi host number : $host;
echo '- - -' > /sys/class/scsi_host/host$host/scan
done

fi

echo ""
Ejecutamos el script:
lun_scan.sh all

Hacemos que powermt vea la nueva lun

powermt check
powermt config
powermt save

Mostramos lo que ve powermt
powermt display dev=all