Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-25 Thread Christine Tran
Hi,

A work-around for this issue has been provided by SunSupport.  The
direct parent of a zonepath must not be a dataset.  That is
/tank/myzone will result in a new dataset being created.
/tank/some_empty_dir/myzone will get you a zonepath that's just a
directory. Yay, SunSupport!

CT
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-18 Thread Frank Batschulat (Home)
On Thu, 18 Feb 2010 19:58:11 +0100, Christine Tran christine.t...@gmail.com 
wrote:

 On Sat, Feb 13, 2010 at 3:10 AM, Frank Batschulat (Home)
 frank.batschu...@sun.com wrote:

 a '-x nodataset' option for 'clone' like in 'install' is unlikely going to 
 happen, in
 fact I will remove the '-x nodataset' option for 'install' completely soon 
 in OSOL build 135
[...]
 I have created test ipkg type zones on this laptop before, I have not
 done an upgrade but I've allowd Package Manager to update packages as
 far as it's abled.  You say you will remove -x nodataset option,
 implying it hasn't been done yet, but here's what happened this

the '-x nodataset' option does only apply to the 'native' brand (ie. Solaris 
10, SX-DE)
(see native(5)) - it is not available to the 'ipkg' brand nor is it available
for the solaris8, solaris9 and solaris10 brands.

 morning when I tried to create a new zone.

 r...@fiat~ cat /etc/release
OpenSolaris 2008.11 snv_101b_rc2 X86
Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
 Use is subject to license terms.
Assembled 19 November 2008

 r...@fiat~ zonecfg -z pink
 pink: No such zone configured
 Use 'create' to begin configuring a new zone.
 zonecfg:pink create
 zonecfg:pink set zonepath=/zone/pink
 zonecfg:pink add net
 zonecfg:pink:net set physical=e1000g0
 zonecfg:pink:net set address=192.168.20.1/24
 zonecfg:pink:net end
 zonecfg:pink verify
 zonecfg:pink commit
 zonecfg:pink info
 zonename: pink
 zonepath: /zone/pink
 brand: ipkg
 autoboot: false
 bootargs:
 pool:
 limitpriv:
 scheduling-class:
 ip-type: shared
 net:
   address: 192.168.20.1/24
   physical: e1000g0
   defrouter not specified
 zonecfg:pink exit
 r...@fiat~ zoneadm -z pink install -x nodataset
 Error: no zonepath dataset.

thats one of the problems that may arise, since the
'-x nodataset' option is really handled inside zoneadm.c:install_func()
and not in the brand specific code that is executed later.

zoneadm did honoured this option, but the 'ipkg' brand
specific code that will be executed _after_ zoneadm.c:install_func()
barfs.

 OK, I will create a dataset:

 r...@fiat~ zfs list
 NAME  USED  AVAIL  REFER  MOUNTPOINT
 rpool26.4G  71.5G72K  /rpool
 rpool/ROOT   19.8G  71.5G18K  legacy
 rpool/ROOT/opensolaris   19.8G  71.5G  19.6G  /
 rpool/dump   1.97G  71.5G  1.97G  -
 rpool/export 2.70G  71.5G19K  /export
 rpool/export/home2.70G  71.5G19K  /export/home
 rpool/export/home/ctran  2.70G  71.5G  2.70G  /export/home/ctran
 rpool/swap   1.97G  73.5G  3.81M  -
 r...@fiat~ zfs create rpool/pink
 r...@fiat~ zfs set mountpoint=/zone/pink rpool/pink
 r...@fiat~ zfs list
 NAME  USED  AVAIL  REFER  MOUNTPOINT
 rpool26.4G  71.5G74K  /rpool
 rpool/ROOT   19.8G  71.5G18K  legacy
 rpool/ROOT/opensolaris   19.8G  71.5G  19.6G  /
 rpool/dump   1.97G  71.5G  1.97G  -
 rpool/export 2.70G  71.5G19K  /export
 rpool/export/home2.70G  71.5G19K  /export/home
 rpool/export/home/ctran  2.70G  71.5G  2.70G  /export/home/ctran
 rpool/pink 18K  71.5G18K  /zone/pink
 rpool/swap   1.97G  73.5G  3.81M  -

 Try to install again

 r...@fiat~ zoneadm -z pink uninstall
 Are you sure you want to uninstall zone pink (y/[n])? y
 cannot open 'rpool/pink/ROOT': dataset does not exist
 Error: no active dataset.
 cannot open 'rpool/pink/ROOT': dataset does not exist
 cannot open 'rpool/pink/ROOT': dataset does not exist
 cannot open 'rpool/pink/ROOT': dataset does not exist
 Error: destroying ZFS dataset.

more follow up problems that result from the fact that
zoneadm honoured the '-x nodataset' option when it really must not.

---
frankB
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Christine Tran
On Sat, Feb 13, 2010 at 3:10 AM, Frank Batschulat (Home)
frank.batschu...@sun.com wrote:

 a '-x nodataset' option for 'clone' like in 'install' is unlikely going to 
 happen, in
 fact I will remove the '-x nodataset' option for 'install' completely soon in 
 OSOL build 135

 PSARC 2010/008 Remove zoneadm install sub-option -x nodataset
 http://opensolaris.org/jive/thread.jspa?messageID=448598

 your ZFS problem is with 'move' ie. rename a file from one dataset to another
 while both datasets are still in the same pool ending up as a copy of the file
 because it crosses dataset ie. file system boundaries. there's a ZFS RFE
 open to improve that:

 6483179 Provide an efficient way to rename a file to another dataset in same 
 zpool
 http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6483179

 6650426 RFE: support link(2) between ZFS filesystems
 http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6650426

Actually, this would be the 'proper' fix and will work for us.  Do you
know if there's priority to these two CRs?  I will provide a business
case write-up under another cover, if someone would like to add it to
the CR.

Meanwhile, I am stuck at U5, because as far as I can tell, U7 and U8
implements separate dataset per zone if it's on a ZFS.  This
completely breaks our application, which depended on the efficiency of
mv within one filesystem.
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Mike Gerdts
On Tue, Feb 16, 2010 at 8:47 AM, Christine Tran
christine.t...@gmail.com wrote:
 On Sat, Feb 13, 2010 at 3:10 AM, Frank Batschulat (Home)
 frank.batschu...@sun.com wrote:

 a '-x nodataset' option for 'clone' like in 'install' is unlikely going to 
 happen, in
 fact I will remove the '-x nodataset' option for 'install' completely soon 
 in OSOL build 135

 PSARC 2010/008 Remove zoneadm install sub-option -x nodataset
 http://opensolaris.org/jive/thread.jspa?messageID=448598

 your ZFS problem is with 'move' ie. rename a file from one dataset to another
 while both datasets are still in the same pool ending up as a copy of the 
 file
 because it crosses dataset ie. file system boundaries. there's a ZFS RFE
 open to improve that:

 6483179 Provide an efficient way to rename a file to another dataset in same 
 zpool
 http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6483179

 6650426 RFE: support link(2) between ZFS filesystems
 http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6650426

 Actually, this would be the 'proper' fix and will work for us.  Do you
 know if there's priority to these two CRs?  I will provide a business
 case write-up under another cover, if someone would like to add it to
 the CR.

 Meanwhile, I am stuck at U5, because as far as I can tell, U7 and U8
 implements separate dataset per zone if it's on a ZFS.  This
 completely breaks our application, which depended on the efficiency of
 mv within one filesystem.

Does the data really need to be under the zonepath?  If you were to do
something like:

zfs create -o mountpoint=/stuff rpool/stuff
mkdir /stuff/z1 /stuff/z2

zonecfg -z z1
add fs
set dir=/stuff
set special=/stuff/z1
set options=rw
end
exit

zonecfg -z z2
add fs
set dir=/stuff
set special=/stuff/z2
set options=rw
end
exit

Adjust paths as needed to fit your application.  From the global zone,
you should be able to mv /stuff/z1/* /stuff/z2/* efficiently.

-- 
Mike Gerdts
http://mgerdts.blogspot.com/
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Christine Tran
 Does the data really need to be under the zonepath?  If you were to do
 something like:

 zfs create -o mountpoint=/stuff rpool/stuff
 mkdir /stuff/z1 /stuff/z2

 zonecfg -z z1
 add fs
 set dir=/stuff
 set special=/stuff/z1
 set options=rw
 end
 exit

 zonecfg -z z2
 add fs
 set dir=/stuff
 set special=/stuff/z2
 set options=rw
 end
 exit

 Adjust paths as needed to fit your application.  From the global zone,
 you should be able to mv /stuff/z1/* /stuff/z2/* efficiently.

I think I have tried something like this, basically pre-make the
zonepath as directories before cloning the zone?  It doesn't work.  I
end up getting a new dataset mounted on the directory I've created.

CT
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Mike Gerdts
On Tue, Feb 16, 2010 at 9:08 AM, Christine Tran
christine.t...@gmail.com wrote:
 Does the data really need to be under the zonepath?  If you were to do
 something like:

 zfs create -o mountpoint=/stuff rpool/stuff
 mkdir /stuff/z1 /stuff/z2

 zonecfg -z z1
 add fs
 set dir=/stuff
 set special=/stuff/z1
 set options=rw
 end
 exit

 zonecfg -z z2
 add fs
 set dir=/stuff
 set special=/stuff/z2
 set options=rw
 end
 exit

 Adjust paths as needed to fit your application.  From the global zone,
 you should be able to mv /stuff/z1/* /stuff/z2/* efficiently.

 I think I have tried something like this, basically pre-make the
 zonepath as directories before cloning the zone?  It doesn't work.  I
 end up getting a new dataset mounted on the directory I've created.

What I am suggesting is that there is another file system that is lofs
mounted into each zone.  Within z1 and z2 there are directories named
/stuff that really come from rpool/stuff/{z1,z2}.

-- 
Mike Gerdts
http://mgerdts.blogspot.com/
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Glenn Faden

Mike Gerdts wrote:

On Tue, Feb 16, 2010 at 9:08 AM, Christine Tran
christine.t...@gmail.com wrote:
  

Does the data really need to be under the zonepath?  If you were to do
something like:

zfs create -o mountpoint=/stuff rpool/stuff
mkdir /stuff/z1 /stuff/z2

zonecfg -z z1
add fs
set dir=/stuff
set special=/stuff/z1
set options=rw
end
exit

zonecfg -z z2
add fs
set dir=/stuff
set special=/stuff/z2
set options=rw
end
exit

Adjust paths as needed to fit your application.  From the global zone,
you should be able to mv /stuff/z1/* /stuff/z2/* efficiently.
  

I think I have tried something like this, basically pre-make the
zonepath as directories before cloning the zone?  It doesn't work.  I
end up getting a new dataset mounted on the directory I've created.



What I am suggesting is that there is another file system that is lofs
mounted into each zone.  Within z1 and z2 there are directories named
/stuff that really come from rpool/stuff/{z1,z2}.
  


Mike,

Your suggestion isn't suitable for Trusted Extensions because it 
conflicts with the labeling policy for LOFS mounts. All such LOFS mounts 
are forced to be read-only. Only the owning zone is permitted write 
access, and the label reported for files under the mount point is the 
label of the owning zone. In your workaround, the owner would be the 
global zone. What Christine requires is that the files get properly 
labeled and that they are mounted read-write.


The fact that the functionality changed from U5 in such a way that 
prevents upgrading to U7 seems like a regression to me, and therefore is 
a bug that must be fixed.


--Glenn

___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-16 Thread Mike Gerdts
On Tue, Feb 16, 2010 at 12:21 PM, Glenn Faden glenn.fa...@sun.com wrote:
 Mike Gerdts wrote:

 On Tue, Feb 16, 2010 at 9:08 AM, Christine Tran
 christine.t...@gmail.com wrote:


 Does the data really need to be under the zonepath?  If you were to do
 something like:

 zfs create -o mountpoint=/stuff rpool/stuff
 mkdir /stuff/z1 /stuff/z2

 zonecfg -z z1
 add fs
 set dir=/stuff
 set special=/stuff/z1
 set options=rw
 end
 exit

 zonecfg -z z2
 add fs
 set dir=/stuff
 set special=/stuff/z2
 set options=rw
 end
 exit

 Adjust paths as needed to fit your application.  From the global zone,
 you should be able to mv /stuff/z1/* /stuff/z2/* efficiently.


 I think I have tried something like this, basically pre-make the
 zonepath as directories before cloning the zone?  It doesn't work.  I
 end up getting a new dataset mounted on the directory I've created.


 What I am suggesting is that there is another file system that is lofs
 mounted into each zone.  Within z1 and z2 there are directories named
 /stuff that really come from rpool/stuff/{z1,z2}.


 Mike,

 Your suggestion isn't suitable for Trusted Extensions because it conflicts
 with the labeling policy for LOFS mounts. All such LOFS mounts are forced to
 be read-only. Only the owning zone is permitted write access, and the label
 reported for files under the mount point is the label of the owning zone. In
 your workaround, the owner would be the global zone. What Christine requires
 is that the files get properly labeled and that they are mounted read-write.

 The fact that the functionality changed from U5 in such a way that prevents
 upgrading to U7 seems like a regression to me, and therefore is a bug that
 must be fixed.

 --Glenn

I didn't realize that TX was involved.  Perhaps hacking my previous
suggestion (with zoneadm attach) into txzonemgr's clone() would be a
workaround until the regression is fixed or cross-fs moves and links
are supported in ZFS.

-- 
Mike Gerdts
http://mgerdts.blogspot.com/
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-13 Thread Frank Batschulat (Home)
On Fri, 12 Feb 2010 23:47:36 +0100, Christine Tran christine.t...@gmail.com 
wrote:

 Hi, I'm sorry to bug the OpenSolaris for a question that pertains to
 S10U8, but I am really stuck.

 I am doing a zoneadm clone -m copy, and I do not want a new ZFS
 dataset even though my zonepath is on a ZFS filesystem, for
 performance reasons particular to how I am using my zones.
 Unfortunately, zoneadm clone just ignores the -m copy, and makes me
 a new ZFS filesystem anyway; and by the speed with which it finished,
 it certainly is a snapshot operation underneath.

 I have tested with making the source zone on a separate UFS, have
 pre-made a dirname under my ZFS filesystem as the zonepath, nothing
 works.  I always get a new ZFS filesystem.  I see that zoneadm install
 has an -x nodataset switch, I need this for zone clone as well.  I
 have not seen this filed as a bug against S10, is there a work-around
 to get the behavior I want?

 This is sort of a big deal for our application.  We use labeled zones,
 a file move within a filesystem has a different performance profile
 than a move from one filesystem to another filesystem, even within one
 ZFS pool.  We are doing tens of thousands of move per minute.

Christine,

the '-m copy' option to 'clone' does not imply that no new zfs dataset
is created. 

snip
 clone [-m copy] [-s zfs_snapshot] source_zone

 Install a zone by copying an  existing  installed  zone.
 This  subcommand  is  an  alternative way to install the
 zone.

 -m copy

 Force the clone to be a copy, even if a ZFS  clone
 is possible.
snip end

it changes the method of clone to use 'find/cpio'

http://src.opensolaris.org/source/xref/pkg/on_ips/usr/src/cmd/zoneadm/zoneadm.c#copy_zone

instead of doing it with a zfs snapshot:

http://src.opensolaris.org/source/xref/pkg/on_ips/usr/src/cmd/zoneadm/zfs.c#clone_zfs

however, it does as well always create a new zfs dataset, this is intended.

http://src.opensolaris.org/source/xref/pkg/on_ips/usr/src/cmd/zoneadm/zoneadm.c#clone_copy

a '-x nodataset' option for 'clone' like in 'install' is unlikely going to 
happen, in
fact I will remove the '-x nodataset' option for 'install' completely soon in 
OSOL build 135

PSARC 2010/008 Remove zoneadm install sub-option -x nodataset
http://opensolaris.org/jive/thread.jspa?messageID=448598

your ZFS problem is with 'move' ie. rename a file from one dataset to another
while both datasets are still in the same pool ending up as a copy of the file
because it crosses dataset ie. file system boundaries. there's a ZFS RFE
open to improve that:

6483179 Provide an efficient way to rename a file to another dataset in same 
zpool
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6483179

6650426 RFE: support link(2) between ZFS filesystems
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6650426

---
frankB
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] zoneadm clone -m copy does not really copy on ZFS zonepath

2010-02-12 Thread Mike Gerdts
On Fri, Feb 12, 2010 at 4:47 PM, Christine Tran
christine.t...@gmail.com wrote:
 Hi, I'm sorry to bug the OpenSolaris for a question that pertains to
 S10U8, but I am really stuck.

 I am doing a zoneadm clone -m copy, and I do not want a new ZFS
 dataset even though my zonepath is on a ZFS filesystem, for
 performance reasons particular to how I am using my zones.
 Unfortunately, zoneadm clone just ignores the -m copy, and makes me
 a new ZFS filesystem anyway; and by the speed with which it finished,
 it certainly is a snapshot operation underneath.

 I have tested with making the source zone on a separate UFS, have
 pre-made a dirname under my ZFS filesystem as the zonepath, nothing
 works.  I always get a new ZFS filesystem.  I see that zoneadm install
 has an -x nodataset switch, I need this for zone clone as well.  I
 have not seen this filed as a bug against S10, is there a work-around
 to get the behavior I want?

You can probably work around this by replacing

zoneadm -z newzone clone -m copy master

With:

# do this once
zoneadm -z master halt
zoneadm -z master detach
cd $master_zonepath
tar cf $dir/master.tar .
zoneadm -z master attach

# do this for each zone to create
mkdir $newzone_zonepath
cd $newzone_zonepath
tar xpf $dir/master.tar
zonecfg -z newzone create -a $newzone_zonepath
zoneadm -z newzone attach
zoneadm -z newzone boot -s
zlogin newzone sys-unconfig
zoneadm -z newzone boot
zlogin -C newzone

You could certainly put the sys-unconfig before detaching the master
zone and could put other steps before the multi-user boot of newzone
to get a valid /etc/sysidcfg in place, thereby skipping the zlogin -C
and interaction with sysidconfig.

 This is sort of a big deal for our application.  We use labeled zones,
 a file move within a filesystem has a different performance profile
 than a move from one filesystem to another filesystem, even within one
 ZFS pool.  We are doing tens of thousands of move per minute.

 CT
 ___
 zones-discuss mailing list
 zones-discuss@opensolaris.org


-- 
Mike Gerdts
http://mgerdts.blogspot.com/
___
zones-discuss mailing list
zones-discuss@opensolaris.org