Bug #13784
openzoneadm clone does not respect "-m copy" parameter
0%
Description
zoneadm does not properly parse the command line parameters.
- zoneadm -z mail2 clone -m copy mail
/usr/lib/brand/ipkg/clone: -m: unknown option
brand-specific usage: clone {sourcezone}
usage: clone [-m method] [-s <ZFS snapshot>] [brand-specific args] zonename
Clone the installation of another zone. The -m option can be used to
specify 'copy' which forces a copy of the source zone. The -s option
can be used to specify the name of a ZFS snapshot that was taken from
a previous clone command. The snapshot will be used as the source
instead of creating a new ZFS snapshot. All other arguments are passed
to the brand clone function; see brands(5) for more information.
Updated by Stephan Althaus about 2 years ago
As the "zfs clone" is carried out in the brand-specific script, i think
/usr/src/lib/brand/solaris10/zone/clone.ksh
is not capable of a zfs copy at the moment.
Updated by Stephan Althaus about 2 years ago
Ok, i am thinking of this:
->clone.ksh ( origin: local OI installation )
- Other brand clone options are invalid for this brand.
while getopts "R:s:Xz:m:" opt; do
case $opt in
R) ZONEPATH="$OPTARG" ;;
s) case "$OPTARG" in
*@*) # Full snapshot name was provided, or just "@snap" # Split this into dataset name (even if empty) and # snapshot name (also may be empty)
SNAPNAME="`echo "$OPTARG" | sed 's/^[^]*
//'`"
REQUESTED_DS="`echo "$OPTARG" | sed 's/\([^]*\)
.*$/\1/'`"
;;
*/*) # Only dataset name was passed, so we will make a # snapshot there automatically and clone off it
SNAPNAME=""
REQUESTED_DS="$OPTARG"
;;
*) # Only snapshot name was passed, so we will clone # the source zone's active ZBE and this snapshot
SNAPNAME="$OPTARG"
REQUESTED_DS=""
;;
esac
;;
X) NO_SYSUNCONFIG=yes ;;
z) ZONENAME="$OPTARG" ;;
m) DOZFSCOPY=yes ;;
*) fail_usage "";;
esac
done
...
- do clone
BENAME=zbe
BENUM=0
while [ $BENUMlt 100 ]; do$BENUM"
if [ -z "$DOZFSCOPY" ]; then
/usr/sbin/zfs clone $ACTIVE_DS@$SNAPNAME $zpds/$zpname/ROOT/$BENAME ;
else
/usr/sbin/zfs send $ACTIVE_DS@$SNAPNAME | /usr/sbin/zfs receive -v $zpds/$zpname/ROOT/$BENAME ;
fi
if [ $? = 0 ]; then
break
fi
BENUM=`expr $BENUM + 1`
BENAME="zbe
done
Updated by Stephan Althaus about 2 years ago
hmm. it seems that i can't find the correct source of my local file
/usr/lib/brand/ipkg/clone
it is NOT
illumos-gate/usr/src/lib/brand/solaris10/zone/clone.ksh
??