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.

5 thoughts on “targetd: remote administration of a Linux storage appliance

  1. Tomasz

    Heh, just last week I was thinking about creating some simple web ui working with python-rtslib, so my Windows-using coworkers have a way to manage LIO target. targetd seem to appear out of nowhere, and looks like a firm building block for this solution ๐Ÿ™‚

  2. Marcus Wellnitz

    Hello Andy,

    you requested feedback from administrators.
    Here are mine:

    1st: thanks to your good job. For me I’m very pleased to get standardisated administration interfaces to that type of content.

    In my daily work I miss a automatisation standard for low level tasks. Any other Administrators i interviewed agree with that. Each of them implemented his own scripts. That’s not that much efficient ๐Ÿ™

    A good automatisation of blockdevices should have at least the following features (for my opinion):

    * Create typed Blockdevices (plain, master, clone, snapshot fom master)
    * Set/Get Device Status and Parameters (used, unused, stopped, mounted, …)
    * Create Snapshots from active Devices (Backup)
    * Working with snapshots (Get infos, revert to, …)
    * Delete typed Blockdevices if no dependencies are left

    That features would be great to reach via an API

    Thanks Marcus

Leave a Reply

Your email address will not be published. Required fields are marked *