Using golang with Eucalyptus

Posted: 2014/04/24 13:24:30

Here is an example code to start a new instance in your Eucalyptus cloud using golang. We are using goamz library.

package main

import (
    "fmt"
    "github.com/mitchellh/goamz/aws"
    "github.com/mitchellh/goamz/ec2"
    "net/http"
)

func main() {
    DefaultClient := &http.Client{
        Transport: &http.Transport{
            Proxy: http.ProxyFromEnvironment,
        },
    }

    auth := aws.Auth{"AKI98", "5KZb4GbQ", ""}
    mec2 := ec2.NewWithClient(
        auth,
        aws.Region{EC2Endpoint: "http://euca-ip:8773/services/Eucalyptus"},
        DefaultClient,
    )

    options := ec2.RunInstances{
        ImageId:      "emi-F5433303",
        InstanceType: "m1.xlarge",
        KeyName:      "foo",
    }
    resp, _ := mec2.RunInstances(&options)

    fmt.Println(resp)

}

Comments

FOSSASIA 2014 (Event Report)

Posted: 2014/03/14 14:56:45

This was my first FOSSASIA. The event was in Phonm Penh, Cambodia. We reached the city one day before the event. The night before the event there was a pre-event meetup with the speakers and volunteers. There were 71 speakers from 21 different countries. Met few old friends after long time and made some new friends.

I spent the most of the night in room 317 with Praveen and Gnokii preparing the demo during my talk.

Day one started with a packed house. We all were in the top hall. Mario and Dang Hong Phuc gave an introduction about the whole event. After that there were many talks from the projects. I want to mention two talks from there. In one talk the Swedish Ambassador Anna Maj Hultgård talked about ideas Sweden stand for and all the freedom aspects in life. It is great to see her on twitter.

Cat Allman from Google talked about past, present and future of GSOC. “Teaching mailing list etiquettes to students” is very important and her slides proved that again. You can share Mbuf’s presentation on the same to the new people.

Kate Chapman’s talk on OSM was also important for the students. Later in her workshops and talks she demoed lot of things in full details.

Fedora team had a room at the end of hallway and we started our talks there. Gnokii gave some nice introduction to Fedora project, Tunta’s talk was also in the same pace. My talk was about testing Fedora cloud images in Eucalyptus cloud. You can find the slides online.

If you want to see the actual steps and output, download and install this tool in your Fedora 20 system. You can use this tarball and install it or install playitagainsam using pip tool.

Then download this json file and run the tool like below.

$ pias play fedora_eucalyptus.json

Press any key and see the magic. You have to press enter for real life enter events though :D

On second day I gave my talk on “Document your code”, slides are here.

Spent many hours talking with other speakers, talks continued to the after event parties, one such was in a boat on the river. It was good to see that many speakers already tried previous versions of Eucalyptus. I talked more about current features of Eucalyptus.

Last day of the event was in Open Institute. We had a Fedora workshop sessions there. People were introduced to the different parts of the project. We found our first ambassadors from Cambodia. From India 3 people also started their journey with Fedora. I introduced gpg and ssh to the people and we had a small key signing party in the same place.

The total experience of FOSSASIA is good, it was meant to be a place to meet fellow developers and discuss and hack on new things. I was happy to meet Praveen Patil in this event. He will be become a good contributor in Fedora Project just like Sarup started doing these days. I also learned a few things from him about Expeyes project.

I should thank Mario and Hong Phuc and all other volunteers of the event to make it a grand one. You can find all the photos from the event in my flickr set.

Comments

Why private cloud matters to the students?

Posted: 2014/02/21 19:56:50

Many students already asked me this. They all want to do project work or just want to see what is cloud but not sure how that helps. So this post is for those students who are still wondering if they should install a private cloud or not.

You want to learn about Cloud

Cloud is still new in the market. You want to have a look or just want to learn the basics. Having a private open source cloud will fit in your budget as you don’t have to use a credit card (which most students do not have anyway). You can install them in your old desktop and keep learning different technologies in this field.

Saves money

As in the last paragraph we know that with private open source clouds you don’t have to spend money to learn.

Using Cloud just as a tool to learn other new technologies

After installing a cloud at your house or hostel room you can just use it to learn other latest technologies. You will not be spending time to setup new vms or computers, instances are cheap, after you are done with them or if you mess up stuff, you can just terminate them and start new ones. For example I used my cloud on my desktop to learn Ansible. I was creating couple of CentOS instances and trying out on them. When ever I wanted to test my scripts I just started new instances and run against them.

Learning about features of new distributions

Almost every major Linux distributions release their own cloud images, which are small in size too. You can just install them in your cloud and try out the distributions. Fedora cloud sig always pushes newer images which you can use. To download them visit this link <http://fedoraproject.org/en/get- fedora#clouds>_.

The easiest option to have a private is Eucalyptus Faststart and the install docs are here.

Comments

Cloud on desk

Posted: 2014/02/18 10:02:22

I am moving the development/testing work inside similar instances I use in Linode. The current dev/testing environment seats on table and looks like this.

image

Yes I know I have to fix the cables but for now this works great. Adding cloud images of different distributions I test against. In case you want to know what is inside look at the screenshot.

image

Comments

Who wants a cloud?

Posted: 2014/02/10 10:10:01

In case you are looking for a cloud which you can deploy in your own infrastructure and manage it easily without needing an army of devels & admins, you should have a look at Eucalyptus, the source is in github.

Here is a screenshot from someone’s cloud, a large cloud actually.

image

Comments

s3cmd and Walrus for your private object storage

Posted: 2013/12/26 09:27:05

What is s3cmd?

s3cmd is the command line tool to access files in the Amazon S3 object storage. It is written in Python.

What is Walrus?

Walrus is the object storage of Eucalyptus.

Few more terms

Objects : All files which are stored in the object storage are known as objects.

Key : The filename of an object is known as key.

Bucket : It is the name of the place where people store the files, it behaves like directory with some limitations. Buckets must have unique names.

Install the latest s3cmd from Eucalyptus fork

Install latest version of s3cmd using git in a virtual environment.

$ virtualenv s3
$ source s3/bin/activate
$ git clone https://github.com/eucalyptus/s3cmd
$ cd s3cmd
$ python setup.py install

Configuration file

The default configuration filename is .s3cfg

Following is a minimal example.

[default]
access_key = MRKEEDJHJKQRLMV3K2FB94
secret_key = 3Jy1VKDZmVpwdsffdf8d2PsmfhVojfAW8RmFO2FD
host_base = 192.168.1.100:8773
host_bucket = 192.168.1.100:8773
service_path = /services/Walrus

access_key and secret_key are from your eucarc file. You also know the ip of the host.

To list buckets

$ s3cmd ls
2013-12-24 16:27  s3://foolto
2013-10-19 13:56  s3://mybucket
2013-10-24 15:35  s3://official
2013-12-03 14:47  s3://snapset-5599d8c1-296f-480f-b2be-1e2b03933e42

To list contents of a bucket

$ s3cmd ls s3://foolto
                       DIR   s3://foolto//t2/
2013-12-24 16:51     52680   s3://foolto/lscpu

To create a new bucket

$ s3cmd mb s3://testbucket
Bucket 's3://testbucket/' created

Uploading a file to the bucket

$ s3cmd put .s3cfg s3://testbucket/sample-configuration.txt
.s3cfg -> s3://testbucket/sample-configuration.txt  [1 of 1]
213 of 213   100% in    0s   668.66 B/s  done

In this example we uploaded the configuration file to the testbucket. We can list the bucket content once more.

$ s3cmd ls s3://testbucket/
2013-12-26 04:57       213   s3://testbucket/sample-configuration.txt

Downloading an object from the bucket

$ s3cmd get s3://testbucket/sample-configuration.txt
s3://testbucket/sample-configuration.txt -> ./sample-configuration.txt  [1 of 1]
213 of 213   100% in    0s  1315.45 B/s  done

Delete an object in the bucket

$ s3cmd del s3://testbucket/sample-configuration.txt
File s3://testbucket/sample-configuration.txt deleted

You can learn more about s3cmd from here. If you want to learn about more configuration values available, you can check this link.

Comments

Sessions on Eucalyptus

Posted: 2013/12/24 13:36:13

Yesterday we had a session on Eucalyptus in my house. Total 7 people attended the session including me. We started with an all-in-one cloud installation on the Inter NUC(s). After the cloud is up and running, I installed Fedora 20 cloud image on it.

During the installation we had some nice discussions around different technology choices and features of Eucalyptus. Few people also noted the key differences and similarities between OpenStack and Eucalyptus.

Today evening we had a session on “Open Cloud” using Eucalyptus Community Cloud on #dgplug channel on freenode. 15 people attended the session. We went through the different parts of the user console. People created security groups and key pairs. Everyone started their own instances (with little hiccups) and sshed into them. The UI is simple enough for the students to get the idea.

In future I will be doing more sessions on IRC, starting from installing your own private cloud to learning different technology using cloud. I will also put the notes on my blog. If you think I should cover any particular piece

Comments

Fedora 20 on Eucalyptus

Posted: 2013/12/18 07:44:19

We have another great release, already 10 years over. I still remember the day I read about Fedora for the first time, I was still running RHL7.3, never upgraded from there. Had some mixed reaction about the announcement but after trying out Fedora Core 1, it was all fun.

Over the next few years, myself became part of the amazing community. People were from every part of the world, made some great friends and, we go along very well still now. Releases after releases, people worked very hard to make sure things are in shape. Thanks to all those volunteers who made this possible.

I am still waiting for the new laptop, as soon as I get it, my first step will be to install Fedora 20 on it. I am already running it in my private cloud at home and now you can also do that very easily.

Yesterday I packaged the official cloud image into an eustore image and, it is now live in emis.eucalyptus.com and, also on Eucalyptus Community Cloud. If you are running a private cloud, you can just install with the following command

# eustore-install-image -i 0355237665 -b testbucket

If you have an account in the community cloud, you can start a new instance with Fedora 20 or you can apply for a new account here.

Comments

The week without pants

Posted: 2013/12/09 11:44:15

The idea of this blog post comes from a book tile, The year without pants, you should read that.

Last Monday, I joined Eucalyptus Inc. , a company located in Santa Barbara in USA with employees in different parts of the world. Yes, this is my first full time remote job and this post is about the experience of the first 5 days.

On day one I started with fixing my new work vm (as I am yet to get a new laptop) and setting up different work related accounts (emails+vpn+ldap etc). As IRC is the primary means of communication, I found it very easy to join in the conversations, other than the few minutes of mistyping the password :(

On day 2 and day 3, I got access to the test servers to try out different setups and getting familiar with the system. Meanwhile one of the senior team member gave me a visual tour of the community part of the forum and I am now taking care of the questions there, along with other community members. The primary IRC channel #eucalyptus on irc.freenode.net was already in my auto join list for the last few years, so talking there was exactly the same but now I can help others more with my newly acquired knowledge :)

Work timing is not fixed, for the next few months I will find out a more suitable time line for the day, for now I am getting up and coming online around 9am so that I can still chat with my colleagues who are going to sleep in their timezone. I also stay awake late (which is an habit of last 13 years) and spend time over IRC discussing various things in details.

For the first few months I am working with the support team, to learn more about the system (which is similar to Scott’s experience). People ask different type of questions, starting from configuration values to different parts of webui. The learning is fun and as I am trying out different parts of the documentation as a newbie, I guess that becomes a test on “How good is the documentation?”.

The fear of being left alone while working remotely goes around in many friends’ mind. This was not the case with me, I already knew few people in the company from IRC channels and people also use a voice system mumble, which is giving a more personal touch. BTW, you should watch this talk from the github folks on their effort with remote workers.

On Friday, I went to Deependra’s house, to learn and discuss things over few glasses of coconut water and superb laddus :p

Today is Monday, a new week already started. The friendliness and welcoming gesture people showed, is common in many different FOSS projects and very good for a new person to join in and to blend in the culture. In the coming weeks I will learn more and write more on my experience. For now, time to go back to the other ssh shell.

Comments

Contents © 2004-2014 Kushal Das - Powered by Shonku