Fixing Nexenta Zones

Update: Some of the bugs in this post have been fixed, rendering a lot of the steps unnecessary. If you are running the latest version of Nexenta (3.0.1), you should only need to perform the last steps, where you dpkg-reconfigure sunwcsd and reimport the sysevent.xml file. See the new post for more details.

There is a nasty bug in Nexenta 3.0 that causes zones to function improperly. Services such as SSH are broken, packages may not install properly, etc. This is caused by a missing sysidtool, and a missing sysevent service. Two fix this problem, a few steps are required. First, in the global zone, you must edit /usr/bin/createzone and make the following changes:

1. Replace elatte-unstable with hardy-unstable. This should be found around line 41, in the default_config() subroutine.
2. Update the @source_files array as follows:

my @source_files = qw(

You are simply changing “elatte” to “nexenta” here.

Now, go through the normal zone creation process. If you don’t know how to do that, see here for a decent tutorial. The zone creation process should go off without a hitch, and sysidtool should install properly. Without our fixes, you would probably see an error that looks something like this.

There are still two more steps to be done. We must log in to the zone, but regular zlogin will not work until we fix another small bug. Boot the zone with “zoneadm -z yourZone boot”, then log in with “zlogin -S yourZone” instead of the normal zlogin. This will bring us to maintenance mode. Run pwconv:

zoneadm -z yourZone boot
zlogin -S yourZone

[In yourZone]

After this, regular zlogin should work. Now, we need to get the sysevent service working. Many services depend on this service. Without it, all of them will fail to start. To fix this, edit (from within the zone) the /lib/svc/method/svc-syseventd.

After the line . /lib/svc/share/ put
add [ `zonename` = global ] || sleep 3600 & exit 0

When finished, your zone’s /lib/svc/method/svc-syseventd file should look something like this. The bolded line is the one you added.

# CDDL Header
# ...

. /lib/svc/share/
[ `zonename` = global ] || sleep 3600 & exit 0

case "$1" in
	/usr/lib/sysevent/syseventd >/dev/msglog 2>&1
	if [ $rc -ne 0 ]; then
		echo "WARNING: /usr/lib/sysevent/syseventd failed: exit status $rc"

# devfsadmd and syseventconfd are started on-demand
# by syseventd. syseventd should be stopped before devfsadm and syseventconfd.
	/usr/bin/pkill -x -u 0 -P 1 -z $zone rcm_daemon
	/usr/bin/pkill -x -u 0 -P 1 -z $zone syseventd
	/usr/bin/pkill -x -u 0 -P 1 -z $zone devfsadm
	/usr/bin/pkill -x -u 0 -P 1 -z $zone syseventconfd

	# Since pkill is not atomic (may miss forking processes), also
	# kill entire service contract.
	smf_kill_contract $2 TERM 1
	[ $? -ne 0 ] && exit 1

	echo "Usage: $0 { start | stop }"
	exit 1

exit 0

Finally, you will need to enter two more commands as the super-user:

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

Exit the zone and reboot it. Log in again, and everything should be magically working!

This information was compiled from several Nexenta bug reports (203, 173, LP #347937) after I ran into problems getting SSH working in my new zone. Apparently, the problems are bigger than SSH. I can’t take credit for discovering these fixes.

6 thoughts on “Fixing Nexenta Zones

  1. Michael

    Many thanks for providing a single point where all steps are documentated, mysql installation still hangs over here though.

  2. rei Post author

    I ran into two errors trying to install mysql in the zone. First, it failed with “mandb: fork failed: Not enough space” Then it failed with a segmentation fault in /var/lib/dpkg/info/man-db.postinst: line 3. Both of these were while trying to configure man-db. It would just go in loops trying to set the root password. Not quite sure about that one. I know that MySQL works in the global zone, as I have it running there. If I find a better solution, I’ll let you know.

  3. Michael

    Ok so I had to do ‘do a dpkg-reconfigure sunwcsd and import the sysevent.xml again with “svccfg import /var/svc/manifest/system/sysevent.xml”‘ as described to get it to work although sysidtool was there sysevent still wasn’t.

    Also in step one I changed it to hardy as listed but that seemed to have no effect and nexenta makes more sense

    (also to note I think I’m runing RC3 but the iso is suppose to be the same.)

  4. rei Post author

    Oh yeah. Kind of forgot those steps… let me update the post.

    Edit: Ok, post should be updated with those steps.

  5. rei Post author

    Also updated the post to reflect “hardy-unstable” instead of “nexenta-unstable.” I had the wrong information posted, despite the correct fix in place on my own system. That’s pretty impressive…

  6. Michael

    Edit: Ok, post should be updated with those steps.

    Yep I see them :) Mysql seems to work here I can mysql> show databases; I’ll test it later with applications.
    My zone is non-sparse if that helps(no inherit-pkg-dir’s). -there’s some switch you can add after the create command to start off clean, I forgot which.

    But again many thanks just the list of bugs alone helped me greatly, I found some of them but it all got frustrating. Having to not distill the information from the comments is a great bonus on top of that.

Comments are closed.