Branded (LX) Zones on SmartOS

One of the biggest historical weaknesses of SmartOS has been it's inability to provide the Linux API/ABI directly to user space within a zone. This is because the list of system calls are not only different between operating systems, but the way they are handled are different.

This means that Linux exclusive applications are effectively second class citizens in SmartOS (compared to applications hosted from a native zone), as their system calls have to be run thorugh KVM and a guest operating system kernel. This equates to less IO performance, less visibility with Dtrace, less flexibility with ZFS, etc.

But what if we could just translate system calls from one API/ABI to another?

This is exactly what an LX Branded Zone does.

How it Works

Simply by passing all Linux system calls through a daemon in the same zone which translates each call to it's equivalent call(s) in Solaris, and then returns the appropriate responses.

This may seem quite simple, but it really isn't. Unfortunately, this is beyond the scope of this blog post right now.

Setting it Up

At the time of this posting, LX Branded datasets are available for CentOS, Debian, and Ubuntu. Simply acquire what you want with imgadm.

The VM manifest is pretty similar to a normal SmartOS Zone:

[root@gz ~]# vmadm create <<EOF
{
  "alias": "debian-7",
  "brand": "lx",
  "hostname": "debian-7",
  "kernel_version": "3.13.0",
  "max_physical_memory": 1024,
  "quota": 10,
  "image_uuid": "7d13c646-e3a7-11e4-8603-f79ddc0a5474",
  "nics": [
    {
      "nic_tag": "admin",
      "ip": "dhcp",
      "primary": true
    }
  ],
  "resolvers": [ "8.8.8.8", "8.8.4.4" ]
}
EOF

Final thoughts

I've not used Linux in a server since switching to SmartOS, but LX Branded Zones makes it as easy as spinning up a SmartOS Zone.

While I do miss not having SMF, ZFS, or any of the other things I've grown to love from SmartOS, I'm sure this technology will continue to develop, and I'm expecting an even smoother Linux experience in the next few releases of datasets and global zone images.

I just hope it doesn't happen at the cost of the native SmartOS Zone.