Tuesday, October 2, 2018

Solaris 11 - VMtools Install


Installing VMware Tools in a Solaris guest operating system.

1. Download the ISO image and attach to the VM.
2. Login to Solaris VM, copy the vmware-solaris-tools.tar.gz file from /cdrom/vmwaretools to a /var/tmp
3. Extract the contents of the tar file
# tar xzvf vmware-solaris-tools.tar

4. Install the VMware Tools
# cd vmware-tools-distrib
# ./vmware-install.pl

5. Press Enter to accept all of the default values.
6. Reboot the virtual machine for the changes to take effect.
12.Verify VMware tools service is running
# /etc/init.d/vmware-tools status
vmtoolsd is running



root@sopc-sp-v01:~# swap -l
swapfile                 dev            swaplo      blocks        free
/dev/zvol/dsk/rpool/swap 285,1               8     8388600     8388600
root@sopc-sp-v01:~# zfs get all | grep swap
root@sopc-sp-v01:~# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE  SOURCE
rpool/swap  volsize   4G     local
root@sopc-sp-v01:~# zfs set volsize=16G rpool/swap

                                   zoned                            off                                              default
root@sopc-sp-v01:~# swap -l
swapfile                 dev            swaplo      blocks        free
/dev/zvol/dsk/rpool/swap 285,1               8     8388600     8388600
/dev/zvol/dsk/rpool/swap 285,1         8388616    25165816    25165816

root@sopc-sp-v01:/media/VMware Tools# mkdir /var/tmp/VmTools
root@sopc-sp-v01:/media/VMware Tools# cp -r * /var/tmp/VmTools/
root@sopc-sp-v01:/media/VMware Tools# du -sh *
   0K   manifest.txt
  16M   vmware-solaris-tools.tar.gz
root@sopc-sp-v01:/media/VMware Tools# cd /var/tmp/VmTools
root@sopc-sp-v01:/var/tmp/VmTools# ls
manifest.txt                 vmware-solaris-tools.tar.gz
root@sopc-sp-v01:/var/tmp/VmTools# tar -xzvf vmware-solaris-tools.tar.gz
root@sopc-sp-v01:/var/tmp/VmTools# ls
manifest.txt                 vmware-solaris-tools.tar.gz  vmware-tools-distrib
root@sopc-sp-v01:/var/tmp/VmTools# cd vmware-tools-distrib/
root@sopc-sp-v01:/var/tmp/VmTools/vmware-tools-distrib# ls
bin                etc                INSTALL            lib
doc                FILES              installer          vmware-install.pl
root@sopc-sp-v01:/var/tmp/VmTools/vmware-tools-distrib# ./vmware-install.pl
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

INPUT: [/usr/bin]  default

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc]

INPUT: [/etc]  default

What is the directory that contains the init scripts?
[/etc/init.d]

INPUT: [/etc/init.d]  default

In which directory do you want to install the daemon files?
[/usr/sbin]

INPUT: [/usr/sbin]  default

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

INPUT: [/usr/lib/vmware-tools]  default

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

INPUT: [yes]  default

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

INPUT: [/usr/share/doc/vmware-tools]  default

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

INPUT: [yes]  default

The installation of VMware Tools 10.2.5 build-8068406 for Solaris completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

INPUT: [yes]  default

Initializing...


Making sure services for VMware Tools are stopped.

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon:                                         done


The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [no]

INPUT: [no]  default

The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[no]

INPUT: [no]  default

svcprop: Pattern 'application/x11/x11-server' doesn't match any entities
No supported X install found.

Starting VMware Tools services in the virtual machine:
Switching to guest configuration:                                      done
Guest memory manager:                                                  done
Guest operating system daemon:                                         done
The configuration of VMware Tools 10.2.5 build-8068406 for Solaris for this
running kernel completed successfully.

svcprop: Pattern 'application/x11/x11-server' doesn't match any entities
You must restart your X session before any mouse or graphics changes take
effect.

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device
/dev/dsk/c1t0d0s2 ...
root@sopc-sp-v01:/var/tmp/VmTools/vmware-tools-distrib# /etc/init.d/vmware-tools status
vmtoolsd is running
root@sopc-sp-v01:/var/tmp/VmTools/vmware-tools-distrib#

Solaris - Using curl to upload files to oracle

root@spec-mg-p04:~# curl -T /var/tmp/SR-3-12345603751-spec-mg-p04-core-dump.tar -u sam@expanor.local ftps://transport.oracle.com/issue/3-1234567890/

sudo - prompting for password


When using sudo to root, it is asking for password. The reason was it was reading the config file /etc/sudoers.d/svc-system-config-user before reading /etc/sudoers. Emptied the config file and issue was resolved.

# cat /etc/sudoers.d/svc-system-config-user

sam@sopc-sp-v01:~$ sudo su -
Password:

root@sopc-sp-v01:~# visudo
visudo: /etc/sudoers.tmp unchanged
root@sopc-sp-v01:~# truss -f -t open sudo -l
16589:  open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
16589:  open("/lib/libc.so.1", O_RDONLY)                = 3
16589:  open("/usr/lib/sudo/libsudo_util.so.0", O_RDONLY) = 3
16589:  open("/usr/lib/locale/common/methods_unicode.so.3", O_RDONLY) = 3
16589:  open("/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3", O_RDONLY) = 3
16589:  open("/system/volatile/tzsync", O_RDONLY|O_CLOEXEC|O_TPDSAFE) = 3
16589:  open("/usr/share/lib/zoneinfo/localtime", O_RDONLY) = 3
16589:  open64("/dev/tty", O_RDWR)                      = 5
16589:  open("/proc/16589/psinfo", O_RDONLY)            = 5
16589:  open64("/system/volatile/name_service_door", O_RDONLY) = 5
16589:  open("/proc/16589/psinfo", O_RDONLY)            = 6
16589:  open("/lib/libsocket.so.1", O_RDONLY)           = 6
16589:  open("/lib/libnsl.so.1", O_RDONLY)              = 6
16589:  open("/usr/lib/sudo/sudoers.so", O_RDONLY)      = 6
16589:  open("/lib/libmd.so.1", O_RDONLY)               = 6
16589:  open("/lib/libucrypto.so.1", O_RDONLY)          = 6
16589:  open("/etc/system.d/crypto:fips-140", O_RDONLY|O_NONBLOCK) = 6
16589:  open("/usr/lib/security/pkcs11_softtoken.so.1", O_RDONLY) = 6
16589:  open("/lib/libelf.so.1", O_RDONLY)              = 7
16589:  open("/lib/libucrypto.so.1", O_RDONLY)          = 6
16589:  open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/sudoers.mo", O_RDONLY) Err#2 ENOENT
16589:  open64("/etc/nsswitch.conf", O_RDONLY)          = 6
16589:  open64("/etc/sudoers", O_RDONLY)                = 6
16589:  open("/etc/sudoers.d", O_RDONLY|O_NDELAY|O_LARGEFILE|O_CLOEXEC|O_DIRECTORY) = 7
16589:  open64("/etc/sudoers.d/svc-system-config-user", O_RDONLY) = 7
16589:  open("/lib/libpam.so.1", O_RDONLY)              = 7
16589:  open("/etc/pam_debug", O_RDONLY)                Err#2 ENOENT
16589:  open("/dev/conslog", O_WRONLY|O_TPDSAFE)        = 7
User root may run the following commands on sopc-sp-v01:
    (ALL) ALL
root@sopc-sp-v01:~# cat /etc/sudoers
sudoers    sudoers.d/
root@sopc-sp-v01:~# cat /etc/sudoers.d/svc-system-config-user
sam ALL=(ALL) ALL
root@sopc-sp-v01:~#

root@sopc-sp-v01:~# egrep ADMINS /etc/sudoers
# User_Alias    ADMINS = millert, dowdy, mikef
User_Alias ADMINS = janderson, sam, janderson_adm, sam_adm
ADMINS ALL=(ALL) NOPASSWD: ALL
root@sopc-sp-v01:~#

root@sopc-sp-v01:~# vi /etc/sudoers.d/svc-system-config-user
root@sopc-sp-v01:~# cat /etc/sudoers.d/svc-system-config-user
root@sopc-sp-v01:~#
root@sopc-sp-v01:~# logout

Monday, September 10, 2018

Solaris10/11 - Initially takes long time to login to the server

If your server is responsing slow on initial login, check the dns-cashe.

1. Check what version you are running.
# ssh -V

2. Check LookupClientHostnames entry on sshd_config
# grep LookupClientHostnames /etc/ssh/sshd_config
if no value return, add the entry to config file.
# echo “LookupClientHostnames no” >> /etc/ssh/sshd_config

Also check the entry for GSSAPIAuthentication on ssh config file.
# grep -i GSSAPIAuthentication /etc/ssh/sshd_config

if no value returned, add entry,
# echo “GSSAPIAuthentication no” >> /etc/ssh/sshd_config

3. Now, restart the ssh service
# svcs -a | grep ssh
# svcadm restart ssh

or

if this still does give you trouble, restart the dns cache
# svcs -a | grep cache
online         Jul_23   svc:/system/name-service-cache:default
# svcadm restart svc:/system/name-service-cache:default



Thursday, September 6, 2018

Solaris 10 - cron job didn't run at scheduled time.

Solaris 10 - cron job didn't run at scheduled time.

Checking log shows queue max run limit reached

# cat /var/cron/log
......
The problem: queue max limit reached
Solution: Restart the con service

1. Find the cron process
# ps -ef | grep cron
# ptree <PID>
# kill -9 <PID>

2 Restart cron service
# svcadm restart svc:/system/cron

3. raise the limit
# vi /etc/cron.d/queuedefs

if you still have issue, review queuedefs man page.

# more /etc/cron.d/queuedefs
a.4j1n
b.2j2n90w

# man queuedefs

       This file specifies that the a queue, for at jobs, can  have  up  to  4
       jobs  running  simultaneously; those jobs will be run with a nice value
       of 1.  As no nwait value was given, if a job cannot be run because  too
       many  other  jobs  are  running cron will wait 60 seconds before trying
       again to run it.

       The b queue, for batch(1) jobs, can have up to 2 jobs running  simulta-
       neously;  those  jobs  will be run with a nice(1) value of 2.  If a job
       cannot be run because too many other jobs are  running,  cron(1M)  will
       wait  90  seconds  before  trying again to run it. All other queues can
       have up to 100 jobs running simultaneously; they will  be  run  with  a
       nice value of 2, and if a job cannot be run because too many other jobs
       are running cron will wait 60 seconds before trying again to run it.

Solaris 11 - zfs - Resolving a Removed LUN from the solaris 11 server


zfs - Resolving a Removed LUN from the solaris 11 system.

SAN team accidently removed active used LUN and the pool went to suspended mode. We have to present the same LUN to the same host in order to fix the issue.

The guy presented the same LUN back to the host.

root@srdf-mg-p1:~# echo | format | grep -i 0419
      34. c3t6000D310006D64000000000000000419d0 <COMPELNT-Compellent Vol-0607-350.00GB>
          /scsi_vhci/ssd@g6000d310006d64000000000000000419


root@srdf-mg-p1:~# zpool export srdfmgp05-datacopy
cannot export 'srdfmgp05-datacopy': pool I/O is currently suspended
root@srdf-mg-p1:~# zpool status srdfmgp05-datacopy
  pool: srdfmgp05-datacopy
 state: SUSPENDED
status: One or more devices are unavailable in response to IO failures.
        The pool is suspended.
action: Make sure the affected devices are connected, then run 'zpool clear' or
        'fmadm repaired'.
        Run 'zpool status -v' to see device specific details.
   see: http://support.oracle.com/msg/ZFS-8000-HC
  scan: none requested
config:

        NAME                                     STATE     READ WRITE CKSUM
        srdfmgp05-datacopy                       SUSPENDED     2     0     0
          c3t6000D310006D64000000000000000419d0  ONLINE       0     0     0


root@srdf-mg-p1:~# fmadm faulty
--------------- ------------------------------------  -------------- ---------
TIME            EVENT-ID                              MSG-ID         SEVERITY
--------------- ------------------------------------  -------------- ---------
Aug 28 11:54:35 8728f18f-ec4f-4e65-bd0e-cd8dab33617d  ZFS-8000-8A    Critical

Problem Status    : open
Diag Engine       : zfs-diagnosis / 1.0
System
    Manufacturer  : Oracle Corporation
    Name          : SPARC T7-1
    Part_Number   : 34863714+1+1
    Serial_Number : AK00397012
    Host_ID       : 86c0ac2a
    Server_Name           : srdf-mg-p1

----------------------------------------
Suspect 1 of 1 :
   Problem class : fault.fs.zfs.object.corrupt_data
   Certainty   : 100%
   Affects     : zfs://pool=d2cd89a0a10856b8/pool_name=srdfmgp05-datacopy
   Status      : faulted and taken out of service

   FRU
     Status           : faulty
     FMRI             : "zfs://pool=d2cd89a0a10856b8/pool_name=srdfmgp05-datacopy"

Description : A file or directory in pool 'srdfmgp05-datacopy' could not be
              read due to corrupt data.

Response    : No automated response will occur.

Impact      : The file or directory is unavailable.

Action      : Use 'fmadm faulty' to provide a more detailed view of this event.
              Run 'zpool status -xv' and examine the list of damaged files to
              determine what has been affected. Please refer to the associated
              reference document at http://support.oracle.com/msg/ZFS-8000-8A
              for the latest service procedures and policies regarding this
              diagnosis.

--------------- ------------------------------------  -------------- ---------
TIME            EVENT-ID                              MSG-ID         SEVERITY
--------------- ------------------------------------  -------------- ---------
Aug 28 11:54:35 3cd0778a-78dc-499d-a5f1-98c3dac9c7a4  ZFS-8000-HC    Major

Problem Status    : open
Diag Engine       : zfs-diagnosis / 1.0
System
    Manufacturer  : Oracle Corporation
    Name          : SPARC T7-1
    Part_Number   : 34863714+1+1
    Serial_Number : AK00397012
    Host_ID       : 86c0ac2a
    Server_Name           : srdf-mg-p1

----------------------------------------
Suspect 1 of 1 :
   Problem class : fault.fs.zfs.io_failure_wait
   Certainty   : 100%
   Affects     : zfs://pool=d2cd89a0a10856b8/pool_name=srdfmgp05-datacopy
   Status      : faulted and taken out of service

   FRU
     Status           : faulty
     FMRI             : "zfs://pool=d2cd89a0a10856b8/pool_name=srdfmgp05-datacopy"

Description : ZFS pool 'srdfmgp05-datacopy' has experienced currently
              unrecoverable I/O failures.

Response    : No automated response will occur.

Impact      : Read and write I/Os cannot be serviced.

Action      : Use 'fmadm faulty' to provide a more detailed view of this event.
              Make sure the affected devices are connected, then run 'zpool
              clear'. Please refer to the associated reference document at
              http://support.oracle.com/msg/ZFS-8000-HC for the latest service
              procedures and policies regarding this diagnosis.



root@srdf-mg-p1:~# zpool list
NAME                 SIZE  ALLOC   FREE  CAP  DEDUP     HEALTH  ALTROOT
rpool                556G   159G   397G  28%  1.00x     ONLINE  -
srdfmgp01-csf       99.5G  23.9G  75.6G  24%  1.00x     ONLINE  -
srdfmgp05-data       199G   165G  34.4G  82%  1.00x     ONLINE  -
srdfmgp05-datacopy   348G  75.1G   273G  21%  1.00x  SUSPENDED  -
root@srdf-mg-p1:~# zpool clear srdfmgp05-datacopy
root@srdf-mg-p1:~# zpool list
NAME                 SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool                556G   159G   397G  28%  1.00x  ONLINE  -
srdfmgp01-csf       99.5G  23.9G  75.6G  24%  1.00x  ONLINE  -
srdfmgp05-data       199G   165G  34.4G  82%  1.00x  ONLINE  -
srdfmgp05-datacopy   348G  75.1G   273G  21%  1.00x  ONLINE  -
root@srdf-mg-p1:~#
root@srdf-mg-p1:/datacopy# df -h /datacopy
Filesystem             Size   Used  Available Capacity  Mounted on
srdf-mg-p1-datacopy/FS_DATACOPY           343G    75G       267G    22%    /datacopy

root@srdf-mg-p1:~# cd /datacopy/
root@srdf-mg-p1:/datacopy# ls
12.1.0_clnp.tar  PROD


Tuesday, July 10, 2018

RHEL7 - Login to rescue mode


VMware and ISO image
- Assign ISO image to your VM the way you install new OS using VM.
Note: you need to have ISO image loaded to datastore or somewhere VM can access.

Booting from CD/ISO on rhel7
- Boot from cd and on selection menu,
- Select Troubleshooting
- Then Rescue
- Then Skip when prompted
- and run at the prompt,
# xfs_repair /dev/sda1