Arquivo para agosto, 2007

truss

Ele faz um mapeamento das chamadas de sistema.
Um exemplo de aplicação dele.

Um NFS que não responde no df -k.
Precisa identificar NFS, pois o df -k não retorna.
Desta forma fazemos via truss

Exemplo do DNS não respondendo


[kairosrv:root:/:] df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 131072 28872 78% 3378 33% /
/dev/hd2 3538944 1071200 70% 51963 17% /usr
/dev/hd9var 131072 88040 33% 659 4% /var
/dev/hd3 524288 368164 30% 607 1% /tmp
/dev/hd1 131072 123764 6% 332 2% /home
/proc - - - - - /proc
/dev/hd10opt 131072 76928 42% 2343 12% /opt

… neste ponto ele ficava congelado …

Suponhamos que eu não sei qual o FS em NFS utlizado.
Eu utilizo o truss para fazer um mapeamento:


[kairosrv:root:/:] truss df -k
execve("/usr/bin/df", 0x2FF22D48, 0x2FF22D54) argc: 2
sbrk(0x00000000) = 0x20000C58
vmgetinfo(0x2FF21EF0, 7, 16) = 0
sbrk(0x00000000) = 0x20000C58
sbrk(0x00000008) = 0x20000C58
__libc_sbrk(0x00000000) = 0x20000C60
getuidx(4) = 0
.
.
.
statfs64("/nimsrv/images", 0x2FF21AD0) (sleeping...)

Desta forma eu sei qual está congelado e posso força-lo

[kairosrv:root:/:] umount -f /nimsrv/images
forced unmount of /nimsrv/images

Anúncios

Para evitar problemas de duplicate pv id no Linux no momento de criar Volume Group (VG) com os Phisical Volumes (PV) coloque no /etc/lvm/lvm.conf no filter a seguinte sequência.

Accept para os discos locais
Accept para todos os vpaths que venham surgir
Reject para os demais tipos de volume

Exemplo:
filter = [ "a/sda.*/", "a/vpath.*/", "r/.*/" ]
Altere também  o parametro types, deixando assim:

Exemplo:
types = [ "vpath", 16 ]

Contexto

Ambiente possuí VMWare GSX rodando sobre Red Hat

Pré-requesitos

1. Instalar Kernel novo;
2. Instalar kernel-devel (RHEL 4) ou kernel-source (RHEL 3);
3. Backup do /etc/vmware que contem license code;
4. Guardar o serial para utilização.

Procedimento

1. Rodar reconfigure do vmware (vmware-config.pl)

Na prática

Pré-requesitos

1. Instalar Kernel novo:

[kairo@kairoserver /tmp]# rpm -ivh kernel-smp-2.4.21-50.EL.i686.rpm
Preparing... ########################################### [100%]
1:kernel-smp ########################################### [100%]
[kairo@kairoserver /tmp]#

2. Instalar kernel-devel (RHEL 4) ou kernel-source (RHEL 3):

[kairo@kairoserver /tmp]# rpm -ivh kernel-source-2.4.21-50.EL.i386.rpm
warning: kernel-source-2.4.21-50.EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:kernel-source ########################################### [100%]
[kairo@kairoserver /tmp]#

3. Backup do /etc/vmware que contem license code.

[kairo@kairoserver /tmp]# cp -r /etc/vmware ~kairoa
[kairo@kairoserver /tmp]#

4. Guardar o serial para utilização.

[kairo@kairoserver /tmp]# grep Serial ~kairoa/vmware/license.gsx.3.0-20
Serial = "YYYYY-YYYYY-YYYYY-YYYYY"

Procedimento

1. Rodar reconfigure do vmware (vmware-config.pl)

Com excessão da pergunta sobre o Serial Number, todas as respostas são default.
Quando ele questionar se deseja inserir o Serial, coloque Yes e entre com o Serial que pegou no pré-requesito.

[kairo@kairoserver /tmp]# vmware-config.pl
Making sure services for VMware GSX Server are stopped.
Stopping VMware services:
Virtual machine monitor [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
DHCP server on /dev/vmnet8 [ OK ]
NAT service on /dev/vmnet8 [ OK ]
Host-only networking on /dev/vmnet8 [ OK ]
Virtual ethernet [ OK ]
Trying to find a suitable vmmon module for your running kernel.None of the pre-built vmmon modules for VMware GSX Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes] yes
Using compiler "/usr/bin/gcc". Use environment variable CC to override.What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux-2.4.21-47.EL/include]
Extracting the sources of the vmmon module.

Building the vmmon module.

Using standalone build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make[1]: Entering directory `/tmp/vmware-config0/vmmon-only'
make[2]: Entering directory `/tmp/vmware-config0/vmmon-only/driver-2.4.21-47.ELsmp'
make[2]: Leaving directory `/tmp/vmware-config0/vmmon-only/driver-2.4.21-47.ELsmp'
make[2]: Entering directory `/tmp/vmware-config0/vmmon-only/driver-2.4.21-47.ELsmp'
make[2]: Leaving directory `/tmp/vmware-config0/vmmon-only/driver-2.4.21-47.ELsmp'
make[1]: Leaving directory `/tmp/vmware-config0/vmmon-only'
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
The module loads perfectly in the running kernel.

Extracting the sources of the vmnet module.

Building the vmnet module.

Using standalone build system.
make: Entering directory `/tmp/vmware-config0/vmnet-only'
make: Leaving directory `/tmp/vmware-config0/vmnet-only'
The module loads perfectly in the running kernel.

You have already setup networking.

Would you like to skip networking setup and keep your old settings as they are?
(yes/no) [yes]

Please specify a port for remote console connections to use [902]

Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
Configuring the VMware VmPerl Scripting API.

Building the VMware VmPerl Scripting API.

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

Installing the VMware VmPerl Scripting API.

The installation of the VMware VmPerl Scripting API succeeded.

Do you want this program to set up permissions for your registered virtual
machines? This will be done by setting new permissions on all files found in
the "/etc/vmware/vm-list" file. [no]

Generating SSL Server Certificate

In which directory do you want to keep your virtual machine files?
[/vmware/VMs]

Do you want to enter a serial number now? (yes/no/help) [no] yes

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel: YYYYY-YYYYY-YYYYY-YYYYY

VMware GSX Server Information:
Register your version of VMware GSX Server!
Registering will provide you with:
. Latest information and announcements about
VMware, Inc. products and services
. Activation of support and subscription services you have purchased
. New VMware GSX Server release notifications and security updates
To register your version of VMware GSX Server,
start it, go to the Help menu and choose
the "VMware on the Web" > "Register Now!" option.
Alternatively, you can visit our Web site at:
"http://www.vmware.com/info?id=5".

Press "Enter" to continue...

Starting VMware services:
Virtual machine monitor [ OK ]
Virtual ethernet [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
Host-only networking on /dev/vmnet8 (background) [ OK ]
NAT service on /dev/vmnet8 [ OK ]
Starting VMware virtual machines... [ OK ]

The configuration of VMware GSX Server 3.2.1 build-19281 for Linux for this
running kernel completed successfully.