Re: Migration of Jail from one host to another?

2008-10-01 Thread Alexander Leidinger
Quoting "Scott Lambert" <[EMAIL PROTECTED]> (from Wed, 2 Jul 2008  
15:22:35 -0500):



I'm probably doing this completely wrong.  I setup a couple of jails
using simple image files because I thought that would make migration
to another server more straightforward.  I am now trying to migrate my
first jail.


A little bit late, but I moved 2 ezjails today (on 8-current). It was  
setup inside a ZFS, not in an image. It worked without problems (I  
transferred the ZFS data (zfs send | zfs receive), the fstab file, and  
the ezjail config file).



 /usr/local/etc/rc.d/ezjail.sh start
 ezjailConfiguring jails:.
Starting jails: testnetmount: /home/ezjails/migrate.jail.device :  
Operation not permitted


You have a problem here. You may want to look into ezjail what the  
testnetmount is doing. I assume there's some problem with creating the  
md device.



df: /home/ezjails/migrate.jail/dev: No such file or directory
mount: /home/ezjails/migrate.jail/dev: No such file or directory


I think this and the rest are followup errors of the failed mount of  
the disk image.


Bye,
Alexander.

--
You may get an opportunity for advancement today.  Watch it!

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Migration of Jail from one host to another?

2008-07-02 Thread Scott Lambert
I'm probably doing this completely wrong.  I setup a couple of jails
using simple image files because I thought that would make migration
to another server more straightforward.  I am now trying to migrate my
first jail.

I am using the ezjail tools for creating and maintaining jails.

The existing jail host is 6.2-STABLE FreeBSD 6.2-STABLE #1: Sun Mar 11
21:46:01 CDT 2007, ezjail-2.0.1.

The new jail host is 7.0-STABLE FreeBSD 7.0-STABLE #0: Sat May 10
06:29:00 CDT 2008, ezjail-2.1.

I have created a test jail on the 7.0-STABLE box with ezjail-admin which
works perfectly, using what I believe were the exact same parameters
given, other than IP/hostname, when I created the 6.2-STABLE jail.

 # ezjail-admin create -i -s 1G test 192.168.8.237

I have moved over the fstab.migrate_jail file, and the
/u/l/e/ezjail/migrate_jail config file for the 6.2-STABLE jail to the
7.0-STABLE box and created an empty directory beside the 7.0 test jail's
empty directory.  I shut down the jail on the 6.2-STABLE host and
scp'd the image file to the 7.0-STABLE box.  I put it beside the empty
jail directory.  I made sure the fstab.test and the fstab.migrate_jail
look the same except for jail name changes.  I made sure the
/u/l/e/ezjail/test and /u/l/e/ezjail/migrate_jail files look the same
except for jail name changes.

 # more /etc/fstab.test
/home/ezjails/test.device /home/ezjails/test ufs rw 0 0
/home/ezjails/basejail /home/ezjails/test/basejail nullfs ro 0 0

 # more /etc/fstab.migrate_jail
/home/ezjails/migrate.jail.device /home/ezjails/migrate.jail ufs rw 0 0
/home/ezjails/basejail /home/ezjails/migrate.jail/basejail nullfs ro 0 0

 # more test_tcworks_net 
export jail_test_hostname="test"
export jail_test_ip="192.168.8.237"
export jail_test_rootdir="/home/ezjails/test"
export jail_test_exec="/bin/sh /etc/rc"
export jail_test_mount_enable="YES"
export jail_test_devfs_enable="YES"
export jail_test_devfs_ruleset="devfsrules_jail"
export jail_test_procfs_enable="YES"
export jail_test_fdescfs_enable="YES"
export jail_test_image="/home/ezjails/test.img"
export jail_test_imagetype="simple"
export jail_test_attachparams=""
export jail_test_attachblocking=""
export jail_test_forceblocking=""

 # more migrate_jail
export jail_migrate_jail_hostname="migrate.jail"
export jail_migrate_jail_ip="192.168.8.238"
export jail_migrate_jail_rootdir="/home/ezjails/migrate.jail"
export jail_migrate_jail_exec="/bin/sh /etc/rc"
export jail_migrate_jail_mount_enable="YES"
export jail_migrate_jail_devfs_enable="YES"
export jail_migrate_jail_devfs_ruleset="devfsrules_jail"
export jail_migrate_jail_procfs_enable="YES"
export jail_migrate_jail_fdescfs_enable="YES"
export jail_migrate_jail_image="/home/ezjails/migrate.jail.img"
export jail_migrate_jail_imagetype="simple"
export jail_migrate_jail_attachparams=""
export jail_migrate_jail_attachblocking=""
export jail_migrate_jail_forceblocking=""

14:35:33 Wed Jul 02 # egrep -v '^(#|$)' ../ezjail.conf 
ezjail_jaildir=/home/ezjails

 /usr/local/etc/rc.d/ezjail.sh start
 ezjailConfiguring jails:.
Starting jails: testnetmount: /home/ezjails/migrate.jail.device : Operation not 
permitted
df: /home/ezjails/migrate.jail/dev: No such file or directory
mount: /home/ezjails/migrate.jail/dev: No such file or directory
/etc/rc.d/jail: WARNING: devfs_domount(): Unable to mount devfs on 
/home/ezjails/migrate.jail/dev
/etc/rc.d/jail: WARNING: devfs_mount_jail: devfs was not mounted on 
/home/ezjails/migrate.jail/dev
cd: can't cd to /home/ezjails/migrate.jail/dev
mount: /home/ezjails/migrate.jail/dev: No such file or directory
 cannot start jail "migrate_jail": 
jail: getpwnam: root: No such file or directory
.

 # ls -la /home/ezjails/
total 2098282
drwxr-xr-x 9 root  wheel 512 Jul  2 14:27 .
drwxr-xr-x  3182 root  wheel   58368 Jun  3 22:58 ..
drwxr-xr-x 9 root  wheel 512 Jun  4 00:40 basejail
drwxr-xr-x 2 root  wheel 512 Jun  3 22:58 ezjailtemp
drwxr-xr-x 3 root  wheel 512 Jun  4 00:41 flavours
drwxr-xr-x 2 root  wheel 512 Jul  1 16:54 fulljail
lrwxr-xr-x 1 root  wheel  14 Jul  2 13:45 log -> ../var/run/log
drwxr-xr-x12 root  wheel 512 Jun  4 00:41 newjail
drwxr-xr-x 2 root  wheel 512 Jul  1 17:43 migrate.jail
lrwxr-xr-x 1 root  wheel   8 Jul  2 14:27 migrate.jail.device -> 
/dev/md9
-rw-r--r-- 1 root  wheel  1073741824 Jul  1 17:02 migrate.jail.img
drwxr-xr-x13 root  wheel 512 Jul  2 13:46 test
lrwxr-xr-x 1 root  wheel   8 Jul  2 14:27 test.device -> /dev/md8
-rw-r--r-- 1 root  wheel  1073741824 Jul  2 14:28 test.img

 # ls -la /home/ezjails/migrate.jail
total 4
drwxr-xr-x  2 root  wheel  512 Jul  1 17:43 .
drwxr-xr-x  9 root  wheel  512 Jul  2 14:27 ..

 # ls -la /home/ezjails/test
total 31
drwxr-xr-x  13 root  wheel  512 Jul  2 13:46 .
drwxr-xr-x   9 root  wheel  512 Jul  2 14:27 ..
drwxrwxr-x   2 root  operator   512 Jul  2 13:46 .snap
-r--r--r-