Category: Linux

My initial experience with Antsle, a virtual machine appliance

I love virtual machines and containers because they make it easy to isolate the applications and dependencies I’m using for a particular project. Tools like Docker, Virtualbox, and vagrant are indispensable for most of my projects and I’m still using those, but in this post I’ll describe a product called Antsle which has given me additional flexibility and has freed up some local resources.

My daily developer workstation is a MacBook Pro with 16 GB of RAM and a 500 GB SSD. From a memory and CPU perspective, it can handle running a handful of virtual machines simultaneously without a problem. But disk space is starting to be an issue.

I use vagrant and Ansible to make virtual machine provisioning repeatable–I can delete any VM at any time without remorse because I can always recreate it easily. But I get tired of continually cleaning up machines and pruning back base boxes just to reclaim space.

I decided to do something about it. My options were:

  • When Apple releases a MacBook Pro that can take 32 GB of RAM, buy that with at least 1 TB SSD, then continue with my current toolset.
  • Buy a Mac Pro or some other desktop to use exclusively for virtual machines.
  • Buy or build an actual server and set it up with virtualization. Something like this, for example.
  • Use AWS for my development virtual machines.

Then I came across a little company based out of San Diego called Antsle. Antsle builds virtualization appliances. What makes their product attractive to me versus buying a workstation or server or building my own is that:

  • The machines have no fan or other moving parts–they are completely silent. The case acts as a heat sink.
  • The machines are energy-efficient. The docs say mine will run at 45 watts.
  • They are built on Linux with standard virtualization technology (LXC and KVM) plus some additional optimizations from Antsle.
  • They are ready-to-go out-of-the-box, saving me the time and effort of building my own solution.

I really like using AWS, and I think for production workloads, no one, not even your own internal IT data center, can do it cheaper or more securely. Plus the breadth of their service offering is nuts. But for my modest developer needs, I’m pretty sure I’ll break even within a year, and that’s not counting the productivity gain of not having to wait for instances to spin up or having to fool with the complexity of the AWS console.

So, after that analysis, I was ready to buy. The biggest struggle was to decide which model to buy and whether or not to do any upgrades. I went for an Ultra, which has an 8-core 2.4 GHz Intel processor, 32 GB of ECC RAM and two Samsung EVO 850 1 TB SSD drives. The drives are mirrored so that’s 1 TB of space. I could have expanded the RAM to 64 GB and increased the storage up to 16 TB, but it was hard to justify the added expense based on my needs.

My Antsle arrived last week and I’ve been pretty happy with it so far. I’ve got a set of “base” images created so that I can easily instantiate new machines based on typical components and configuration. For example, I have an image for every recent Alfresco release. When I need to work on one for a client project or to help someone in the forums, I can just clone one of my base images and start it up. I can let it run as long as I want without worrying about cost, and then kill it or keep it around as needed.

Here is a summary of my experience, thus far:

  • No setup necessary. I plugged it in, started it up, and was starting up machines in minutes.
  • Creating machines from templates, cloning machines, taking snapshots, and startup/shutdown happens very quickly.
  • Templates and instantiated machines take up less space than I would have thought, which is great. So far, I’m glad I stuck with the base storage option.
  • I haven’t pegged the CPU yet, but I have seen it spike briefly to as high as 50%, and that was when I was only running a single VM. I continue to see brief spikes here and there, but as I won’t have too many machines under load at any given time so I’m not that worried about it yet.
  • Documentation seems thorough and helpful. The company has been really responsive and helpful so far as well. They responded to a minor billing issue quickly and resolved it without a fuss.
  • I noticed when you clone a machine that has a bridged network adapter, the MAC address doesn’t change. You have to drop and re-add the NIC if you want a new MAC address, otherwise DHCP will assign it the same IP address as the original machine. This isn’t a big deal once you know the behavior.
  • I had to change the vm.max_mem_map setting to make Elasticsearch happy, which is a typical setup task for Elastic. It took me a minute to realize that needs to be done on the Antsle host and applies to all guests–it cannot be done on the individual VM, at least for LXC.
  • There does not appear to be a way to tag or comment on virtual machines. Additionally, the name you assign to each image is fixed-length and fairly short. So I’m somewhat concerned that, as my library grows, I’ll start to lose track of what’s installed on which machine. AntMan, the management console, seems to be evolving fairly rapidly so maybe this will change in a future release.

I’ve also created a few videos if you want to see it in action.

This video is the unboxing.

This video shows an Ubuntu and a CentOS image being created and then configured for bridged networking.

This video shows how image templates work and gives you a little bit of a feel for the performance using a real-world app (in this case, Alfresco running on CentOS) while other machines are running simultaneously (one Mail/LDAP machine and a four-node Elastic cluster).

 

 

Just for fun: Docker Swarm on my 4-node Raspberry Pi cluster

I recently spent some time standing up a four-node Raspberry Pi cluster running Docker and Docker Swarm. I had no real practical reason to do this–it just sounded fun. And it was!

Docker is a technology that allows you to package your applications together with the operating system into a virtual machine, called a container, that can run anywhere. Docker Swarm establishes a cluster of hosts which can be used to run one or more Docker-based containers. You tell Docker Swarm which containers you want to run and how many of each and it takes care of allocating those containers to machines, provisioning the containers, starting them up and keeping them running in case of failure.

For example, suppose you have an application that is comprised of a web server, an application server, a database, and a key-value store. Docker can be used to package up each of those tiers into containers. The web server container has a thin operating system, the web server, and your front-end code. The application server has a thin operating system, the application server, and your business logic. And so on.

That alone is useful. Containers can run anywhere–local developer machines, on-prem physical hardware, virtualized hardware, or in the cloud. Because the applications and the operating system they run on are packaged together as containers I don’t have to worry about installing and configuring the infrastructure plus the code every time a new instance is needed. Instead I just fire up the containers.

With Docker Swarm I can say, “Here is a fleet of servers. Here are my containers that make up my stack. Make sure I always have 6 web servers, 3 app servers, 2 databases, and 3 key-value stores running at all times. I don’t care which of the servers you use to do that, just make it happen.” And Docker Swarm takes care of it.

This works surprisingly well on Raspberry Pi. Sure, you could do it on beefier hardware, but it’s pretty fun to do it with machines no bigger than a pack of cards. I used a mix of Raspberry Pi models: 1 2b+ and 3 model 3b’s, but I’ve also seen it done with Pi Zero’s, which are even smaller.

The examples I’ll reference in the links below do simple things like install a node-based RESTful service that keeps track of a counter stored in Redis. But once you do that, it is easy to see how you could apply the same technique to other problems.

If you want to try it yourself, here are some resources that I found helpful:

If you don’t already have a multiple Raspberry Pi set up, here is a shopping list (with Amazon links):

I already had a 2b+ sitting around so I used that with 3 model 3’s. The performance difference between the 2b and the 3b was significant, though, so if I do much more with it I will replace the model 2 with another model 3. My existing model 2b+ has a Sense HAT attached to it, which, among other things, gives me a nice 8×8 RGB LED matrix for displaying messages and status indicators.

When it is all put together, it looks like this:

Last year I used my Raspberry Pi as part of a hands-on class I gave to some elementary school students for Hour of Code. I haven’t settled on what I might do for them this year or whether or not that will leverage my new cluster, but it is handy to have Docker running on my Pi’s because I can set stuff up, tear it down, and relocate it much more easily.

Why I’ve Switched from Ubuntu to Mac

It pains me to say it, but I’ve left Ubuntu as my primary OS and switched to Mac. I used Ubuntu as my primary operating system on my Dell laptop for over two years. I loved it. I felt very productive in the OS, especially relative to Windows. Many people have commented on how excited I must be (“Dude, you’re getting a Mac!”) but for me it kind of feels like it did when we moved out of the house our kids were born in–I know we moved for the right reasons, but the old place was special to me.

 

So why the switch? With Ubuntu there were a few annoyances. The major ones included:

 

  • Palm Treo synchronization. Worked in Gutsy once then started working fine after upgrading to Hardy Heron so this one wasn’t ultimately a factor.
  • OpenOffice.org incompatibilities with Microsoft Office. At Optaros we’ve tuned most of our standard documents to work with both. Just to make sure I always sent a PDF version of documents and presentations along with the original.
  • Broken wireless with the upgrade to Hardy Heron. Worked great in Gutsy. Completely broke in Hardy. The problem is a bug in Network Manager related to the Intel wireless device in Dell laptops. I learned to live without wireless.
  • Unreliable display detection. This is correctable with edits to xorg.conf, but when my machine couldn’t detect the projector settings, it was usually 10 minutes before a pitch which is a bad time to be fooling with that file.
  • Inability to host a Webex. I worked around this one by dual booting, running a virtual machine image, or using an alternate machine. Co-workers running Gentoo don’t seem to have a problem with Webex so I’m not sure what was going on here.
  • Gnome instability. Every once-in-a-while, I’d hear my hard drive start swapping and then–boom–all of the “file menu” frames around all of my active windows, and all of my Java processes would simply go away. There was no way to recover without restarting X (ctrl+alt+backspace). Gnome is probably not an accurate description of where the problem was here.

Could I have fixed these issues? Given enough time, probably. But I’d rather spend my time elsewhere rather than fooling around with stuff that ought to “just work”.

 

I realized that what made my development so productive on Ubuntu was:

 

  • Being able to install software quickly and easily through apt-get
  • Working with the same command-line tools I enjoy working with on Linux and Unix servers
  • Building and running open source technology on its “target” platform
  • Having complete control over what is installed and running at any given time
  • Enjoying increased stability and performance (gnome issue aside) compared to Windows
  • Never having to worry about procuring a license
  • Finding helpful community and online resources for self-support

Ultimately it was my former colleague and friend, Tom Pierce, a fellow Linux lover and Mac user, who convinced me that with a Mac I could keep the productivity of Linux while gaining the benefit of a consumer-oriented machine–Mac users don’t have to settle for broken wireless or worry that an archaic projector will derail a client presentation. (To be fair, neither do Linux users with the time and inclination to work through the issues).

 

So I bit the bullet and switched. At least on my primary work machine. My wife and kids still run Ubuntu on their desktop, my son runs Debian on his laptop, and our DVR is a Windows Media Center PC that talks to an XBox 360. (My home IT environment is now every bit as heterogeneous as Optaros’). Tom says my MacBook Pro is essentially a gateway drug and that my house will be all-Apple in no time. I hope he’s wrong. I don’t want to be a fan boy. Variety is the spice of life. My Treo is looking a little long in the tooth, though. I’ll bet an iPhone would be a nice complement to this machine…

 

Everex should have gone with straight Ubuntu

I’ve been slowly tweaking the way my family uses their computer to make it easier to migrate everyone to Linux. First, I completely removed Internet Explorer and got everyone used to Firefox. Then, I moved my wife off of her thick email client and onto Gmail. Next, I replaced Office with OpenOffice. Each of those moves was relatively painless. Spreading them out over time helped.

The kids were even easier. When they were younger, they used a lot of PC-based CD-ROM games and educational software. Now ages 6 and 10, they are exclusively into web-based Flash games and virtual worlds. All browser, all the time, although they do seem to enjoy tweaking their wallpaper, changing themes, resetting their passwords, and, oddly, watching the CPU performance graphs. They can out control panel most adults.

Anyway, the spare computer finally became unbearably slow compared to the primary machine and my laptop. I decided I’d get a decent monitor (20″ Dell Ultrasharp 2009W) with a low-end workstation. I went with an Everex gPC2.

I’ve been running Ubuntu for two years, and the gPC’s gOS is based on Ubuntu so I figured it ought to be easy enough for me to support. But I had to do a bit more work than I thought I should based on that fact that this was aimed at the masses. I mean it used to be sold at Wal-Mart for crying out loud. I guess the ideal target end-user is a single user who connects to the net to do absolutely everything. At first blush, my family fits that description. But they also want to share files on the local network. And they want their own login. And they want a decent file manager. And they want to be able to “switch user” instead of logging out to let someone else log in. These are all done effortlessly on Windows and fairly painlessly on straight Ubuntu. On gOS, these seemingly rudimentary feats require additional installs. For those already familiar with Linux, these are fairly simple. But for families without a command-line lover in the house, it would get very frustrating, very fast.

I pushed through it because I’m the only one that has to deal with installation and config. If my family is happy, and if they can get their “work” done without coming to the “help desk”, I’m happy. And at first, my family was excited about the new box. It started up fast, the UI was pretty (my son loved the Mac-ish iBar), and the browser and OO.o worked like they’d expect. After a few days, though, the bleeding edge nature of some of the gOS components started to turn into annoyances:

  • Segment fault messages on every logout meant an extra close the error dialog.
  • Fairly often, Firefox complained that it was already running. (This usually happened when someone had just logged out and a new user was logging in and starting up Firefox.)
  • There was no easy way to mount and navigate Windows shares in the file manager. (I did see a workaround involving Thunar and Fuse but Fuse seemed to be acting a bit fishy–I wasn’t seeing consistent good behavior there).
  • Reported system freeze-ups. (I never saw any of these first-hand).

After less than a week I finally had enough. What was the gOS buying me? Nothing. Instead, it was costing me time. Today I slapped in the Ubuntu install CD and never looked back.

I still think the $199 I paid for the Everex box was worth it. And judging from the partial success of the gOS experiment, the family is definitely not going to miss Windows. I wonder if there is a group of happy gPC2 users still using gOS out there or if Everex would have done better forgoing some of the eye candy and distributing with a straight Ubuntu install.

Successfully sync’ing a Treo 650 with Gutsy Gibbon

I finally got my Treo 650 to sync with my Gutsy Gibbon laptop. All the ingredients are on this page but there’s a little something for everyone there. You have to pick and choose to get it just right for your setup.

For me, the key steps were:

  1. Edit /etc/modules to add “visor” to the end of the file.
  2. Edit /etc/udev/60-symlinks.rules to comment out the “for Palm Pilots” rule.
  3. Edit /etc/udev/10-custom.rules to add the following:

BUS=="usb", SYSFS{product}=="*[vVisor]*", KERNEL=="ttyUSB[13579]", NAME="pilot", GROUP="dialout", MODE="0660"

As the instructions point out, be careful to use double equals (comparison) in the right places versus single equals (assignment).

Once that was in place, I just had to make sure the devices tab in gpilotd-settings was pointing to /dev/pilot and voila!

Native NVIDIA drivers and wireless working in harmony

The VGA out on my Dell D820 wasn’t working so I downloaded and ran the Nvidia installer for the latest native driver making sure I followed the pre-reqs documented here. That fixed VGA out and made the open gl screensavers work appropriately. What I didn’t realize at the time was that it took out my wireless. That’s because removing the linux-restricted-modules package, as the instructions suggest, uninstalls a wireless dependency. If I had known that (which is pretty clearly documented on the Ubuntu forums) I would have followed the alternative method which is to add “nv” and “nvidia_new” to the DISABLED_MODULES list in /etc/default/linux-restricted-modules-common and then run the Nvidia installer.

The message I was getting when I was trying to start up the wireless interface without the restricted modules package installed was:

SIOCSIFADDR: No such device
eth1: ERROR while getting interface flags: No such device
eth1: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
Failed to bring up eth1.

After running the installer with the DISABLED_MODULES set both Nvidia and wireless are behaving.

Ubuntu saves the day again

While my laptop remains and has always been Ubuntu, my two home machines are Windows XP. On the older box, the one I’ve surrendered to the kids, there’s really no excuse. They really only use the internet at this point and they could easily adapt to the change in interface so its days are numbered.

The newer XPS box has a bit more longevity due to some of the apps we use. I’ve been using Windows Movie Maker a lot, but I’d easily give it up for Kino or Cinelerra. The current sticking point is Media Center. The XPS box is our DVR which we connect to from our XBox 360. I hate to give up that setup (Yes, I know about MythTV).

Anyway, a week ago the XPS box started showing symptoms of the MSBlast worm. It went from bad to worse very quickly and ultimately became totally unusable. It couldn’t even stay up long enough for me to troubleshoot the problem.

At that point it was Ubuntu to the rescue! I booted off the Ubuntu live CD, mounted the Windows partition, rsync’d everyone’s data directories to my LaCie drive, and then used Dell’s built-in Symantec disk restore to put the disk drive in the exact state it was in when the machine was delivered. After copying the data back to the machine I’m up-and-running and no worse for the wear. Thanks, Ubuntu!

Another VPN client for Linux: vpnc

On a recent project my client issued me a SecureID token to use with their Cisco VPN server. The client has many different types of OS’s in house so I was hopeful I’d have no trouble connecting with my Ubuntu laptop. Unfortunately, the Cisco VPN client wouldn’t build. A co-worker pointed me to a Cisco-compatible VPN client called vpnc. Setup was just a matter of translating the PCF file to the vpnc config. It worked flawlessly for the entire project.

I can now safely say that “Linux-at-Work” is no longer just an experiment–for me it’s now a viable, productive workplace OS.

Living in Linux

When I joined Optaros I decided to live in Linux full-time. Previously I had several Linux VMware images I would just start up whenever I needed to work in Linux, but I really wanted to go whole-hog, so when I got my laptop I installed Ubuntu dual-booted with Windows.

It was easier to live in Linux full-time than I thought it would be. The only time I needed to go back to Windows was when I was collaboratively working on documents with Windows users. Although OpenOffice.org can read and write Office documents, and OpenOffice has all of the features I typically use, back-and-forth authoring between the two was painful, particularly when the Microsoft Office authors would use heavy formatting and styles. So, if I couldn’t get the document to look the same across suites, I’d throw up my hands and boot to Windows.

My Ubuntu install had a couple of annoyances. First, no matter what I tried, I could not get wireless to work. Less importantly, I couldn’t successfully recover from a hibernate.

Last week I decided to upgrade Ubuntu to the latest distribution, Dapper Drake. I settled in for what I figured would be a day-long slug-fest. It turned out to be much easier than I had expected–the Update Manager handled everything. The beauty of the upgrade, beyond being up-to-date on security and software patches, is that the upgrade fixed my wireless and hibernate problems.

So, long story short, my “Live in Linux” streak is now three months strong and more productive than ever.