This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Monday, November 27, 2017

Integrated Lights Out Manager ILOM Command line Linvirtshell

Monday, November 27, 2017 0

Integrated Lights Out Manager ILOM Command line

Login with ILOM root password
[root@testserver ~]# ssh test-ilom.example.com
Oracle(R) Integrated Lights Out Manager
Version 3.2.8.25 r114493
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
Warning: HTTPS certificate is set to factory default.
Hostname: test-ilom

Below targets are available to check in console. Once you run ls command, will get the property information of hardware. In that property we can get ILOM IP address, MAC ID, Server Model, Serial No & Operating system detail as well.

-> ls

 /System
    Targets:
        Open_Problems (0)
        Processors
        Memory
        Power
        Cooling
        Storage
        Networking
        PCI_Devices
        Firmware
        BIOS
        Log
    Properties:
        health = OK
        health_details = -
        open_problems_count = 0
        type = Rack Mount
        system_fw_version = 3.2.8.25
        locator_indicator = Off
        power_state = On
        actual_power_consumption = 305 watts
        action = (none)

a. To check power supply status
-> cd /System/power
/System/Power

-> show

 /System/Power
    Targets:
        Power_Supplies

    Properties:
        health = OK
        health_details = -
        actual_power_consumption = 383 watts
        max_permitted_power = 788 watts
        installed_power_supplies = 2
        max_power_supplies = 2

->
Login as root & run ipmitool command.
[root@test-ilom~]# ipmitool sunoem cli
Connected. Use ^D to exit.
-> show -l all /System/Power/Power_Supplies location health -t
Target             | Property              | Value
-------------------+-----------------------+-----------------------------------
/System/Power/     | health                | OK
Power_Supplies/   |                       |
Power_Supply_0   |                       |
/System/Power/     | location              | PS0 (Power Supply 0)
Power_Supplies/   |                       |
Power_Supply_0   |                       |
/System/Power/     | health                | OK
Power_Supplies/   |                       |
Power_Supply_1   |                       |
/System/Power/     | location              | PS1 (Power Supply 1)
Power_Supplies/   |                       |
Power_Supply_1   |                       

b. To check Processors status
-> cd Processors
/System/Processors

-> show

 /System/Processors
    Targets:
        CPUs

    Properties:
        health = OK
        health_details = -
        architecture = x86 64-bit
        summary_description = Two Intel Xeon Processor E5 Series
        installed_cpus = 2
        max_cpus = 2

c. To check BIOS version
-> cd BIOS
/System/BIOS

-> show

 /System/BIOS
    Targets:
        Config

    Properties:
        system_bios_version = 17120100
        boot_mode = Legacy
        reset_to_defaults = none

Sunday, November 26, 2017

Ignore first 4 lines of cat command output and display first word of remaining lines Unix

Sunday, November 26, 2017 0

Below awk command is very useful to run small scripts in Unix.

Ignore first 4 lines of cat command output and display first word of remaining lines  Unix

Purpose Ignore first 4 lines of cat command output and display first word of remaining lines.

[root@nsk-linux tmp]# cat test.txt
Public cloud is future
Automation never ends
Infra as a Service
Private Cloud
Baremetal Cloud Service
Amazon Cloud service

[root@nsk-linux tmp]# cat test.txt |  awk '{if(NR>4)print $1}'
Baremetal
Amazon

Here, as per our need we can change the value.

Saturday, November 25, 2017

Virtual machines show warning messages when starting the udev daemon Linux

Saturday, November 25, 2017 0

Virtual machines show warning messages when starting the udev daemon.

After upgrading VMware Tools,  Linux virtual machines show warnings when starting the udev daemon.

dmesg shows the below messages.

Starting udev:
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'
udevd[572]: add_to_rules: unknown key 'SUBSYSTEMS'
udevd[572]: add_to_rules: unknown key 'ATTRS{vendor}'
udevd[572]: add_to_rules: unknown key 'ATTRS{model}'

Ctrl+C will bypass udev daemon to finish the boot process.

To disable the warning message, comment out unused lines (ubuntu  & other type of unix entries) in the  /etc/udev/rules.d/99-vmware-scsi-udev.rule file

For linux we need to modify the below line from

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware, " , SYSFS{model}=="VMware Virtual S", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

To

ACTION=="add", BUS=="scsi", SYSFS{vendor}=="VMware " , SYSFS{model}=="Virtual disk ", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"

Save the modifiation and reboot the virtual machine.

Friday, November 24, 2017

Phpldapadmin Renew the expired openldap user

Friday, November 24, 2017 0

Phpldapadmin  Renew the expired openldap user 

Login to phpldapadmin admin console by using Admin id & password.
Explore the ldap directory & search the user in left side
Select the user and click
Right side we can see the user property.
Update the password directly in password section.

Before changing the Shadow Last Change, the ShadowMax & ShadowWarning settings will be like below 


Update the date in Shadow change as per your policy.

 
Once changed the ShadowLastChange setting to current date, ShadowMax & ShadowWarning will change.

Note: Once you changed the password & shadow Last Change settings click update objects. Then only above change will take effect.

Update or Recover root password using Host Profiles VMware

Friday, November 24, 2017 0
VMware Update or Recover root password using Host Profiles.
Create the Host Profile


1. Right click any host in your inventory (it doesn’t matter which), choose Host Profile, then Create Profile from Host.


2. Name the Host Profile and give it a description. Click Next.

3. Click Finish to create the Host Profile.

Configure the Host Profile
I. Open Host Profiles.


II. Right-click the Host Profile and choose Edit Profile.

III. Expand Security Configuration, choose Administrator password
    Choose Configure a fixed administrator password, type in the password twice, then click OK.


IV. Right-click the Host Profile and choose Enable/Disable Profile Configuration.

V. Uncheck everything in the Host Profile configuration except the Security Configuration, click OK.

a. Apply the Host Profile to the ESXi Host (or vSphere Cluster)

b. Right click any host in your inventory, choose Host Profile, then Manage Profile.

c. Choose the Password_Reset Host Profile, click OK.

d. Right click any host in your inventory, choose Host Profile, then Apply Profile.

e. Recheck the changes to be applied, click Finish

Log In
     Log in with the new password. If the setting has been changed successfully, you should be able to log in with the new password immediately.


Thursday, November 23, 2017

for loop command for grep the particular file system from list of servers.

Thursday, November 23, 2017 0

Double For loop command for grep the particular file system (mount point) from list of servers.

Here,
 servers       -  contains server list
 fmount        -  mount point

Run the below command. It will login to the list of server and search the mount point and print the output.

#for j in `cat servers`; do for i in `cat fmount`; do echo $j; ssh $j df -hP | grep -i $i; done; done

Modify the variable as per your needs.

Openldap user password reset by using Phpldapadmin

Thursday, November 23, 2017 0
Follow the below steps to Reset Openldap User password by using Phpldapadmin

Login to phpldapadmin admin console by using Admin id & password.

Explore the ldap directory & search the user in left side
Select the user and click
Right side we can see the user property.


Update the password directly here.

Finally update the object.

Tuesday, November 21, 2017

LVM Interview questions and answers Linvirtshell

Tuesday, November 21, 2017 0
1.Is it possible to increase the logical volume?

 Yes. LVM has the feature to increase the volume without unmount it.


2.How to reduce the logical volume? is it possible to reduce an online?

No. we can't reduce the logical volume an online. Here is the steps to reduce the logical volume.

Un-mount the filesystem
Run e2fsck on the volume device
Reduce the Filesystem using resize2fs
Reduce the logical Volume using lvreduce
Mount the filesystem back.


3.How do you scan the new LUN or disk for LVM physical volume?

Use pvscan to scan existing physical volume from newly connected SAN or DISKS.


4.How to scan disks for existing volume group?

vgscan is used to scan existing volume group from newly connected SAN or DISKS.
But we should use pvscan prior to executing this command.


5.How to scan a logical volume from exising volume group?

lvscan command is used to scan.


6.How to stop the logical volume? or deactivate the logical volume?

#lvchange -an /dev/vg_name/lv_name

-a  - activate
 n   - no


7.How to activate the logical volume which is in deactivated state?

#lvchange -ay /dev/vg_name/lv_name

-a - activate
 y - yes


8.How to disable the volume group? or Deactivate the volume group?

#vgchange -an volume_group_name

-a  - activate
 n   - no

9.How to enable the volume group? or Activate the volume group?

#vgchange -ay volume_group_name

-a - activate
 y - yes

10.How do you find, what are the disks are used for logical volume mirroring?
 

[root@testserver archive]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Convert Devices
  LogVol00 VolGroup00 -wi-ao 32.00G                                       /dev/xvda2(0)
  LogVol01 VolGroup00 -wi-ao 17.88G                                       /dev/xvda2(1024)




11. What are steps to perform in order to increase the logical volume?

  Extend the logical volume
   Increase the Filesystem size
   Verify the status using df command or lvs command.

12.How to list the imported volume groups?

 vgs command to display the imported volume group.


13.How to list the available logical volumes on the system?

  lvs command to list the available logical volumes on the system.

14.How to list the available physical volumes in LVM?

  pvs command to list the available physical volumes.


15.How to see the detailed volume group information?

  [root@testserver archive]# vgdisplay VolGroup00
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                     lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access               read/write
  VG Status                resizable
  MAX LV                    0
  Cur LV                      2
  Open LV                   2
  Max PV                    0
  Cur PV                     1
  Act PV                      1
  VG Size                49.88 GB
  PE Size                32.00 MB
  Total PE                 1596
  Alloc PE / Size       1596 / 49.88 GB
  Free  PE / Size       0 / 0
  VG UUID               ZfQCQ1-suTc-ykV9-TwvN-ACpB-XcEM-NuWlnE

  

16.How to see the detailed logical volume information?

 #lvdisplay /dev/centos/root

17.How to see the detailed physical volume information?

  pvdisplay /dev/disk_name

18.How to rename volume Group? can we rename the VG an online?

Its possible to rename the volume group an online. But the mounted volumes will not reflect the same unless you re-mount the volume with new VG name. Need to update the /etc/fstab with new VG name.

19.How to take a LVM configuration backup?

 vgcfgbackup vg_name  to take the latest configuration backup of volume group. The default volume group backup location is  /etc/lvm/backup.

20.How to re-create the device files for LVM volumes?

 vgmknodes to recreate the LVM devices files

21.Brief about lvmdump.

 lvmdump is tool for LVM2 to collect the various information for diagnostic purposes.By default, it creates a tarball suitable for submission along with a problem report

22.How are snapshots in LVM2 different from LVM1 in Redhat Linux?

LVM1 snapshots are readonly by default where LVM2 snapshots were read/write.
 

23.What are the steps involved to create the logical volume from scratch?
 

Create a physical volume using pvcreate command.
   #pvcreate /dev/sdc

Create a volume group using "vgcreate" command
   #vgcreate centos /dev/sdc

Create a logical volume using "lvcreate" command
   #lvcreate -L 100M -n vol1 centsos

Create a filesystem on logical volume using mkfs command.
    #mkfs -t ext4 /dev/centos/vol1

Mount the filesystem using mount command for use.
    #mount -t ext4 /dev/centos/vol1 /vol1
 

24.How to extend the volume group?

 vgextend we can increase the volume group.



25.Assume Volume group "centos" is already exists. How do you extend the volume group with 100GB? Provide all the steps with commands.

   1.Get the 100GB lun from storage team.(/dev/sdd)
   2.Create physcical volume ( # pvcreate /dev/sdd )
   2.Extend the volume group (# vgextend centos /dev/sdd)

26.If the centos has two physical volumes called /dev/sdc/ & /dev/sdd. How do you remove /dev/sdd from centos.

 vgreduce command will help to reduce, but we need to unmount the lv related to this vg & deactivate the same. Then we can use below command.
 vgreduce centos /dev/sdd/


27.How to decommission/remove LVM completely from the server?

     1.Un-mount all the logical filesystems
     2.Remove the logical volumes using "lvremove" command.
     3.Destroy the volume group using "vgremove" command.
     4.Use "pvremove" command remove the physical volumes from the system.


28. Why LVM is required in Linux Server?

LVM stands for Logical Volume Manager , to resize filesystem's size online we required LVM partition in Linux. Size of LVM partition can be extended and reduced using the lvextend & lvreduce commands respectively.


29. How create partition from the raw disk - Brief.

Using fdisk utility we can create partitions from the raw disk.Below are the steps to create partition from the raw disk :
- fdisk /dev/hd* (IDE) or /dev/sd* (SCSI)
- Type n to create a new partition
- After creating partition , type w command to write the changes to the partition table.