• VMware

    Learn about VMware virtualization for its products like vsphere, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • A successful man is one who can lay a firm foundation with the bricks others have thrown at him!!!

    Thursday, July 24, 2014

    How to detect new hard disk attached without rebooting in Linux

    Scenario:

    Suppose you have added a new hard disk to your Linux OS running on any Virtual Environment which in my case is VMware workstation. Once added the new hard drive, generally the changes won't reflect unless you reboot the Guest OS.

    But what if you are in no position to reboot the Gues Linux OS?

    Solution:

    In the below path you can find a list of host symlinks pointing to the iscsi device configured on your Linux box
    # ls -l /sys/class/scsi_host/
    total 0
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host0 -> ../../devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host1 -> ../../devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host10 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host10/scsi_host/host10
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host2 -> ../../devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host3 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host3/scsi_host/host3
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host4 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host4/scsi_host/host4
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host5 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host5/scsi_host/host5
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host6 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host6/scsi_host/host6
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host7 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host7/scsi_host/host7
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host8 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host8/scsi_host/host8
    lrwxrwxrwx 1 root root 0 Jun 14 05:08 host9 -> ../../devices/pci0000:00/0000:00:11.0/0000:02:05.0/host9/scsi_host/host9

    But to detect a new hard drive attached you need to first get your host bus number used which you can get by using below command
    # grep mpt /sys/class/scsi_host/host?/proc_name
    You should get a output like below
    /sys/class/scsi_host/host2/proc_name:mptspi
    So as you see your host2 is the relevant fiels where you need to reset the storage buffer values. Run the below command
    # echo "- - -" > /sys/class/scsi_host/host2/scan
    Here "- - -" defines the three values stored inside host*/scan i.e. channel number, SCSI target ID, and LUN values. We are simply replacing the values with wild cards so that it can detect new changes attached to the Linux box. This procedure will add LUNs, but not remove them.

    Once done verify if you can see the new hard drive which in my case worked very fine as I see below
    # fdisk -l
    Disk
    /dev/sdb: 3221 MB, 3221225472 bytes
    255 heads, 63 sectors/track, 391 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Let me know your success and failures.

    Related Articles:
    How to extend/resize Logical Volume and Volume Group in Linux
    How to detect new NIC/Ethernet card without rebooting in Linux
    How do you check Linux machine is Physical or Virtual remotely?


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?

    Wednesday, July 23, 2014

    How to detect new NIC/Ethernet card without rebooting in Linux

    I have a Red Hat 6 vm created in my VMware Workstation Lab. I will just go ahead and add a new NIC card to my running RHEL machine.

    Now let us try to detect it without rebooting the OS

    If we check the output of ifconfig
    # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:D3
              inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4dd3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:91992 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58283 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:99437002 (94.8 MiB)  TX bytes:5498693 (5.2 MiB)

    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:2964 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2964 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:388592 (379.4 KiB)  TX bytes:388592 (379.4 KiB)

    So as of now the new thernet card configuration is not reflected. There is a file /etc/udev/rules.d/70-persistent-net.rules which contains details about the connected ethernet card in your RHEL box.

    I have discussed about the working of this file in the below link
    device eth0 does not seem to be present, delaying initialization

    In this file you can view the details of the newly connected Ethernet Card
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="
    00:0c:29:b9:4d:d3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b9:4d:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    As you see it shows two ethernet card details i.e. eth0 and eth1. As of now eth0 is already in connected state as per the output of ifconfig which can also match using the MAC details. So let us manually create a new configuration file for the new card.
    # cd /etc/sysconfig/network-scripts
    To skip the hard work let us copy the contents from eth0 to our new file, in that way we will just have to make required changes
    # cp ifcfg-eth0 ifcfg-eth1
    Lines marked in blue are the one you need to change as per your environment
    # vi ifcfg-eth1
    DEVICE=eth1
    TYPE=Ethernet
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=none
    HWADDR=00:0c:29:b9:4d:dd
    IPADDR=192.168.1.5
    PREFIX=24
    GATEWAY=192.168.1.1
    DNS1=8.8.8.8

    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=no
    NAME="System eth1"

    Restart your network services
    # service network restart
    Shutting down interface eth0:                              
    [  OK  ]
    Shutting down loopback interface:                          [  OK  ]
    Bringing up loopback interface:                            [  OK  ]
    Bringing up interface eth0:  Determining if ip address 192.168.1.11 is already in use for device eth0...
                                                               [  OK  ]
    Bringing up interface eth1:  Determining if ip address 192.168.1.5 is already in use for device eth1...
                                                               [  OK  ]

    Verify your results
    # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:D3
              inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4dd3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:92368 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58550 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:99470396 (94.8 MiB)  TX bytes:5531059 (5.2 MiB)

    eth1      Link encap:Ethernet  HWaddr 00:0C:29:B9:4D:DD
              inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb9:4ddd/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3 errors:0 dropped:0 overruns:0 frame:0
              TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:372 (372.0 b)  TX bytes:636 (636.0 b)


    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:2964 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2964 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:388592 (379.4 KiB)  TX bytes:388592 (379.4 KiB)

    I hope that was helpful. Let me know your success and failures

    Related Articles
    Creating an internal network using VMware Workstation
    How to do Ethernet/NIC bonding/teaming in Red Hat Linux
    How to configure network in Red Hat Linux
    Configure network in Solaris 10


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?

    Sunday, July 13, 2014

    Interview Questions on VMware ESXi with Answers

    1. What is a Hypervisor?
    It is a program that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host's processor, memory, and other resources all to itself. However, the hypervisor is actually controlling the host processor and resources, allocating what is needed to each operating system in turn and making sure that the guest operating systems (called virtual machines) cannot disrupt each other.

    2. What is the hardware version used in VMware ESXi 5.5?
    Version 10

    Below is the table showing the different version of hardware used in different VMware products along with their release version
    Virtual Hardware Version
    Products
    10
    ESXi 5.5, Fusion 6.x, Workstation 10.x, Player 6.x
    9
    ESXi 5.1, Fusion 5.x, Workstation 9.x, Player 5.x
    8
    ESXi 5.0, Fusion 4.x, Workstation 8.x, Player 4.x
    7
    ESXi/ESX 4.x, Fusion 2.x/3.x Workstation 6.5.x/7.x,Player 3.x
    6
    Workstation 6.0.x
    4
    ACE 2.x, ESX 3.x, Fusion 1.x, Player 2.x
    3 and 4
    ACE 1.x, Player 1.x, Server 1.x, Workstation 5.x, Workstation 4.x
    3
    ESX 2.x, GSX Server 3.x

    Minimum H/W requirements for VMware vCenter Server 4.x and 5.x

    VMware vCenter Server 4.x


    Hardware
    Requirement
    Processor
    Intel or AMD x86 (64-bit if installing vCenter Server 4.1) processor with two or more logical cores, each with a speed of 2GHz.
    Memory
    3GB RAM. RAM requirements may be higher if your database runs on the same machine. VMware VirtualCenter Management WebServices requires 128Mb to 1.5GB of memory which is allocated at startup.
    Disk storage
    2GB. Disk requirements may be higher if your database runs on the same machine.
    Microsoft SQL Server 2005 Express requires up to 2GB free disk space to decompress the installation archive.
    Networking
    1Gbit recommended

    VMware vCenter Server 5.x

    vSphere 5.1 introduced the vCenter Single Sign-On (SSO) component as part of the vCenter Server management infrastructure. This change affects vCenter Server installation. Authentication by vCenter Single Sign-On makes the VMware cloud infrastructure platform more secure by allowing the vSphere software components to communicate with each other through a secure token exchange mechanism.

    Tuesday, July 01, 2014

    Comparison Type 1 vs Type 2 Hypervisor

    Before moving ahead with the types let us understand the meaning of an hypervisor.

    What is Hypervisor?

    A Hypervisor also known as Virtual Machine Monitor (VMM) can be a piece of software, firmware or hardware that gives an impression to the guest machines(virtual machines) as if they were operating on a physical hardware. It allows multiple operating system to share a single host and its hardware. The hypervisor manages requests by virtual machines to access to the hardware resources (RAM, CPU, NIC etc) acting as an independent machine.

    Now the Hypervisor is mainly divided into two types namely
    Type 1/Native/Bare Metal Hypervisor
    Type 2/Hosted Hypervisor

    Let us try to understand about them in detail

    Type 1 Hypervisor

    • This is also known as Bare Metal or Embedded or Native Hypervisor.
    • It works directly on the hardware of the host and can monitor operating systems that run above the hypervisor.
    • It is completely independent from the Operating System. 
    • The hypervisor is small as its main task is sharing and managing hardware resources between different operating systems.
    • A major advantage is that any problems in one virtual machine or guest operating system do not affect the other guest operating systems running on the hypervisor.

              Examples:
              VMware ESXi Server
              Microsoft Hyper-V
              Citrix/Xen Server




    Type 2 Hypervisor

    • This is also known as Hosted Hypervisor.
    • In this case, the hypervisor is installed on an operating system and then supports other operating systems above it.
    • It is completely dependent on host Operating System for its operations
    • While having a base operating system allows better specification of policies, any problems in the base operating system a ffects the entire system as well even if the hypervisor running above the base OS is secure.


             Examples:
             VMware Workstation
             Microsoft Virtual PC
             Oracle Virtual Box
           




    Related Articles
    Comparison and Difference between vSphere 5.1 and 5.5
    How to configure Private Network in VMware Workstation
    Configuration maximum comparison for VMware vSphere 5.0, 5.1 and 5.5


    Follow the below links for more tutorials

    What is the difference/comparison between Unix and Linux ?
    What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
    Step by Step Linux Boot Process Explained In Detail
    What is the difference between ext3 and ext4 filesystem in Linux ?
    How to configure Private Network in VMware Workstation
    9 examples to help you understand top command usage in Unix/Linux
    Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    15 tips to enhance security of your Linux machine
    Why is Linux more secure than windows and any other OS
    Understanding Load Average in Linux and when to be worried about it?
    Disk Attachment Technology FC vs SAS vs iSCSI
    Understanding UMASK value in Linux
    How to keep a track of all the commands run by any user in Linux
    How do you check Linux machine is Physical or Virtual remotely?