We had the Bangalore OpenSolaris user's group meet yesterday with a talk on Zones and Resource Controls. One of the questions asked was whether creating Zones on an NFS mounted directory is supported. One zones weenie pointed out that as per documentation it is not. And when we tried it out, just for the heck of it, zonecfg cribbed as documented. But then a bunch of hackers having round-table experimentation are not in the mood to give up without exploring all avenues of fooling the OS. So I suggested using lofi. This is what we did:

* We wanted to create a sparse root Zone. So on a NFS direcory execute: mkfile 100M zoneroot. Anyway a sparse root zone is going to occupy 60MB.

* Now add it as a device via lofi: lofiadm -a /path/to/NFS/dir/zoneroot

* The device created was /dev/lofi/1. Now execute: newfs /dev/lofi/1 which creates a UFS fs in the file.

* Mount it: mount /dev/lofi/1 /mnt/testzone

* Use zonecfg to create a zone on /mnt/testzone

* Heh it works! The zone installs and boots. Of course this just some messing around and we do not yet know what problems there might be. But this looks like a useful way to keep and use a set of detached zones for trying out various stuff on a shared NFS dir.

Comments:

Post a Comment:
Comments are closed for this entry.

This blog copyright 2008 by moinakg