Python and Euca2ools

Since Eucalyptus is coded in python, I spend the past week going through online tutorials and learning more about how to code in python. In comparison to any programming languages I have used before, the syntax is very straight forward and easy to comprehend and learn. It may be that python isn’t by far the first programming language that I have learned, or that it is just an easy to learn language in general. Im going to continue with the tutorials I have been using and hopefully understand most of what is going on in the Eucalyptus code so I can contribute to commenting it.

In addition to learning python, I also had to redownload and initialize Euca2ools on my new laptop. This time was actually much more successful than the first time I attempted doing this. I couldn’t figure out how to download the credentials .zip from our matrix cluster yet, so I tested this process out with the ECC credentials. I was able to initialize, create a key pair, find an image, and create an instance of it. In addition to that I was also able to assign that instance an availible IP, SSH into it, and terminate the instance using euca2ools. I did have to use a few extra commands in order to make the process from our euca2ools wiki page work, which i later added in.

 

This is how you can generate an accessible instance IP:

euca-allocate-address

Associate the allocated address with your VM instance:

euca-associate-address <IP from allocate> -i <instance ID>

Last monday I was put on the task of figuring out how to get multiple people the permissions to receive user requests and approve them. After some research and playing around with our matrix graphical interface I couldn’t figure out how to get multiple users the ability to do that. So as of right now, the only way that I know how to have multiple people receive requests is to give them all access to the email address the requests get sent to. If we wish to have professor Wurst have access to user requests, then we will either have to make a new email address that our “Administrators” can access, or just switch the email address to professor Wurst’s so he will receive them.

Now that I have a better understanding of python and euca2ools, I plan on getting to know more about eutester and how that area of our project works. I also plan on looking at more of the Eucalyptus code to see if I can start commenting parts of it.  But more of that stuff soon enough! I’m looking forward to this coming week and seeing where our next step is as a class.

From the blog clacroix12 by clacroix12 and used with permission of the author. All other rights reserved by the author.

Week of 26 March 2012

I worked a lot this week on the Eucalyptus Glossary that we are posting on the CS student wiki. I tried to concentrate on terms that I myself was fuzzy on. Most of these are networking terms. I have been able to muddle along in networking situations in my work, but so far have no formal training in it. I am taking a networking class next spring, and am so looking forward to it.

An example of this is the woord subnet. I have entered a “subnet mask” amny times, without really knowing why, only that a particular situation called for it. Installation and management of Eucalyptus requires a robust knowledge of networking, in order to enforce group policies, security, and communication. This has been a bit of a crash course for me in this area.
Terms added to the glossary this week:

Behind on the blogs, sorry for that

Unfortunately I mistakenly deleted my Xubuntu off of my virtual machine instead of Ubuntu, don’t ask me how I managed.  I started over the day before but after I installed Python back, updated boto, paramiko, and all that jazz I get to the point where  thought I was in the clear but two lines down:

eutester = Eutester(credpath=”../credentials”)  – gives me a syntax error “syntax error near unexpected token ‘(‘ and I can’t figure out whats going on.   Been on the IRC for the past few hours, no one has been around to explain this to me.  I tried redoing my credentials but unfortunately that didn’t solve the problem.   Turns out you have to run python before entering any of those commands but now I’m getting file not found, still better than a stupid syntax error.

I figured out my problem, thanks to Coady and testingcloud’s blog.   I ended up getting this:

http://i.imgur.com/Cj6Gp.jpg

I’m glad I got that credentials thing sorted out, now I can start helping out much more.

From the blog jamescelona » WSU CS by jamescelona and used with permission of the author. All other rights reserved by the author.

Week of March 26th 2012

This week in class we first discussed updates on what people have been working on over the past couple of weeks. Various groups provided information regarding where they were at with their portion of Eucalyptus. Our group, (Myself, Dan Adams, and Brian Labbe), decided what direction specifically we would like to take our documenting of the architecture of Eucalyptus. We decided to split up the project into three main portions which include: Storage Controller/Elastic Block Storage, S3/Walrus, etc. I will be working on the Storage Controller/Elastic Block Storage part of the documentation. As references I’ll be using the following Amazon docs: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AmazonEBS.html and http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/concepts.html#storage. This is helpful because I will be able to compare the Eucalyptus storage controller to Amazon’s EBS. I was able to find information regarding Eucalyptus’ storage controller here: http://open.eucalyptus.com/wiki/EucalyptusBlockStorage_v2.0. Using these tools and information I was able to begin to create a document that describes how Eucalyptus’ Block Storage functions.

From the blog nzahid » WSU CS by nzahid and used with permission of the author. All other rights reserved by the author.

EUTester Documentation

This week a new project was created based on my previous post for documenting EUTester. I was finally able to get in touch with Vic Iglesias – who is the main contributor to EUTester. He was thrilled to hear that we were willing to help with documentation. He joked that documenting code wasn’t his strong suite. Thankfully Clark Mattew – another contributor – had already laid out a document on the GitHub project on how to document in code which Vic sent me to (https://github.com/eucalyptus/eutester/blob/master/eutester/euproperties.py). Vic told me that he would try to be available for the EUTester group if we needed any help with documenting or using the tool.

Since I will be away this weekend, I won’t be able to do any further digging in the code unfortunately, but hope to pick up the project next week. I am also going to look into forking the GitHub project for EUTester so that Vic can easily review and merge any of our changes. The only request that Vic had (which I posted on our EUTester wiki page) is that we make individual commits for each method that you are document so that it will be easier for him to go through. I know Matt said he would be interested in joining this project, so we will also have to figure out how we are going to break up the code.

On another note this is the first time that I have used IRC (outside of class) to communicate with people of the project. I have watched the channel before, but it was cool to jump in there and talk to people. The group was very helpful – especially when I tried to talk to Vic at 10:30AM EST, they pointed out he was on the west coast and wouldn’t be awake for a while most likely.

From the blog nathandoe » WSU CS by nathandoe and used with permission of the author. All other rights reserved by the author.

Learning Eutester

So since euca2ools did not have enough work for me to continue at it for the rest of the semester, I decided I ll simply jump on our main project the Eutester project. It has been a good day so far, most things went well I heard some people had problems with version mismatches so I downloaded and installed everything from source code their most up-to-date versions of “all the things” (boto/m2crypto/paramiko/eutester). Reading through the wiki that the eutester group of guys has set up on cs.worcester.edu, and following  some links to blogg posts from the developers, I managed to run some tests on our newly installed Eucalyptus 3 cloud which is still not able to keep a VM instance running.

>>> eucaops.get_emi()
Image:emi-238B37D9
>>> emi = eucaops.get_emi()
>>> reservations = eucaops.run_instance(emi)
Attempting to run instance-store image Image:emi-238B37D9 in group default
Beginning poll loop for the 1 found in Reservation:r-860340D3
Beginning poll loop for instance Instance:i-0696428B to go to running
Instance(i-0696428B) State(pending), sleeping 10s
Instance(i-0696428B) State(pending), sleeping 10s
Instance(i-0696428B) State(pending), sleeping 10s
Instance(i-0696428B) State(pending), sleeping 10s
Instance(i-0696428B) State(pending), sleeping 10s
Instance(i-0696428B) State(terminated) Poll(5) time elapsed (51)
[CRITICAL]: [TEST_REPORT] FAILED: Instance:i-0696428B did not enter the proper state and was left in terminated

 

After some looking around found out about the existence of nc.log file, and here is the portion of the fail runs:

[EUCAFATAL] Failed to connect to qemu:///system
[i-16F93EC9] could not contact the hypervisor, abandoning the instance
[i-16F93EC9] state change for instance: Staging -> Shutoff (Pending)
doDescribeResource: cores=1/2 mem=1604/1732 disk=11/13 iqn=iqn.1994-05.com.redhat:262aa1ddbe2
[i-16F93EC9] Pending pub=0.0.0.0 priv=0.0.0.0 mac=d0:0d:16:F9:3E:C9 vlan=-24 net=-1 plat=linux vols=
[EUCAFATAL ] Failed to connect to qemu:///system
[i-16F93EC9] cleaning up state for instance
[i-16F93EC9] stopping the network (vlan=-24)
[EUCAWARN  ] vnetStopNetworkManaged(): supplied vlan '-24' is out of range (0 - 4096), nothing to do
[i-16F93EC9] state change for instance: Shutoff -> Teardown (Teardown)
[EUCAFATAL ] Failed to connect to qemu:///system

After trying to work my way through an old bug report and fix on the above problem, I decided I should check if Hardware Virtualization, which turned out it was the right idea, because in this case it is turned off in the BIOS.

From the blog Live and Code » WSU CS by dhimitraq and used with permission of the author. All other rights reserved by the author.

Eutester Documentation

This week we really learned about what goes into the eutester code to make things happen. There were several pieces that we could not figure out right away, but we spent this week doing research and we discovered what each missing piece actually was. For example, we had no idea what “paramiko” meant at first, but we discovered that it is an ssh module that allows Python code to be compiled and run remotely. Paramiko needs to be installed in order to run the eutester package. There were a few other small modules that we did not understand at first, but we eventually figured it all out and posted links on the wiki about everything we came across.

Now, rather than linking a Eucalyptus instance to a kernel like we wanted to do last week, we are able to actually run Eucalyptus images and ssh into them, which will save a lot of time. So, in moving forward, the Eucalyptus team decided that it would be very beneficial if we went through the eutester package and documented all of the code. Most of it is undocumented, so it can be tedious to read through, but we have a fairly strong understanding of it now, so we should be able to document it and contribute our changes to the project. This coming week will involve a lot of code reading and documenting, but it should be very helpful in the end.

From the blog trevorhodde by Trevor and used with permission of the author. All other rights reserved by the author.

Our Eucalyptus Cluster

It is finally getting there but still with struggles, right now for example while I am writing this I wish I could instead be connecting to our own cluster and uploading images but port 8773 still seams to be closed when trying to look in from the outside, so I can’t connect to try and work on an instance. While earlier today Long was able to upload kernel images to the server it looks like there is a problem when trying to actually start up an instance on the server which most likely proves right our fears of hardware support for hypervisor being turned off on the BIOS. One might think “big deal” just turn it on; however these are stoke dell machines we are using the BIOS options are basic at best, so we will most-likely have to install things from scratch trying to install an other BIOS on the mother board and finally unlock the hardware support.

And finally we have our definite proof that kvm support is disabled on the BIOS, and here goes an other week without having a working cloud.

From the blog Live and Code » WSU CS by dhimitraq and used with permission of the author. All other rights reserved by the author.

euca2ools install from source(with dependencies)

So some time during week 4 of the project I had some down time, and I decided to learn how euca2ools worked. Simple command-line tools yet still very powerful as well. However recently we run to some problems with the version mismatches; so here it goes: “how to install everything from source with the latest versions”:

Very easy to install from source:
NOTE: make sure to remove older versions of the software.

Download newest boto: https://github.com/downloads/boto/boto/boto-2.3.0.tar.gz

cd /download/location
tar zxvf boto-2.3.0n.tar.gz
cd boto-2.3.0
sudo python setup.py install

Download newest M2Crypto: http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz

cd /download/location 
tar zxvf M2Crypto-0.21.1.tar.gz 
cd M2Crypto-0.21.1 
sudo python setup.py install

Download euca2ools from: https://github.com/eucalyptus/euca2ools

cd /download/location
cd euca2ools
sudo make

And that should be it.

From the blog WSU CS – Live and Code by dhimitraq and used with permission of the author. All other rights reserved by the author.

EuTester Issue Tracker

Following spring break we discussed the current status of our cluster which appears to be really close to complete. We are now nearing the latter half of the semester and it is time to switch into gear. While I have been attempting to install EuTester and connect to the ECC cloud I have also been checking the EuTester Issue Tracker on occassion to see if there are any new updates.

As of right now there are 5 listed issues and or requests:

  • Define Licensing:

    Need to figure out what license we’re offering Eutester under. I presume GPLv3 to be compatible with the Eucalyptus product itself, but we need to be explicit. Also need to make it clear that it’s copyright Eucalyptus.

  • Create a standard set of debug tools available when tests fail:

    When a eutester test fails, we need to provide a standard set of debugging tools back to the user. This debug info should include as much as is necessary to find the possible cause of the behavior. Currently, the Eutester class provides a very basic framework for this, but we’d like to expand it.

  • Create a standardized Eutester log/output format:

    We need to standardize the way we present info about a running test to a user – essentially, output formatting.

  • Testing capability for Jenkins + EC2 Plugin:

    Would like to look at test cases for Jenkins + EC2 plugin and whether this is possible to script. Jenkins has a CLI client but whether this works with EC2 Plugin is another thing: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI

  • Goals, purpose, and guidelines for contributionL

    Need to produce better documentation:

    1) Readme file should be bolsterd
    2) Add more sample scripts
    3) Ensure sane defaults (ie requests go to ECC by default)

Hopefully after some more research I will have a working EuTester build and can connect to a cloud in order to further research some of these issues. I am also going to be looking into the Python language with a little more detail, I am not very familiar with Python and learning it will better help me understand how to configure and run the scripts for each test case. There is an IRC meeting next week that discusses the basics of EuTester hosted by Vic Iglesias who is very involved in EuTester. I would love to attend to learn more because I am not very familiar with command line installs and configuration. Hopefully that classroom will give me a better understanding on how and what these arguments are doing rather than just typing text and hoping for the best. As of now I have gotten both boto and paramiko fully installed and have downloaded all of the most recent EuTester tools, I will update after I figure out how to perform the eucaops import in order to actually start the process. I have a feeling it has to do with where the files are located and the folder permissions, but I have not found a lot of documentation on setting these up correctly.

From the blog michaelkenny2 » WSU CS by michaelkenny2 and used with permission of the author. All other rights reserved by the author.