/[sysadmin-cookbook]/recepies/zfs/zfs-snapshot-to-ve.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/zfs/zfs-snapshot-to-ve.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 47 - (show annotations)
Sun May 10 13:01:49 2009 UTC (15 years ago) by dpavlin
File MIME type: application/x-sh
File size: 372 byte(s)
select zfs snapshot to turn into OpenVZ container

1 #!/bin/sh -x
2
3 veid=60017
4
5 fs=`zfs list | grep @ | iselect -t 'select snapshot to clone' -a | sed 's/ .*$//'`
6
7 if [ -z "$fs" ] ; then
8 exit;
9 fi
10
11 orig=`echo $fs | cut -d/ -f3 | cut -d@ -f1`
12
13 echo "clone $fs -- $orig to $veid";
14
15 clone=opl/clone/$orig-$veid
16
17 vzctl stop $veid && (
18 umount /$clone
19 zfs destroy $clone
20 )
21
22 zfs clone $fs opl/clone/$orig-$veid
23
24 vzctl start 60017
25

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26