• RHEV: Remotely Connect to Hosted Engine Console via VNC

    Snail_On_White_Background_600

     

    Honestly, this one is not hard to figure out, as it’s documented in multiple places. However, I have found that the documentation varies greatly depending if you are using RHEV or Ovirt, and the version of each that you are using seems to matter as well. At least, that has been my experience trying to figure out how to get this working.

    So I figured I would document it here so that I would not have to try to remember which google result worked for me.

    Note that this example is on RHEV 3.6.1.

    First, you need to connect to the RHEV-h machine that is hosting the HostedEngine. Then you need to set a console password. See example below.

    Note: This is a one-time password, and must be set each time you want to connect to the console.

    # hosted-engine –add-console-password
    Enter password:
    code = 0
    message = ‘Done’

    Now via your remote machine (mine is Linux). Run the following command. Replace the IP address below with the IP or hostname of your RHEV-H host.

    $ remote-viewer vnc://10.1.0.112:5900

    If everything is successful, you should get a pop-up window similar to what is shown below.

    kvm

    Note, I have run into several issues in the past getting this to work. Not sure why, but if I run into any, I will document them here.

     

     

  • RHEL 7 Two-Factor SSH Via Google Authenticator

    650x300xgoogle-authenticator-header.png.pagespeed.gp+jp+jw+pj+js+rj+rp+rw+ri+cp+md.ic.194erIegOZ.jpg

    In this post,  I am going to walk you through the process of installing and configuring two- factor SSH authentication via Google Authenticator. My base system is running a fresh install of RHEL 7.2

    Installation Steps

    The first step on my system was to install autoreconf, automake, and libtool. These packages are required by the bootstrap.sh script that we will need to in a couple more steps.

    # yum -y install autoconf automake libtool

    Now, we are going to install Git.

    #yum -y install git

    One more dependency to knock out. Install pam-devel as shown below.

    # yum -y install pam-devel

    Next, we clone the google-authenticator Git repo. In this example, I am cloning to /root

    # git clone https://github.com/google/google-authenticator.git
    Cloning into 'google-authenticator'...
    remote: Counting objects: 1435, done.
    remote: Total 1435 (delta 0), reused 0 (delta 0), pack-reused 1435
    Receiving objects: 100% (1435/1435), 2.32 MiB | 0 bytes/s, done.
    Resolving deltas: 100% (758/758), done.

    Now change directory as shown below and run bootstrap.sh.

    # cd /root/google-authenticator/libpam
    # ./bootstrap.sh

    Now run the following commands to finalize the module installs.

    # ./configure
    #make
    #make install

    Assuming that you do not run into any errors, the following modules will be installed.

    • /usr/local/lib/security/pam_google_authenticator.so
    • /usr/local/lib/security/pam_google_authenticator.la
    (more…)
  • NUMA Node to PCI Slot Mapping in Red Hat Enterpise Linux

    NUMA Node to PCI Slot Mapping in Red Hat Enterpise Linux

     

    understanding-dpdk-31-638
    Sandybridge I/O Controller to PCI-E Mapping

     

    Using a few simple commands you can easily map a PCI slot back to its directly connected NUMA node. This information comes in very handy when implementing NFV leveraged technologies such as CPU Pinning and SRIOV.

     

    First, you will need to install hwloc and hwloc-gui, if it is not already installed on your system. hwloc-gui provides the lstopo command, so you will need to install the gui package even if you are going to run the command on a headless system.

    # yum -y install hwloc.x86_64 hwloc-gui.x86_64

    Now you can run lstopo. Below is the output from one of my dual socket, quad core Xeon systems.

    # lstopo
    Machine (40GB)
    NUMANode L#0 (P#0 16GB) + Socket L#0 + L3 L#0 (8192KB)
    L2 L#0 (256KB) + L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0
    PU L#0 (P#0)
    PU L#1 (P#8)
    L2 L#1 (256KB) + L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1
    PU L#2 (P#1)
    PU L#3 (P#9)
    L2 L#2 (256KB) + L1d L#2 (32KB) + L1i L#2 (32KB) + Core L#2
    PU L#4 (P#2)
    PU L#5 (P#10)
    L2 L#3 (256KB) + L1d L#3 (32KB) + L1i L#3 (32KB) + Core L#3
    PU L#6 (P#3)
    PU L#7 (P#11)
    NUMANode L#1 (P#1 24GB) + Socket L#1 + L3 L#1 (8192KB)
    L2 L#4 (256KB) + L1d L#4 (32KB) + L1i L#4 (32KB) + Core L#4
    PU L#8 (P#4)
    PU L#9 (P#12)
    L2 L#5 (256KB) + L1d L#5 (32KB) + L1i L#5 (32KB) + Core L#5
    PU L#10 (P#5)
    PU L#11 (P#13)
    L2 L#6 (256KB) + L1d L#6 (32KB) + L1i L#6 (32KB) + Core L#6
    PU L#12 (P#6)
    PU L#13 (P#14)
    L2 L#7 (256KB) + L1d L#7 (32KB) + L1i L#7 (32KB) + Core L#7
    PU L#14 (P#7)
    PU L#15 (P#15)
    HostBridge L#0
    PCIBridge
    PCI 8086:10c9
    Net L#0 "enp8s0f0"
    PCI 8086:10c9
    Net L#1 "enp8s0f1"
    PCIBridge
    PCIBridge
    PCIBridge
    PCI 8086:10e8
    Net L#2 "enp5s0f0"
    PCI 8086:10e8
    Net L#3 "enp5s0f1"
    PCIBridge
    PCI 8086:10e8
    Net L#4 "enp4s0f0"
    PCI 8086:10e8
    Net L#5 "enp4s0f1"
    PCIBridge
    PCI 102b:0532
    GPU L#6 "card0"
    GPU L#7 "controlD64"
    PCI 8086:3a22
    Block L#8 "sr0"
    Block L#9 "sda"
    Block L#10 "sdb"
    Block L#11 "sdc"

    The first 27 lines of output tell you which cores are in each socket.

    Lines starting with “HostBridge L#0” list the PCI devices attached to socket 0. On more modern dual socket systems (think Sandybridge) you would have a “HostBridge L#8” section as well.

     


    “The PCI host bridge provides an interconnect between the processor and peripheral components. Through the PCI host bridge, the processor can directly access main memory independent of other PCI bus masters. For example, while the CPU is fetching data from the cache controller in the host bridge, other PCI devices can also access the system memory through the host bridge. The advantage of this architecture lies in its separation of the I/O bus from the processor’s host bus.”


    Unfortunately, my lab systems are Nehalem based machines which implement what is called QPI to share a host bridge between CPU sockets.  See image below.

     

    019_QPI_1IOH
    Nehalem QPI Architecture

    Nonetheless, we are able to determine which CPU socket is associated with a specific PCI device. For this example, we will focus on the devices below since they are both directly attached to the PCI Host Bridge and not the PCI Bus.

     

    HostBridge L#0
    PCIBridge
    PCI 8086:10c9
    Net L#0 "enp8s0f0"
    PCI 8086:10c9
    Net L#1 "enp8s0f1"

    Now using the lspci command I can find the exact devices per NUMA node.

    lspci -nn | grep 8086:10c9
    08:00.0 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection [8086:10c9] (rev 01)
    08:00.1 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection [8086:10c9] (rev 01)

     

     

     

     

  • Mapping Libvirt VM Names with OpenStack Instance Names

    openstack

    Within OpenStack, each virtual machine instance running on a Compute nodes also a virtual machine running on a libvirt node.

    If you ssh to a Compute node and run the command below you can get the names of each VM running or registered on this Compute node.

    # virsh list –all
    Id Name State
    —————————————————-
    2 instance-000000f0 running
    – instance-00000024 shut off
    – instance-00000039 shut off
    – instance-000000ea shut off

    So there is only one VM currently running on this Compute node, but which VM is it?

    Well, we can figure that out pretty easily. See below.

    # virsh dumpxml instance-000000f0 | grep uuid | grep name

    <entry name=’uuid’>3103d38c-447d-40af-9607-56b26473ee72</entry>

    Now we just have to map this UUID back to an OpenStack instance name

    Here we have a nasty little awk grep to get the UUID and name of each OpenStack instance running in our cluster.

    # nova list | grep -v “+” | grep -v ID | awk ‘{print $2 $3 $4}’

    a402716b-73d0-4303-9331-202bc2386ab8|storage-perf-a
    bd73f092-88c9-4af1-b569-c1176290841c|storage-perf-b
    0ab8decb-6623-4e68-b8e4-b9cd522f6ea9|storage-perf-c
    493c8afe-836e-4846-bdd0-029bb6e7f70e|storage-perf-d

    Note that you can also get the instance name using a UUID,  see below

    #nova show db79f6a2-455e-4f17-88d0-b3018d279c7c | grep instanceOS-EXT-SRV-ATTR:instance_name | instance-0000002a

    OS-EXT-SRV-ATTR:instance_name | instance-0000002a

     

    Update:

    Thanks to TB for showing me this one. You can accomplish all of this via nova cli using the FQDN of the host.

    (overcloud) [stack@undercloud ~]$ nova list --all --host comp39.localdomain --fields=name,host,instance_name,status
    +--------------------------------------+----------------------+-------------------------------+-------------------+--------+
    | ID | Name | Host | Instance Name | Status |
    +--------------------------------------+----------------------+-------------------------------+-------------------+--------+
    | 30fccd83-e517-4e56-a1df-5d5d454818ff | vm-name1 | comp39.localdomain | instance-0023a423 | ACTIVE |
    | bc6bb4da-1cac-4603-ad52-2078f13cf6fd | vm-name-2 | comp39.localdomain | instance-0023a348 | ACTIVE |
    +--------------------------------------+----------------------+-------------------------------+-------------------+--------+

     

     

  • Red Hat OpenStack Technical Preview Features

    redhat-logo

     

    According to this page,  a Technology Preview is a feature that is  currently unsupported, may not have complete functionality, and are not suitable for deployment in production. However, Red Hat provides these features and makes them available to the customer as a courtesy with the primary goal of exposing the feature to a wider audience.

    I am quite often asked by my clients, which features are in tech preview for each release.  Instead of spending time looking these things up each time I figured I would document them here.

     

  • OpenShift Enterprise 3.1 Lab Setup

    Overview OpenShift Enterprise is a PaaS platform that enables digital transformation. It lets you build and run traditional (mode 1) as well as cloud-native (mode 2) applications. OpenShift is buil…

    Source: OpenShift Enterprise 3.1 Lab Setup

  • How to Determine Installed OpenStack director Version

    OpenStack-logo

    Trying to determine that version of Red Hat OpenStack director that is installed on an Undercloud Controller is not as straight forward as one would hope.

    I have created the simple table below that you can use to determine your installed director version via the installed version of the openstack-tripleo-heat-templates rpm.

    Minimum RPM Version Release Date director Version
    openstack-tripleo-heat-templates-0.8.6-123.el7ost UNK 7.3.1
    openstack-tripleo-heat-templates-0.8.6-94.el7ost.noarch.rpm 2015-12-16 7.2
    openstack-tripleo-heat-templates-0.8.6-71.el7ost.noarch.rpm 2015-10-05 7.1
    openstack-tripleo-heat-templates-0.8.6-45.el7ost.noarch.rpm 2015-07-30 7.0
    openstack-tripleo-heat-templates-0.8.14-11.el7ost.noarch 2016-04-20 8.0
    oopenstack-tripleo-heat-templates-2.0.0-41.el7ost.noarch ?? 9.0
    openstack-tripleo-heat-templates-5.2.0-15.el7ost.noarch ?? 10.0
    openstack-tripleo-heat-templates-6.0.0-10.el7ost.noarch ?? 11.0

    Hopefully, in the near future, we will see an rpm similar to redhat-release-server (the rpm that create /etc/redhat-release) included in future OSP director updates. Until then, this table should be of some assistance.

    Related Bugzillas

    https://bugzilla.redhat.com/show_bug.cgi?id=1295512

    https://bugzilla.redhat.com/show_bug.cgi?id=1085625

    Secondary Method – Updated 9/20/2016

    You can also run the following command on your overcloud

    [root@tpacpuictrl0 nova]# nova-manage –version
    2015.1.3

    Now cross reference this info with this webpage.

    https://wiki.openstack.org/wiki/Releases