targetd: remote administration of a Linux storage appliance

targetd is a new service that will make it easier to configure Linux machines to export block-based volumes over iSCSI or other protocol.

The Why

Virtual machines need disk images to run from. While you can put the disk image on the local storage of the machine executing the VM, there are many benefits to centralizing disk images — this lets you seamlessly migrate the VM’s execution between machines, is easier to manage, and can be more space-efficient when many of the disk images are almost the same, which is pretty common.

However, it hasn’t been nearly as easy to provision a new storage volume on the central storage box as it could be. High-end storage appliances have tools for this, but the normal way using only open-source tools has been to ssh into the machine, create the new volume and export it using command–line tools, and then go back to however you’re creating the new VM and tell it about the new volume you created.

targetd is a step towards making this process a little easier.

The What

The remote API is based on jsonrpc-2.0 over HTTP. The Python standard library does much of the work towards implementing our API server, what’s left is the actual implementation of functionality and the jsonrpc error handling.

This API will let targetd eventually tie into existing storage management tools. One such under development is libstoragemgmt, a framework by my colleague Tony Asleson, which will give virtualization tools like oVirt or OpenStack a common API for management of the many proprietary storage appliances, and also open-source appliances like targetd.

Linux has had reliable LVM-based volume management for a long time, and now has an excellent kernel-based storage target subsystem called LIO. targetd uses both of these heavily. In configuring a machine for a storage appliance role, give targetd a volume group to allocate volumes from, set user/password for access, and you’re just about done.

There is one coding pet peeve of mine that I’ve ranted about before that targetd avoids completely. targetd uses libraries to interface with LVM and LIO instead of the all-too-common alternative of passing commands to command-line tools, and parsing the output. Much of the time spent towards targetd was improving these libraries. I believe proper error propagation, reduced text parsing, and better library APIs make this bottom-up approach a long-term win.

Current state and future plans

Today’s announcement is a pre-alpha 0.1 release. I’m really hoping to get to 1.0 for Fedora 18. There is a manpage to write and SSL support to add, but much more important than the source code of  targetd is the layout of the remote API itself. I’d love to get some more review of that, as well as the code, before 1.0. I have been working from what I believe are some common use-cases, but more feedback on how admins configure and use storage appliances would be most welcome too!

Please see the project on github for more info.

Shorter trackpad-disabling timeout with Gnome 3 (Fedora 17)

Gnome 3 has the option of disabling the trackpad while the user is typing. (System Settings -> Mouse and Touchpad -> Touchpad) However, it uses a timeout of two seconds. Two seconds doesn’t sound like much, but it may be enough to feel weird — at least it did for me.

When you check that option, all Gnome is doing is running a utility called “syndaemon”, and it uses a 2 second timeout. We can adjust the timeout by running this ourselves when we login:

  1. Make sure Gnome doesn’t also run syndaemon by keeping the aforementioned checkbox unchecked
  2. Run gnome-session-properties, after entering alt-F2 or from the commandline.
  3. Click Add, and then enter Syndaemon, /usr/bin/syndaemon -i 0.5 -K -R, and any comment you want
  4. Click Save.
  5. Logout and back in

If you run “ps ax|grep synd” you will see syndaemon has been started with your settings. 0.5 seconds works for me but feel free to experiment.

Fedora and Open Source at Grace Hopper 2011

Me wearing my flairI was at the Open Source booth at this year’s Grace Hopper Celebration of Women in Computing, last Thursday. We had Fedora media and swag also available Wed and Fri as well. The booth was shared with Mozilla, Kids on Computers. Wikimedia, OSU OSL, the Ada Initiative, and assorted other FOSS projects. While I talked about Fedora and handed out media and stickers, many attendees were students and new to tech as a whole, so “what is open source” was the first, most important, question.

I also attended the Codeathon for Humanity on Saturday, with about 200 attendees working on various open source philanthropic projects: Sahana, Systers, Mailman, peer-to-peer Haitian Women’s network, to name a few. The Mayor of Portland, Sam Adams, stopped by and spoke. I wasn’t expecting this, but was pretty nice to hear about the importance of open source to the city government, as well as the Portland tech scene as a whole!