Problem with zfs and zone creation

Hi,

I am running Solaris 10 update 2 on a 25k, with zones and zfs.

Here's my problem :

first i create a zfs pool (tank) and a zfs filesystem in it (tank/my-zone-tank). All properties are the default ones, exept the mount point is set to legacy.

I do a zonecfg to create a zone (my-zone), and while doing this, i add the zfs with :

add fs

set type=zfs

set special=tank/my-zone-tank

set dir=/data

end

All seems ok, but when i install the zone, i have this error :

Preparing to install zone <my-zone>.

ERROR: No such file or directory: cannot mount </zones/my-zone/root/data> in non-global zone to install: the source block device or directory <tank/my-zone-tank> cannot be accessed

ERROR: cannot setup zone <my-zone> inherited and configured file systems

ERROR: cannot setup zone <my-zone> file systems inherited and configured from the global zone

ERROR: cannot create zone boot environment <my-zone>

zoneadm: zone 'my-zone': '/usr/lib/lu/lucreatezone' failed with exit code 74.

As you may think, while it fails now, it works it i install the zone first, then add the fs with zonecfg and then reboot.

My question is why it is so ? i would like to fully configure my zone even before i install it.

Thanks for any answer or tips...

[1390 byte] By [JoeLinux] at [2007-11-26 9:57:47]
# 1

That would be because you do not use "add fs" for zfs entries but "add dataset".

add dataset

zonecfg:my-zone> set name=tank/sales

zonecfg:my-zone> end

See http://docs.sun.com/app/docs/doc/817-1592/6mhahuoo6?a=view

Carl L.

> Hi,

>

> I am running Solaris 10 update 2 on a 25k, with zones

> and zfs.

> Here's my problem :

>

> first i create a zfs pool (tank) and a zfs filesystem

> in it (tank/my-zone-tank). All properties are the

> default ones, exept the mount point is set to

> legacy.

>

> I do a zonecfg to create a zone (my-zone), and while

> doing this, i add the zfs with :

>

> add fs

> set type=zfs

> set special=tank/my-zone-tank

> set dir=/data

> end

>

> All seems ok, but when i install the zone, i have

> this error :

>

> Preparing to install zone <my-zone>.

> ERROR: No such file or directory: cannot mount

> </zones/my-zone/root/data> in non-global zone to

> install: the source block device or directory

> <tank/my-zone-tank> cannot be accessed

> ERROR: cannot setup zone <my-zone> inherited and

> configured file systems

> ERROR: cannot setup zone <my-zone> file systems

> inherited and configured from the global zone

> ERROR: cannot create zone boot environment <my-zone>

> zoneadm: zone 'my-zone': '/usr/lib/lu/lucreatezone'

> failed with exit code 74.

>

> As you may think, while it fails now, it works it i

> install the zone first, then add the fs with zonecfg

> and then reboot.

>

> My question is why it is so ? i would like to fully

> configure my zone even before i install it.

>

> Thanks for any answer or tips...

Carl_L at 2007-7-7 1:22:23 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2

Thanks for your answer, but i believed dataset were for delegating more right to the local zone admin, and that's not what i want to do...

Adding fs is possible, as the first example in http://docs.sun.com/app/docs/doc/819-5461/6n7ht6qsm?a=view seems to work once the zone have been installed.

My goal is to directly put /var on a ZFS filesystem. I can to that later, but it is a lot more complicated.

As a side note, i discovered that "The zonepath of a non-global zone should not reside on ZFS for this release. " - for those who don't know, it's hard to guess...

JoeLinux at 2007-7-7 1:22:23 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
FWIW, I had the same problem as you described, and used the same workaround...
qu1j0t3 at 2007-7-7 1:22:23 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

> As a side note, i discovered that "The zonepath of a

> non-global zone should not reside on ZFS for this

> release. " - for those who don't know, it's hard to

> guess...

Yeah, but there are specific scenarios that detail their reason for that statement. docs.sun.com is having a rough time with life right now, so I can pull it up to go into detail.

I've been using non-global zonepaths (for several busy zones) on zfs for over a month now on a "production" server w/o issues.

WRWindsor at 2007-7-7 1:22:23 > top of Java-index,Solaris Operating System,Solaris 10 Features...