Archive

Archive for the ‘Nexenta’ Category

Fixing Nexenta Zones: Update

October 25th, 2010 rei No comments

According to Comment #10 on Nexenta bug 203, some of the more glaring problems with Zones in Nexenta have been fixed in version 3.0.1. The most tedious fixes have been put in place. The only thing necessary to do now is simply dpkg-reconfigure sunwcsd once the zone is installed. I also did a reimport of sysevent.xml. It seems to be necessary (at least on my dist-upgraded system). In order to do the reconfiguring, you will need to be in maintenance mode. The zone should already have dropped into maintenance mode to begin with, so just zlogin and do the reconfigure. After that you will need to reboot the zone. Everything should then be working correctly. To get Nexenta 3.0.1, either dist-upgrade your existing system, or download the ISO from here.

Categories: Nexenta, OpenSolaris Tags:

Fixing Nexenta Zones

August 19th, 2010 rei 6 comments

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(
        /lib/svc/method/nexenta-sysidtool-system
        /var/svc/manifest/system/nexenta-sysidtool.xml
        /lib/svc/method/nexenta-sysidtool-net
        );

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]
pwconv
exit

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/smf_include.sh 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/smf_include.sh
[ `zonename` = global ] || sleep 3600 & exit 0

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

#
# devfsadmd and syseventconfd are started on-demand
# by syseventd. syseventd should be stopped before devfsadm and syseventconfd.
#
'stop')
	zone=`smf_zonename`
	/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
	;;

esac
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.