• Enable Nested Virtualization on RHEL 7

    empty birds nest

    Follow the steps shown below if you want to be able to run nested virtual machines on RHEL 7 via KVM.

    In this particular situation I have a physical Supermicro server that I want to use to host OpenStack.

    Note that my home server has Intel Xeon processors, so I first enable nested virtualization via the KVM intel module.  AMD procs use a different module.

    [code language=”css”]
    cat << EOF > /etc/modprobe.d/kvm_intel.conf
    options kvm-intel nested=1
    options kvm-intel enable_shadow_vmcs=1
    options kvm-intel enable_apicv=1
    options kvm-intel ept=1
    EOF
    [/code]

    Also, in order to communicate with your nested VMs you will need to disable reverse path filtering, otherwise RHEL will discard any network packets in order to prevent asymmetric routing. See below.

    [code language=”css”]
    cat << EOF > /etc/sysctl.d/98-rp-filter.conf
    net.ipv4.conf.default.rp_filter = 0
    net.ipv4.conf.all.rp_filter = 0
    EOF
    [/code]

    The simplest way to enable these changes is via a reboot of the physical host.

  • Simple Puppet Module – Iterate Through an Array

    puppet-logo

    OK, this is a very simple and quick one.

    I was looking for a simple example of how to iterate through an array in a Puppet module. I basically needed an example of a “for loop” inside a Puppet module that I could, as someone who is not exactly fluent in Ruby, could modify to fit my needs.

    I settled on the format that you see below.

    The “define” code block is basically the work that we want the Puppet module to do. In this case, it’s create a file in /tmp. Think of this line as pretty much just a placeholder for more complex code.

    The “class” code block is where we setup our array of items for the module to “loop” through.

    #
    #
    # Test Module
    #
    #
    
    define myarray_config {
    notify { "Item ${name}": }
    file {"/tmp/$name":
    ensure =&gt; present,
    mode =&gt; 0777,
    }
    }
    
    class test-module {
    $array = [ 'item1', 'item2', 'item3' ]
    myarray_config { $array: }
    
    }

     

    Now add the following code to your site.pp to make this module part of your site manifest.

    include test-module
    

  • Zelda Outlands Walkthough

    Zelda-Outlands-Box-Set

    The “Legend of Zelda – Outlands” is a hack of the original 8-bit “Legend of Zelda” game for the NES.  The ROM can be downloaded here. The game is also available in cartridge format on Ebay and the like, however the price is prohibitive.

    Note that this re-work of the original LOZ game is notoriously difficult. I was, however, able to dig up walkthrough in word doc format. I am posting it below for posterity, and am adding some formatting to make it easy to read.

    Story

    The Thunderbird, a horrible guardian encountered by Link in the Great Palace of Zelda 2, has somehow survived and is out for revenge. Having lost the Triforce of Courage at the hands of its adversary, it has stolen the Triforce of Power and flown to the vast neighbor of Hyrule, the Outlands.

    In a world similar to yet completely different from Zelda 1, Link must track down the captured Tetrarch Fairies and, with their help, break open Ganon’s secret golden vault where the creature now resides. Link will face dangers and traps unlike anything Ganon had ever devised. His adventure will span 18 new dungeons hidden within a completely unfamiliar terrain.

    Zelda herself will make appearances to help the hero, providing items and sage advice crucial to the new journey. Link has become very skilled in his familiar world of Hyrule, but skill alone is his only advantage — the land of the Outlands is a beautiful yet deadly world bearing no resemblance to his own cherished kingdom.

    zeldaoutlandsoverworld
    Map Of Overworld – Click for Full Size

     

    Walkthough

    Overworld

    Your start location is on the west end of the map, (at A6) and you don’t have any weapon with you. From here, go right three screens, down once, and right once. you will arrive at screen E7 and enter Level 1 here.

    200px-Peahat-LoZ-Art.png

     

    Level 1 : Amicus Palace

    Item to get : Sword
    Heart Container : #1
    Tetrach Fairy:1

    As soon as you enter, go right 2 screens and you will get your sword from Zelda. Head back left and kill the easy blue Peahats for 5 rupees and go up. Here, Kill all Gibdos to get the key and unlock the door there. Go up, right, up, and right 4 screens. Kill all the Peahats and then push the far left block to open the doors.

    Go right again and kill the Peahats, then grab the key and head up to next room. Here, you will get a compass from Zelda. from here, Go down 2 screens and you’ll face Boomerang Moblins that will attack you with boomerang, and they are deadly. Kill them for the map. From here, go up, left, left, down, and left 5 screens.

    Here, go left and up 2 screens. Kill all the Deelers here and head up again. Destroy the Cages and note the one difference in details in this room. There’s a block on the right side where a gap is on the left. Push this block down and go right once. Kill the Moblins for another key and go right again. Note the Wizzrobe Quartet in here, focused on a ball in their center. This will be important later.

    Make your way back to the room that had the Deelers and go left by unlocking the door. Kill or just avoid the Blue Moblins and go left. Ready for tough battle, Basilisk triplets!

    To defeat them, feed them with a bomb and quickly place a second to kill it. You can slash it after stun it with bomb to get four extra bombs. Once you’re done head down and kill the Peahats, then push one of the block to get the Heart Container #1.

    Then, go up 2 screens and grab the Tetrach Fairy #1. Before leaving this dungeon, check your map and you’ll notice a few rooms that you haven’t explored yet. We’ll be come back here later… So leave this dungeon.

    (more…)

  • Puppet: Convert a Variable to Lower Case

    noted-felt-puppets-1

     

    This is going to be a very simple example of how to convert a variable to all lowercase inside a Puppet module.

    If you look, which I am sure that you have already…there seems to be a lot of documentation around how to use the Ruby “downcase” function, but not much of it is easy to read if you are not very familiar with Ruby.

    In this example, I create a very simple Puppet module and show how to use the downcase function.

    class test-module (
    $myname = "TEST",
    ){
    
    $myname_downcase = downcase($myname)
    
    file { "/var/tmp/$myname_downcase":
    ensure =&amp;gt; present,
    content =&amp;gt; "This is a Test File for $myname_downcase",
    }
    }

    In this example I have a Variable called $myname. I am setting $myname to TEST inside the init.pp.

    Note however you would probably never do this. More than likely you would do one of the following:

    1. Set $myname so that it is an external environmental variable
    2. Set $myname to NULL and override in Foreman.

    The meat in this potato is this line here, where we take the $myname variable and munge it into a new variable called $myname_downcase.

    $myname_downcase = downcase($myname)

     

  • Running CloudForms and Puppet Together

    logotype_rh_cloudforms_rgb_black1

    In this instance we are trying to run Red Hat Cloudforms, also known as Manage IQ, and Puppet together on the same RHEL 6 host.

    Our goal here is to push out some configuration to the Cloudforms appliances via Puppet. However we ran into issues as the version of Ruby/Ruby Gems used by Cloudforms is different than the version used by Puppet and they are stepping on each other a bit.

    Here is the error we see when attempting to run Puppet

     

    # puppet agent -t

    /opt/rh/ruby200/root/usr/share/gems/gems/json-1.8.2/lib/json/ext/parser.so: [BUG] Segmentation fault

    ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

    Aborted (core dumped)

     

    As a workaround we add this code to /usr/bin/puppet.

    %w(GEM_ROOT GEM_HOME GEM_PATH).map do |x|

    ENV.delete x

    end if $0.match(/\A#{‘/usr/bin’}/)

     

     

    We add this right below

    #!/us/bin/ruby

    By no means is this the best way to work around this issue, however it does work and will get you up and running.