//
you're reading...
SmartOS

SmartOS, Project Fifo and Bind

At work we have been looking at using SmartOS for a skunk works project to test disaster recovery/flash back for Oracle DB using SmartOS and ZFS snapshots.

One really nice frontend for SmartOS is Project Fifo.

While offically it doesn’t support the current release of SmartOS, I have had issues running the recommended version of SmartOS (20130222) on my hardware at home, I believe it has to do with either the dual nics built into my motherboard, or the drivers for them.

Looking at the chunter script there are newer versions supported, but I really didn’t have any luck with them either.

I was able to replicate my issues with VirtualBox, so that let me quickly test which versions of SmartOS might work. Love the fact that the OS isn’t really installed, so upgrading or downgrading is just a matter of changing my iPXE menu and rebooting the server.

SmartOS recent released a new version and I was able to get it to work with Fifo in Virtualbox. At first I ran into an issue which can be kinda frustrating to deal with if you don’t know what’s going on.

Basically the hypervisor gets reported by chunter to fifo as localhost (127.0.0.1), making fifo unable to function correctly.

It doesn’t matter if you set hosts file or the app.conf for chunter with the host info, it will still not work, this is because of how chunter (and I think other fifo components) determine the hostname.

In short, you need a DNS server. If you do a lot of VM testing on your laptop like I do, chances are you won’t be able to resolve the names you use in your test networks.

Simple solution is to create a tiny zone that just runs bind.

Grab the base64 image with imgadm
imgadm import fdea06b0-3f24-11e2-ac50-0b645575ce9d

Create a ns1.json like this:

{
 "autoboot": true,
 "brand": "joyent",
 "image_uuid": "fdea06b0-3f24-11e2-ac50-0b645575ce9d",
 "max_physical_memory": 64,
 "cpu_cap": 100,
 "hostname": "ns1",
 "alias": "ns1",
 "quota": "2",
 "resolvers": [
   "4.2.2.4",
   "8.8.8.8",
   "8.8.4.4"
 ],
 "nics": [
    {
        "interface": "net0",
        "nic_tag": "admin",
        "ip": "10.0.2.9",
        "netmask": "255.255.255.0",
        "gateway": "10.0.2.2"
    }
 ]
}

Running vmadm create -f ns1.json will make a 64meg mem / 2gb disk zone for running bind in.

Once created do a zlogin to the VM ID and run something like this (adjusting IP’s if desired):

pkgin install bind

cat >>/opt/local/etc/named.conf<<EOF
zone "local" {
  type master;
  file "/var/named/zones/local.db";
};

zone "2.0.10.in-addr.arpa" {
  type master;
  file "/var/named/zones/local.rev";
};
EOF

mkdir /var/named/zones

cat >>/var/named/zones/local.db<<EOF
local.      IN      SOA     ns1.local. admin.local. (
                        2013090901;
                        28800; 
                        604800;
                        604800;
                        86400 
 )

local.      IN      NS    ns1.local.

ns1         IN      A     10.0.2.9
smartos     IN      A     10.0.2.10
fifo        IN      A     10.0.2.11
EOF

cat >>/var/named/zones/local.rev<<EOF
@ IN SOA ns1.local. admin.local. (
                        2013090901;
                        28800; 
                        604800;
                        604800;
                        86400 
)

                      IN    NS     ns1.local.
2                     IN    PTR    ns1.local.
10                    IN    PTR    smartos.local.
11                    IN    PTR    fifo.local.
EOF

svcadm enable dns/server:default

Now when you make the fifo zone you point to 10.0.2.9 as the resolver and you will be able to find your hypervisor.

Advertisements

Discussion

2 thoughts on “SmartOS, Project Fifo and Bind

  1. ns1.json – should me removed comma “,” in line 23.
    also before creating that vm, you must install image imgadm import fdea06b0-3f24-11e2-ac50-0b645575ce9d

    Posted by Alex | December 25, 2013, 12:04 pm
  2. Good catch, thanks Alex.

    Posted by koaps | December 28, 2013, 1:05 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s