From: Kurt Garloff Subject: block-nbd script and example config Date: Wed, 19 Oct 2005 12:09:51 +0200 Message-ID: <20051019100951.GS8705@tpkurt.tagung.uni-hamburg.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0333622408==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen development list List-Id: xen-devel@lists.xenproject.org --===============0333622408== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qgEfXXHyyarqcYJd" Content-Disposition: inline --qgEfXXHyyarqcYJd Content-Type: multipart/mixed; boundary="bxF9Dep5HzwGj9mC" Content-Disposition: inline --bxF9Dep5HzwGj9mC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, For domain migration, unless you use a rootless setup, you need to have network storage available. For the poor people like me that dave no SAN, one easy possibility to have it is to use nbd. Find attached the block-nbd script (in /etc/xen/scripts/) and an example config file. The block-nbd script is based on the -enbd one. They have been used successfully in the Xen Tutorial at Linux Kongress. I would appreciate to see these integrated. Signed-off-by: Kurt Garloff --=20 Kurt Garloff, Director SUSE Labs, Novell Inc. --bxF9Dep5HzwGj9mC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=block-nbd #!/bin/sh # Usage: block-enbd [bind server ctl_port |unbind node] # # The file argument to the bind command is the file we are to bind to a # loop device. # # The node argument to unbind is the name of the device node we are to # unbind. # # This assumes you're running a correctly configured server at the other end! set -e #echo "block-enbd: $@" | logger -t xen case $1 in bind) for dev in /dev/nbd*; do if nbd-client $2 $3 $dev; then major=$(stat -L -c %t "$dev") minor=$(stat -L -c %T "$dev") pdev=$(printf "0x%02x%02x" 0x$major 0x$minor) xenstore-write "$XENBUS_PATH"/physical-device $pdev \ "$XENBUS_PATH"/node $dev exit 0 fi done exit 1 ;; unbind) nbd-client -d $2 exit 0 ;; esac --bxF9Dep5HzwGj9mC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xen-nbd Content-Transfer-Encoding: quoted-printable kernel =3D "/boot/vmlinuz-2.6.13-15b-xen" ramdisk =3D "/boot/initrd-2.6.13-15b-xen" memory =3D 128 name =3D "nbd4" nics=3D1 # Please change MAC vif =3D [ 'mac=3Daa:cc:10:10:00:a0, bridge=3Dxenbr0' ] # Please change PORT disk =3D [ 'nbd:134.100.233.115 20004,hda1,w' ] dhcp =3D "dhcp" hostname=3D "nbd4"=20 root =3D "/dev/hda1 ro" extra =3D "3" --bxF9Dep5HzwGj9mC-- --qgEfXXHyyarqcYJd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDVhtvxmLh6hyYd04RAtQ0AJ0Za9UM9wgzD6aDgTTfTIMLJvjshwCgq7Xw GJ4t0s52izlf4ZIuDBN+w3o= =bg7E -----END PGP SIGNATURE----- --qgEfXXHyyarqcYJd-- --===============0333622408== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0333622408==--