Wednesday, September 01, 2010

Nexenta 3.0 Zones: Fixing Broken Bones

As a rule of thumbs, when things installs very smoothly, I always suspect something wrong, because there is an old Ukrainian saying: "Devil lives in a silent lake". This time same thing happened to newly installed Nexenta Core 3.0 Release. Installation went just as sweet and smooth.

But when it comes to zones... :-(

Long story short: Zones are just totally broken in Nexenta Core 3.0 Release, end of story. SSH won't work, you won't login, no passwords asked, nothing. And I am quite surprised it was never fixed (probably nobody took a chance to test it). Now is the way how I fixed, grepping over bugs database:

First, before you install a zone, you have to fix broken /usr/bin/createzone Perl script. This should be done in two steps:
  1. Replace elatte-unstable with hardy-unstable on a line #41.

  2. Throw away @source_files with all its guts and replace with the following:
    my @source_files = qw(
Second, fix broken /lib/svc/method/svc-syseventd script. This is done in quite dirty way, but at least works fine:
  1. In the global zone edit the script above. Find this line (below the CDDL header):
    . /lib/svc/share/
    ...and add this:
    [ `zonename` = global ] || sleep 3600 & exit 0 in result you will get this:
    . /lib/svc/share/
    [ `zonename` = global ] || sleep 3600 & exit 0

This will allow required services finally start.

Now you can install your zone (zoneadm -z yourzonename install).

Third, fix shadow and passwd. Boot your zone and zlogin to it in a single mode (-S), then issue pwconv command and exit.

Finally, after you anyhow login to that thing, reconfigure broken system service once again, like this:

dpkg-reconfigure sunwcsd
svccfg import /var/svc/manifest/system/sysevent.xml

And yes, this is Unix. You should reboot your zone in order it getting working right. :-)

No comments: