All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: block-nbd script and example config
@ 2005-10-19 21:57 Ian Pratt
  2005-10-19 22:07 ` Anthony Liguori
  2005-10-19 22:12 ` Nivedita Singhvi
  0 siblings, 2 replies; 12+ messages in thread
From: Ian Pratt @ 2005-10-19 21:57 UTC (permalink / raw)
  To: Kurt Garloff, Xen development list

 

> 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.

disk = [ 'nbd:134.100.233.115 20004,hda1,w' ]

I think having the space in the export device name is just a little too
nauseating :-)

Could we make the script take ip:port and then turn the ':' into a space
when invoking nbdclient?

On this subject, I think it would be less confusing if we configured
disks using a syntax more akin to that which we use for networking e.g.:

disks = [ 'export=phy:/dev/sda1, target=/dev/sda1, options=rw',
          'export=phy:/dev/vg/my_usr, target=/dev/sdb1, options=ro' ]

I know its late in the day to be making changes like this, but it
doesn't hurt to canvass opinion...

I'd also do away with all the fancy stuff we have to build the command
line and just have a single command line variable that we assemble
everything in to within the config file. The current magic just makes
things more confusing.


Ian





Ian
  

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: block-nbd script and example config
@ 2005-10-26 22:00 Ian Pratt
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Pratt @ 2005-10-26 22:00 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Xen development list, Kurt Garloff

 
> Yup.  Here's another example:
> 
> disks = [ 'export=file:/home/anthony/images/Fedora Core 
> 4.img, target=/dev/sda1, options=rw',
>
> This is going to become difficult to parse (we could split 
> with ',' here but then what if we have commas in files).  We 
> could support an escaping mechanism but then it would require 
> triple escapes like:
> 
> disks = [ 'export=file:/home/anthony/image/Fedora Core 4\\\, 
> x86-64.img, target=/dev/sda1, options=rw' ]

The best way of doing this is:

disks = [ 'export=file:"/home/anthony/images/Fedora Core 4.img",
target=/dev/sda1, options=rw',

We'd remove double quotes and treat anything between them as a single
token. I think this would work OK.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: block-nbd script and example config
@ 2005-10-25 12:15 Ian Pratt
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Pratt @ 2005-10-25 12:15 UTC (permalink / raw)
  To: Ewan Mellor, Kurt Garloff, Xen development list

 
> > 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 <garloff@suse.de>
> 
> Thanks Kurt -- I've commited these.  I renamed xen-nbd to 
> xmexample.nbd, for consistency with the other xm create 
> example configurations.

I still think we should ':' rather than space as the delimiter between
host and port, and have the script split out the args to nbdclient.
Having spaces in the device name is too ugly...

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: block-nbd script and example config
@ 2005-10-24 16:08 Ian Pratt
  2005-10-25 19:37 ` Anthony Liguori
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Pratt @ 2005-10-24 16:08 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Xen development list, Kurt Garloff

 

> >On this subject, I think it would be less confusing if we configured 
> >disks using a syntax more akin to that which we use for 
> networking e.g.:
> >  
> >
> I actually like this idea a lot.  I'm not a huge fan of the 
> current block device configuration.
> 
> >disks = [ 'export=phy:/dev/sda1, target=/dev/sda1, options=rw',
> >          'export=phy:/dev/vg/my_usr, target=/dev/sdb1, options=ro' ]
> >
> >I know its late in the day to be making changes like this, but it 
> >doesn't hurt to canvass opinion...
> >
> The only thing to think about is how do handle file devices 
> with spaces in the filename.  This is going to be common I think.
> 
> Comma and spaces are valid filename characters.  I think : is 
> probably the safest separator since it's used a lot.

Let's think a little about what we'd like this to look like. 

Taking a similar approach to network devices, we'd end up with something
that looks like this:

  disks = [ 'export=phy:/dev/sda1, target=/dev/sda1, options=rw',
            'export=phy:/dev/vg/my_usr, target=/dev/sdb1, options=ro' ]

I'm wandering whether the following although slightly ugly might be
better from a python POV (we'd change network devices acordingly too:

  disks = [ { 'export':'phy:/dev/sda1', 'target':'/dev/sda1',
'options':'rw' },
            { 'export':'phy:/dev/vg/my_usr', 'target':'/dev/sdb1',
'options':'ro' } ]
  
Is this just too ugly and would we be better off going with my first
proposal? Or should we just leave things alone for 3.0?

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread
* block-nbd script and example config
@ 2005-10-19 10:09 Kurt Garloff
  2005-10-25 10:53 ` Ewan Mellor
  0 siblings, 1 reply; 12+ messages in thread
From: Kurt Garloff @ 2005-10-19 10:09 UTC (permalink / raw)
  To: Xen development list


[-- Attachment #1.1.1: Type: text/plain, Size: 561 bytes --]

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 <garloff@suse.de>
-- 
Kurt Garloff, Director SUSE Labs, Novell Inc.

[-- Attachment #1.1.2: block-nbd --]
[-- Type: text/plain, Size: 785 bytes --]

#!/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

[-- Attachment #1.1.3: xen-nbd --]
[-- Type: text/plain, Size: 329 bytes --]

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"

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-10-26 22:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-19 21:57 block-nbd script and example config Ian Pratt
2005-10-19 22:07 ` Anthony Liguori
2005-10-20  0:52   ` Nicholas Lee
2005-10-20  3:25     ` Anthony Liguori
2005-10-20  8:15       ` Arnd Schmitter
2005-10-19 22:12 ` Nivedita Singhvi
  -- strict thread matches above, loose matches on Subject: below --
2005-10-26 22:00 Ian Pratt
2005-10-25 12:15 Ian Pratt
2005-10-24 16:08 Ian Pratt
2005-10-25 19:37 ` Anthony Liguori
2005-10-19 10:09 Kurt Garloff
2005-10-25 10:53 ` Ewan Mellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.