Dissociated Press

Using CloudFormation Templates With CloudStack

This is pretty damn cool, check out what Chiradeep has been working on:

AWS CloudFormation provides a simple-yet-powerful way to create ‘stacks’ of Cloud resources with a single call. The stack is described in a parameterized template file; creation of the stack is a simple matter of providing stack parameters. The template includes description of resources such as instances and security groups and provides a language to describe the ordering dependencies between the resources.

CloudStack doesn’t have any such tool (although it has been discussed). I was interested in exploring what it takes to provide stack creation services to a CloudStack deployment. As I read through various sample templates, it was clear that the structure of the template imposed an ordering of resources. For example, an ‘Instance’ resource might refer to a ‘SecurityGroup’ resource — this means that the security group has to be created successfully first before the instance can be created. Parsing the LAMP_Single_Instance.template for example, the following dependencies emerge:

Check out the full post. Looking forward to seeing how this develops.

Doing It Twice? Write It Down!

There’s a great meme going around about geeks and repetitive tasks. Because geeks will often get annoyed at the effort of doing something manually, they often decide to find a way to automate it – which usually involves a lot more effort than doing it the one time but “geeks win, eventually” because they save time in the long run.

But in the long run we’re all dead. Then what? Who knows how to run your script? What happens when it needs to be maintained? As Jon Udell points out, it’s really not a contest, it’s a process, and non-geeks can play too. Which is why you should also write it down if you’re going to do it more than two times.

OK, “doing it more than two times” is a huge generalization. What I mean more specifically is:

  • If you’re in a team environment or doing work that will keep cropping up.
  • If you’re doing a task that is non-obvious and/or has a complicated series of steps that is non-obvious to people who are not you.
  • If you’re in any kind of critical path that would block shipping or operations if you aren’t there to do the magical things you do.
  • If you want to reduce your project or organization’s Bus Factor (help other people become proficient).
  • If you want to better understand what you do and how you can improve it.

Then you need to take a step back and document the things that you do on a regular basis, because it will help your teammates and (most likely) even you when you come back to a task that you haven’t done for a long time.

Naturally, I’m thinking of this in terms of a project like CloudStack where documentation is vitally important. The success of a distributed team depends a great deal on good documentation.

An Example

Yesterday I spent the better part of the day doing something that, by rights, should have take 30 to 60 minutes – depending on the whims of the bandwidth gods while copying up docs to the server.

Unfortunately, what I was working on was not well-documented. This isn’t surprising, it’s something we’ve only had to do as a project twice and the first time was the “let’s figure out how to do this” run. I captured some of the documentation during the second run, but not in enough detail and missed one step that wound up setting me back by a big chunk of time.

How this could have been avoided: The second time we did this, as a project, it should have been well documented and put up on the wiki.

Getting it Down

While you’re working, keep a scratch (text) file open at all times. Shell history is nice, but it’s often hard to decipher after the fact, especially if you have a lot of trial and error going on.

When you run a command or do something that works, put it in the file. Even if you do nothing more than make public a list of steps that worked for you, it’s light years ahead of having to start from scratch.

After you’ve done $task, take a few minutes to brush up the list you’ve created and (if necessary) fill in any gaps like the requirements needed to run the commands you’ve used, the files you need, where to get source – whatever. Just think about how you got to the state you were in before Step 1 that may not be obvious to anyone else.

Plain text is absolutely fine, and usually preferred.

Getting it Out

If your project uses a wiki or something like that, now’s a good time to put it in the appropriate place in the wiki. Note that putting documentation in an obvious place is sometimes as important as creating the documentation in the first place. A hidden README file in a disused directory on SVN isn’t much help if your project usually looks to the Web for its docs.

You can, and also should, put it up on a blog. This is not a natural impulse for most hacker types, but more’s the pity that it isn’t. First, you can get feedback that way from people you’ve never even heard of. You may take it with a grain of salt, but you may also learn something you never would have learned any other way from someone who is an expert at what you’re an neophyte at. (Note, this can also serve as a resume addition of sorts that demonstrates to employers that you are capable of putting words on paper, and that you’re constantly learning.)

Finally, assuming you’re doing it with a project or organization: announce your new docs on the appropriate mailing list. This way anyone who has an interest can benefit from your new docs, and you also can enjoy a little peer review. (Note, make a practice of thanking people if you see this happening, as a little encouragement is nice and shows that – yes, someone actually just received the message in a bottle that was just sent out.)

Share Your Brain

If you’re the type of person who’d rather automate a task than repeat it, then you should also think about helping others (and future you) avoid having to repeat learning how to do something you’ve already figured out. The extra time that it takes to document something is no different than the extra time it takes to write a script; it’s saving work in the future by doing a little extra now.

Reverting an SVN Commit

I’ve never quite gotten the hang of Subversion (SVN). Most of the stuff we do on CloudStack is in a git repository, but the Website is managed with the Apache CMS and stored in SVN.

While working on the 4.0.2 docs release yesterday, I found that I didn’t quite have all the steps worked out for committing docs to the Website. (We’ve only had two releases so far, and David Nalley took care of building and releasing the final docs on those.)

To make a long, frustrating, story a lot shorter: I found an occasion to need to know how to do an SVN revert and realized it’s not just like git when it comes to doing a revert. Git makes doing a revert pretty damn easy, whether you’re reverting a local change or a change you’ve already committed to the main repo. Subversion also makes doing a revert easy locally:

1
svn revert /path/to/filename

That’s simple enough. But what if you’ve already sent your changes to the main repo? Then it’s a little trickier, but not impossible.

  • Get the revision number of your commit. Sooner is better (I’m not sure how easy this would be if you’re trying to revert a change a month later if there’s been a lot of changes around it in the meantime.)
  • Do an svn update:
1
svn update
  • Then you’re going to (and this isn’t terribly intuitive) do an svn merge to walk it back:
1
svn merge -c -XXXXXXXX https://svn.apache.org/repos/asf/cloudstack

(Naturally, you’re going to want to replace the URL to the repo with your own, rather than CloudStack’s. And replace XXXXXXXX with the number of your own commit.) The -c -XXXXXXXX means change in reverse. + Now, do an svn status to make sure that it’s properly undone what you wanted undone. You can do an svn diff (svn di) as well if you want detailed changes. + Finally, you’ll go ahead and commit the changes if you’re convinced all is well:

1
svn commit -m "Oops"

(The oops is actually optional.)

Folks who work with SVN regularly no doubt know all this, but I know there are plenty of folks like me who touch SVN infrequently and might run into trouble.

Four vs. Six Months

The decision to have time-based releases was made early on with the Apache CloudStack project. It’s fairly standard these days to go with time-based releases rather than feature-based releases, and makes a lot of sense for projects that are primarily aimed at use in corporate IT.

While coming to the decision of time-based vs. feature-based was easy, coming up with the actual length of a release cycle is trickier. Everyone wants the release yesterday, so there’s a strong desire to have a shorter cycle. But a shorter cycle puts pressure on folks to actually get the release out, and a shorter cycle (especially for newer projects) seems more difficult.

We decided initially to go with four-month cycles, but [that decision is being revisited|http://markmail.org/message/3ctdwor5hfbpa3vx] right now, with a lot of the community leaning in favor of six-month cycles.

I’d be curious to hear from other projects exactly how they came to decide the length of time-based release cycles. In Linux distribution circles, six-month cycles have been popular – though it looks like Ubuntu is fiddling with that a little bit, and AFAIK, Fedora has generally come closer to seven-month cycles when all is done and said.

For the record, I don’t think we’ve got enough data to decide that four month cycles aren’t workable. I’d really like to see the community take 4.2.0 as the cycle to really refine processes, get more automated testing in place, and try to get documentation folks working together a little better before saying that six-month cycles are a better fit.

4.0.2 Release Status: Looking Good

Third time’s the charm? Here’s hoping. David Nalley noticed a problem with the nonoss build in 4.0.2, so I canceled the VOTE and re-rolled 4.0.2 with the -SNAPSHOT bits removed from the offending pom.xml files, and started a new VOTE on Saturday morning.

We have already had several +1’s for this release, but more testing is always better!

If you have the time, please download the candidate and follow the testing procedure.

Sebastien Goasguen has whipped up a screencast that walks through the testing procedure as well.

Since 4.1.0 should be an easy upgrade from the 4.0.x series, and should introduce no API or feature regressions, this will almost certainly be the last 4.0.x maintenance release. A VOTE on 4.1.0 should be up soon, so that release could be out before the end of April. Assuming no -1’s on this release, the VOTE will end on Tuesday and the release will go out on Wednesday.

Return of VOTE: 4.0.2’s Revenge

This time it’s personal. (I have lots of b-movie clichés, but I’ll stop now…) The second candidate is now ready for voting.

Due to a few issues, I had to cancel the first 4.0.2 vote on Wednesday. Thanks to Sebastien and other folks who took the time to test the candidate and find issues!

That gave a little more time to fix a few more bugs, though it looks like we’re not going to be getting CLOUDSTACK-528 fixed for this release.

VOTE Is Open for Apache CloudStack 4.0.2

It’s taken a lot longer than I had planned, but the VOTE is now open for Apache CloudStack 4.0.2.

The CHANGES for 4.0.2 are up to date, I believe. As a maintenance release, there are no new features and should be no database changes or API changes – just pure bugfix goodness.

Please take a look at the release and give it a spin, the vote is open for a minimum of 72 hours. More eyes are always better. I’m hoping it’ll be ready to roll on the first try, but I’d rather hear about any show stoppers or problems now rather than after we’ve done a release!

Using WordPress for My Personal Notebook

The blogging fad seems to have passed, but it’s been something I’ve enjoyed for well more than a decade and I don’t see myself stopping anytime soon – even though I’m no longer writing for a living, writing and publishing is something I can’t give up.

At the same time, I’ve always found it difficult to use and stick with note-taking tools like Evernote. They just don’t quite fit with my workflow, and I can never quite get over the fact that I’m using a proprietary tool for something that’s really important.

Finally, I decided to stop going against grain and set up a personal WordPress instance on my laptop to use to collect notes, keep a daily log, and dump “to be read later” things into.

Seems obvious in retrospect: WordPress has a pretty similar feature-set compared with Evernote, and offers a lot of additional goodies as plugins (like a calendar). I like the interface for posting in WordPress more than I like Evernote’s interface, and it’s dead easy to keep a backup of the WordPress DB and it’s very portable.

Bitnami makes “stacks” with WordPress that you can slap onto Linux, Mac OS X, or Windows in about three minutes without having to configure much of anything. Piece of cake. (Not that WordPress is particularly difficult to install in the first place.) I know that’s not what WordPress is created for or optimized for, but it’s working great. If you’re looking for an Evernote-like tool that’s open source and flexible, give it a shot.

Graduation Day! Apache CloudStack Leaves the Nest

The board voted last week, but the announcement came out today, so it’s officially official: Apache CloudStack is now a top-level project under the Apache Software Foundation (ASF).

In the grand scheme of things, this may not sound like a big deal – the ASF announces new TLPs pretty often, and Apache currently boasts more than 100 TLPs. But a fair number of projects don’t make it, and the amount of work required for a project to go from incubation to graduation isn’t trivial.

Code Maturity

Many folks confuse incubation status with the maturity level of the code. It’s really important to understand that there’s not a direct correlation between the status of the code and the status of the project in the incubator. CloudStack, for example, entered the incubator as a mature project with quite a bit of real-world adoption.

Even if a project enters the incubator with an immature codebase, there’s no guarantee of graduation simply because the code becomes mature enough for production use – graduation is predicated on a different set of criteria, and releases are only one factor.

Meeting the Hometown LUG

Linux User Groups (LUGs) were a really important part of Linux’s success in the early days when there was little corporate support for Linux, and things were a lot more primitive. Have problems getting that new video card to work? Ask the folks at the LUG, odds are somebody’s already figured it out. Run into a problem getting the latest Red Hat release to work with your SCSI card? Ask the LUG.

LUGs aren’t quite as crucial to the Linux experience these days – but you’ll still find some healthy and active LUGs where you can meet other Linux users and learn a lot. (Even if you’ve been using Linux for more than 10 years, you’ll probably learn something new at every meeting.)

Which is a long-winded way of me saying, I’m awfully happy I was asked to speak at the St. Louis LUG last night, and had a great time. I’m definitely planning to return for a meeting where I can take a turn being in the audience and have time to go out with the group for pizza and beer.

The CloudStack presentation seemed to go over quite well, and it was fun presenting to a smaller but very engaged group of folks. (I think the group was a bit shy of 20 people.) People asked some really good questions, and I had time to do a short demo and show off some of CloudStack’s features and the UI.

Thanks much to the STLLUG folks for inviting me out, it’s great to be in touch with the hometown LUG!

(Image courtesy of Flickr User happysteve)