posted by Anil Gulecha on Thu 11th Sep 2008 16:15 UTC
IconOSNews has been reporting on the Debian/Ubuntu/GNU/Opensolaris hybrid for several years. But for those of you who've never looked more closely at this interesting OS, a Nexenta developer has laid out some of its more noteworthy features and advantages.

The Nexenta project, started in 2005, has had 6 releases (NexentaOS and NexentaCore), and is preparing for the upcoming NexentaCore Platform 2 release. If you are a Debian/Ubuntu developer, consider taking a little time to take a look at an emerging platform that provides a feature rich developer environment.

Nexenta has built a small but vibrant community. It has been downloaded over half a million times, and is being used in around 10,000 systems, mostly data-centers.

Nexenta uses Debian's dpkg packaging system, and provides everything provided by Debian/Ubuntu environment. However, these are only a subset of the features in Nexenta's toolchain. We'll take a look at the additional features and tools provided by Nexenta.

The Opensolaris technologies: ZFS

The open source world has gone gaga over the next generation file system from the Opensolaris community. It has been ported to Apple's OSX and FreeBSD. Licensing incompatibilities have held up a Linux port. It is a file system and volume manager built into one. And with lightning fast snapshots and automatic integrity and error checking, this is the filesystem of the future. Lets take a look at how you as a developer can benefit by the use of ZFS:

Never have to worry about data loss, or the system and packaging system going into a mangled state

ZFS's quick and painless snapshot feature allows you to take incremental backups of your entire filesystem or the packaging related data. So if the last kernel upgrade botches up the system or renders it unbootable, easily revert back to the earlier working state :)

Nexenta provide a tool called apt-clone which is a wrapper over apt-get. Roughly translated

apt-clone = system clone + apt-get

so a command apt-get install apache2 is equivalent to

zfs clone beforeapache2 rootfs
#add grub lines to boot to 'beforeapache2'
apt-get install apache2

If things go wrong and apache2 isn't installed right, you can revert back to the snapshot "beforeapache2" and the system reverts to the original configuration. Further information in the apt-clone manpage [0].

Use snapshot capabilities to create restore points

..all along your development/build cycle allowing for easy reversion to an earlier state

Another use of ZFS for package maintainers is the capability to easily take a snapshot of the environment (like the current working directory) and make those deadly changes. There no longer a need to worry or limit your changes for the fear of "ruining this working state" or "losing all these changes I've made". Use ZFS like a quick and dirty versioning system for those short development sessions.

Increase build environment storage as and when required

If you've run into situations where you had dedicated space for a certain need, but later found yourself out of space. This could be for your package development needs or for the music you play when you develop. With ZFS, you no longer have to decide between removing package A or sources B. You can have both the Rock and the Blues collection. A new hard disk or a partition plus a simple command will take care of all your space needs.

ZFS pools and RAID-Z

..for superior volume and data redundancy management

ZFS filesystems are laid out on 'pools' which are storage spaces. This is a different from the traditional 'disks' and 'partitions' way of thinking about laying out filesystems. You can now add any type of storage (disk, network attached storage, a file) to the pool, and everything in the pool is made available to the filesystems that are created from the pool. This allows us to very easily increase the size of a pool by simply giving it more storage.

To create a pool from a disk

zpool create
zpool create diskpool c1d0p0

To increase the size of the pool, simply add another disk to it

zpool add
zpool add diskpool c2d0p0

ZFS supports various raid configurations out of the box, including RAID-Z, which is a better implementation of RAID5 [1]. It implements features into the filesystem that previously required specialized hardware. A comparison of ZFS with Linux LVMs can be seen at [2].

This allows you to setup your storage in mirrored disks by simply (eg)

zpool create mypool mirror c1d0p2 c2d0p2

Creating a zfs filesystem on our newly created pool is done via

zfs create mypool/myroot zfs create mypool/john

Both myroot and john will use the mypool storage space created by zpool. Set the mount points for these via

zfs set mountpoint=/space/john mypool/john
zfs set mountpoint=

A complete documentation of the zpool and zfs commands can be found at docs.sun.com [3][4].

ZFS supports quotas and reservations for each dataset. You can thus allocate varying amounts of space for various purposes. The built in checksumming of everything does away within the filesystem allows you to breathe easy while ZFS does everything that can be done to keep your data error free. ZFS also supports compression and encryption (currently under review by the ZFS community and to be added to the Opensolaris kernel shortly)

The Opensolaris technologies: Zones

(..and ZFS zones with Debian environment)

Zones are lightweight virtual instances of the operating system. The main (or parent) instance is known as the global zone. A  global zone can have as many local zones as resources like memory and disk space allow for.

Zones are a boon to package maintainers. they allow for quick and easy setup and generation of development environment. Once the tasks are done, the zone can be done away with, until required later. Thus you do not have to allocate a specific amount of your resources towards a build setup.

Nexenta provides a set of tools in a package called devzone, which allow for easy creation of development zones for package maintainers. These can be easily tuned to other specific needs. A typical zone takes less than a minute to setup and use.

As each zone is self-contained, you can provide root access to them to those you may not fully trust. This setup can be used in build machines where "potential" developers to a project can be given access to their own development zone to play around with. This setup is used by the Nexenta Project during its hackathon events. further information at [links].

A zone can be created using

devzone_create

Now, enter the zone using

devzone_enter

and poof!.. you are now root in the new virtual instance of the machine. you would now typically setup your /etc/apt/sources.lst and start installing and building packages.

You can reconnect and disconnect the zone as many times as you like. Once you're done with using a zone, simply run the following command in the global zone

devzone_free

to kill the zone, and free up it's resources.

Devzones provide the following advantages to developers

  • Better share resources: As development zones can be created on the fly, you can easily share resources. Developers in different parts of the world can access the machine at different times.
  • Peace of mind: If you have a dedicated build machine, easily allow multiple developers access to it, without worrying about interfering with each other, or one's mistake bringing down the system.

To see how you can build Debian/Ubuntu packages in a devzone, take a look at the screencast at [5].

Table of contents
  1. Nexenta, Page 1
  2. Nexenta, Page 2
e p (10)    20 Comment(s)

Technology White Papers

See More