[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] NBD scripts, courtesy of Kurt Garloff:



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID cd1cfbadb75f5fe1611a3c306ca37363c4e8b369
# Parent  f2ad4e0a7259eaa85d10a9ed9b1e2be589609289
NBD scripts, courtesy of Kurt Garloff:

For domain migration, unless you use a rootless setup, you need
to have network storage available. For the poor people like me that
have 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.

Signed-off-by: Kurt Garloff <garloff@xxxxxxx>

diff -r f2ad4e0a7259 -r cd1cfbadb75f tools/examples/block-nbd
--- /dev/null   Tue Oct 25 10:24:01 2005
+++ b/tools/examples/block-nbd  Tue Oct 25 10:52:56 2005
@@ -0,0 +1,35 @@
+#!/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
diff -r f2ad4e0a7259 -r cd1cfbadb75f tools/examples/xmexample.nbd
--- /dev/null   Tue Oct 25 10:24:01 2005
+++ b/tools/examples/xmexample.nbd      Tue Oct 25 10:52:56 2005
@@ -0,0 +1,13 @@
+kernel = "/boot/vmlinuz-2.6.13-15b-xen"
+ramdisk = "/boot/initrd-2.6.13-15b-xen"
+memory = 128
+name = "nbd4"
+nics=1
+# Please change MAC
+vif = [ 'mac=aa:cc:10:10:00:a0, bridge=xenbr0' ]
+# Please change PORT
+disk = [ 'nbd:134.100.233.115 20004,hda1,w' ]
+dhcp = "dhcp"
+hostname= "nbd4" 
+root = "/dev/hda1 ro"
+extra = "3"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.