Wednesday, November 25, 2009

Book Review : VMware Cookbook

VMware Cookbook - A Real-World Guide to Effective VMware Use is written by Ryan Troy and Matthew Helmke. The book has around 255 pages, and 7 chapters.
I have been using VMware products for many years now. It was always a challenge to administer some of these products. Especially, the ESX Servers.

If you are using any of VMware's products like the ESX, ESXi, or the vSphere, this book provides you with tons of useful tips and makes life easier for you as an administrator.

The book has 7 chapters, and each chapter includes several recipes for a specific problem.
Chapter 1, VMware Infrastructure Installation 
As the chapter name suggests, it covers installation for ESX and ESXi. The authors cover both 3.x and 4.0 versions. This chapter also has almost 17 tables showing different configuration maximums for ESX 3.x/4.x which is really going to be useful if you are planning your virtual environment.
Chapter 2, Storage 
In this chapter, the authors discuss about the different types of storage and how to configure and use them within the ESX servers.
Chapter 3, Networking
If you want to configure your virtual switches, software and hardware adapters, Ethernet frame sizes or simply knowing the differences between ESX 3.5 and ESXi 3.5 in network support, this chapter provides recipes for all these items. Also, if you need to create a service console network using the CLI, or you need to know how to use Multiple Gateways, these recipes are included as well.
Chapter 4, Resource and vCenter Management 
If you have used VMware products, than you will be familiar with terms like clustering, HA(High Availability), and DRS(Distributed Resource Scheduler). This chapter discusses several recipes for all these, and also recipes to configure, setup and maintain these resources as well.
Chapter 5, Useful Command-Line Tools 
If you like using command line tools, than this chapter and the recipes here will get you started with those as well. You will learn how to enter maintenance mode using the command line, display server info, emptying a large VM(Virtual Machine) logfile. Also, recipes for monitoring CPU usage, memory usage, storage performance, network usage are also included. There are 46 recipes just in this chapter.
Chapter 6, General Security
Ok, this is the most important chapter if you are concerned about securing your virtual environment. Most are Linux-related, since ESX server uses Red Hat Linux. A few of the recipes in this chapter are as such:
  • Allowing or Denying Users the use of SSH
  • Recovering a lost root password
  • Tracking users via the CLI
  • Configuring Active Directory Authentication
  • Disabling Copy and Paste
Chapter 7, Automating ESX Installation 
This final chapter has recipes which introduces you to configuration files which are needed for networking, startup, which you would want to automate.

If you are a network administrator using the most latest VMware products, than this book is the ultimate guide for you. That said, I am not a network administrator, but many recipes in this book helped me. So, if you are using VMware products; especially ESX servers, go get this book. Highly Recommended.

Tuesday, November 24, 2009

Hudson + Sonar = A Perfect Match!

Last week, I blogged about "Continuous Quality Using Sonar". It requires just 5 simple steps if you have Hudson running as your CI(Continuous Integration) server to install and use Sonar. Yes, 5 simple steps is all you need to get a neat and intuitive dashboard from Sonar. So, lets see what those 5 simple steps are.

Step 1: Download, install and start the Sonar Server. 
Download the latest Sonar release from here. Unzip the distribution to your favorite location, mine was in C:\dev\projects\sonar-1.11.1. Based on your platform, run the batch file or the shell script from within the bin folder. On windows, it is C:\dev\projects\sonar-1.11.1\bin\windows-x86-32\StartSonar.bat.
Open a web browser and browse to http://localhost:9000. The default login and password is admin/admin.

Step 2: Install and Configure Sonar plugin on Hudson.
Open your Hudson dashboard. Mine is located at http://localhost:7223. Click on Manage Hudson - Manage Plugins. Click now on the Available tab, you should see the Hudson Sonar Plugin. Check this plugin and click on the Install button at the far right hand corner.
Restart Hudson and you should be able to see the plugin in the Installed tab as shown below:

Next, configure the Sonar plugin from within Manage Hudson -> Configure System. I am using the default database, and so didn't make any changes here. However, if you are using a different database server, you need to provide the database URL, username, password and so on as shown below.

Step 3: Configure your Hudson Job 
In order to activate Sonar on a project, click on Configure, and within the Post-build Actions, check Sonar and you should see the following properties. Fill those properties and Save this configuration.

Step 4: Build your project
Even though you don't require Maven to be used as a build tool for your project, Sonar does still require Maven to run. If Maven isn't installed, you can download and install Maven from here.
Force a build on your Job on the Hudson dashboard. If Maven is installed, you should be able to see the following output in the Console Output on Hudson dashboard.

Step 5: Browse to Sonar Dashboard
Once the build succeeds in the last step, browse to http://localhost:9000. And you should be able to see the Sonar Dashboard as such:

That's all it is to download, install, configure and get continuous quality updates from Hudson and Sonar. The above steps took me less than 15 minutes.

I am sure many of you are already using Sonar. I haven't used it with any of my clients yet. Hopefully, will do so soon. Share your thoughts if you are using Sonar.

P.S: In case you are using other CI servers, no need to panic. You can read a detailed documentation here for all the CI servers Sonar supports here.

Friday, November 20, 2009

Continuous Quality Using Sonar

The first time I looked at Sonar was almost an year ago. At that time, Sonar worked with just Maven and most clients I was working were using Ant. The other reason I didn't dig deeper into Sonar was because we already had written a Plug-in to generate a dashboard using FuseMetrics. You can read more about FuseMetrics and what it does and an article I wrote for Javalobby here.
Last week, one of my colleagues asked about Sonar, and that's when I decided to have another look. Sonar now has a Hudson plugin, and in just a few minutes I was able to download Sonar, install the Hudson plugin, make some changes within my project in Hudson, run a build. Within minutes, I was able to browse my project and look at the dashboard from within Sonar. Awesome.

Yes, it took just a few minutes. Of course, you should have Maven installed on your machine.

Sonar and Hudson are a perfect match if you are conscious about the quality of your code.

Stay tuned for a detailed post about Hudson and Sonar in a few days.