As most CCIE candidates know Dynamips runs much better on Linux. Many of us run Windows at work or as our primary OS and might be afraid to mess around with partitioning and dual booting. There is a safer alternative that is called WUBI (Windows UBuntu Installer). WUBI installs Ubuntu like a regular program and it can be removed via add/remove programs. WUBI adds an option at boot to boot either Ubuntu or Windows. If you don’t choose anything Windows will boot. Get WUBI here.

I use my laptop to run labs but it’s not that powerful. It’s a Core 2 duo @ 2.13 GHz with 4GB RAM and runs Windows 7 Professional as primary OS. I can run the full INE topology at 75% CPU that is with only the base configs. I have another computer that is used as a HTPC, its a Core 2 duo @ 2.33 GHz with 2GB RAM and Windows XP as primary OS. I got the idea to try to load balance with the two computers. I started out booting Ubuntu on one computer and Windows on the other but I ran in to all sorts of issues. I decided to run Ubuntu on both computers and with WUBI its easy and safe to do so and still keep your Windows (take backups just in case!). Getting the load balancing to work turned out to be more difficult than expected, that is why I hope people can benefit from this blogpost.

Start by installing Ubuntu on both computers via WUBI and boot the computers. You need to install Dynamips and Dynagen, if you want to install GNS3 also. Either use the Synaptic package manager and search for the programs or from a terminal:

sudo apt-get install dynamips

Repeat this step for Dynagen and GNS3 if wanted. The great thing with Synaptic and apt-get is that it will check dependencies and download everything needed. If you want to control the second computer from the first one configure remote desktop settings.



When using both local and remote hypervisors you cannot use localhost in your .net file, use the real IP instead. Put entries like this in your .net file:

[192.168.1.65:7200]
udp = 10000
workingdir = /Applications/Dynagen/sample_labs/internetworkexpert/working
[[3725]]
image = /Applications/Dynagen/images/c3725-adventerprisek9-mz.124-15.T10.extracted.bin
ram = 128
ghostios = True
idlepc = 0x614ac21c

I use two hypervisors per computer so the next entry will be 192.168.1.65:7201 and udp = 10100. Then after that I have 192.168.1.67:7202 and udp = 10200 which is the other computer.

You need to create directories to put the files, this is done with mkdir:

cd /
mkdir Applications
cd Applications
mkdir Dynagen
cd Dynagen
mkdir images

The reason I created these directories is that is what INE uses in their .net file (I use their workbooks). You can download the .net files and base configs here.

Make sure that the dir ‘working’ that is created from the zip file has the right permissions (write) otherwise Dynagen will crash when it tries to write log files and other files to the dir.

INE and I use an uncompressed IOS to boot the devices faster. To uncompress the image you can use unzip:

unzip c3725-adventerprisek9-mz.124-15.T10.bin
Archive: c3725-adventerprisek9-mz.124-15.T10.bin
warning [c3725-adventerprisek9-mz.124-15.T10.bin]: 28328 extra bytes at beginning or within zipfile
(attempting to process anyway)
inflating: C3725-AD.BIN

To change the filename use mv

mv C3725-AD.bin c3725-adventerprisek9-mz.124-15.T10.extracted.bin

Now everything should be in place. Start GNS3 and choose ‘open network file’ and import the .net file. I will attach mine to show how it is done. If paths to directories or to the IOS image is wrong the import will fail so typing the right names is critical.

You should now have load balancing between the computers. I was able to go down from 75% CPU to around 45-50 with this setup. If you have any questions post them in comments. Here is the .net file.

Dynamips – loadbalanced hypervisors
Tagged on:         

8 thoughts on “Dynamips – loadbalanced hypervisors

  • January 8, 2011 at 11:30 pm
    Permalink

    Great tip, will try this out ! ( after I read all the books I have bought )
    Trying to to the written exam in 4 to 5 months !

    Reply
  • March 3, 2011 at 3:29 pm
    Permalink

    Hi,

    I plan to use window and ubuntu for loadbalanced hypervisors. Have you try it before? Can you advise?

    Thanks.

    Reply
    • March 3, 2011 at 4:10 pm
      Permalink

      Hi,

      Yes I have tried it but got timeouts between the Windows box and the Ubuntu box even though there was reachability. Decided it was too much fuss and moved to a Linux environment and never looked back. Right now I’m running a single hypervisor install on a VM and I’m running the full INE topology on it. Performs really well.

      Reply
      • March 4, 2011 at 2:43 am
        Permalink

        thanks for your reply.

        Are you using ubuntu on the VM?

        Now I’m using ubuntu as guest OS in virtual box, and window vista as host OS. I checked that it is always 100% loading on the GNS3 with using single or 2 hypervisor on ubuntu when running full INE Vol 1. I also tried different idle pc value, but still got 100%…

        Do you have any idea?

        Reply
  • March 4, 2011 at 5:42 am
    Permalink

    Here is my laptop hardware configuration:

    Intel Core 2 Duo U9400 1.4GHz
    4 GB RAM
    Window Vista 32 bits, ubuntu on virtualbox

    When I run SW1-4 and R1-R6 (Not start BB1-3), I just observed that CPU always keep above 90% on ubuntu….

    Reply
  • March 4, 2011 at 9:30 am
    Permalink

    Is your processor really only 1.4 GHz? That might be a bit slow. I’m not sure how well Vista performs but you are running a 32-bit system with 4GB RAM so you can’t use it all. Read my post on Ubuntu on a stick or use WUBI to install Ubuntu natively on your computer without messing up your MBR and install the 64-bit version. That will perform much better. Otherwise you might need a faster CPU. I was able to run the entire topology on a 2.4 GHz Core2Duo with 2GB RAM with around 60-70% CPU load.

    Reply
    • March 4, 2011 at 10:15 am
      Permalink

      Actually, I cannot replace the CPU, since it is offered by my company. And I need to run both vista and ubuntu OS on that machine due to my daily work….

      Have any other way to reduce the loading to 60-70%???

      Thanks.

      Reply
      • March 4, 2011 at 12:47 pm
        Permalink

        Try running a WUBI install and see it it performs better. Try to find an optimal idle-PC value. Start one router at a time and look at CPU usage and see what value performs the best. Not much other than that you can do unless you can connect to a second PC and load balance.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *