README 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. INTRODUCTION
  2. ------------
  3. The vblade is a minimal ATA over Ethernet (AoE) storage target. Its
  4. focus is simplicity, not performance or richness of features. It
  5. exports a seekable file available over an ethernet local area network
  6. (LAN) via the AoE data storage protocol.
  7. The name, "vblade," is historical: It is a virtual EtherDrive (R)
  8. blade. The first AoE target hardware sold by Coraid was in a blade
  9. form factor, ten to a 4-rack-unit chassis.
  10. The seekable file is typically a block device like /dev/md0 but even
  11. regular files will work. Sparse files can be especially convenient.
  12. When vblade exports the block storage over AoE it becomes a storage
  13. target. Another host on the same LAN can access the storage if it has
  14. a compatible aoe kernel driver.
  15. BUILDING
  16. --------
  17. The following command should build the vblade program on a Linux-based
  18. system:
  19. make
  20. For FreeBSD systems, include an extra parameter like so:
  21. make PLATFORM=freebsd
  22. EXAMPLES
  23. --------
  24. There is a "vbladed" script that daemonizes the program and sends its
  25. output to the logger program. Make sure you have logger installed if
  26. you would like to run vblade as a daemon with the vbladed script.
  27. ecashin@kokone vblade$ echo 'I have logger' | logger
  28. ecashin@kokone vblade$ tail -3 /var/log/messages
  29. Feb 8 14:52:49 kokone -- MARK --
  30. Feb 8 15:12:49 kokone -- MARK --
  31. Feb 8 15:19:56 kokone logger: I have logger
  32. Here is a short example showing how to export a block device with a
  33. vblade. (This is a loop device backed by a sparse file, but you could
  34. use any seekable file instead of /dev/loop7.)
  35. ecashin@kokone vblade$ make
  36. cc -Wall -c -o aoe.o aoe.c
  37. cc -Wall -c -o linux.o linux.c
  38. cc -Wall -c -o ata.o ata.c
  39. cc -o vblade aoe.o linux.o ata.o
  40. ecashin@kokone vblade$ su
  41. Password:
  42. root@kokone vblade# modprobe loop
  43. root@kokone vblade# dd if=/dev/zero bs=1k count=1 seek=`expr 1024 \* 4096` of=bd
  44. -file
  45. 1+0 records in
  46. 1+0 records out
  47. 1024 bytes transferred in 0.009901 seconds (103423 bytes/sec)
  48. root@kokone vblade# losetup /dev/loop7 bd-file
  49. root@kokone vblade# ./vblade 9 0 eth0 /dev/loop7
  50. ioctl returned 0
  51. 4294968320 bytes
  52. pid 16967: e9.0, 8388610 sectors
  53. Here's how you can use the Linux aoe driver to access the storage from
  54. another host on the LAN.
  55. ecashin@kokone ecashin$ ssh makki
  56. Last login: Mon Feb 7 10:25:04 2005
  57. ecashin@makki ~$ su
  58. Password:
  59. root@makki ecashin# modprobe aoe
  60. root@makki ecashin# aoe-stat
  61. e9.0 eth1 up
  62. root@makki ecashin# mkfs -t ext3 /dev/etherd/e9.0
  63. mke2fs 1.35 (28-Feb-2004)
  64. ...
  65. Creating journal (8192 blocks): done
  66. Writing superblocks and filesystem accounting information: done
  67. This filesystem will be automatically checked every 24 mounts or
  68. 180 days, whichever comes first. Use tune2fs -c or -i to override.
  69. root@makki ecashin# mkdir /mnt/e9.0
  70. root@makki ecashin# mount /dev/etherd/e9.0 /mnt/e9.0
  71. root@makki ecashin# echo hooray > /mnt/e9.0/test.txt
  72. root@makki ecashin# cat /mnt/e9.0/test.txt
  73. hooray
  74. Remember: be as careful with these devices as you would with /dev/hda!
  75. Jumbo Frame Compatibility
  76. -------------------------
  77. Vblade can use jumbo frames provided your initiator is jumbo frame
  78. capable. There is one small configuration gotcha to consider
  79. to avoid having the vblade kernel frequently drop frames.
  80. Vblade uses a raw socket to perform AoE. The linux kernel will
  81. only buffer a certain amount of data for a raw socket. For 2.6
  82. kernels, this value is managed through /proc:
  83. root@nai aoe# grep . /proc/sys/net/core/rmem_*
  84. /proc/sys/net/core/rmem_default:128000
  85. /proc/sys/net/core/rmem_max:128000
  86. rmem_max is the max amount a user process may expand the receive
  87. buffer to -- through setsockopt(...) -- and rmem_default is, as you
  88. might expect, the default.
  89. The gotcha is that this amount to buffer does not relate
  90. to the amount of user data buffered, but the amount of
  91. real data buffered. As an example, the Intel GbE controller
  92. must be given 16KB frames to use an MTU over 8KB.
  93. For each received frame, the kernel must be able to buffer
  94. 16KB, even if the aoe frame is only 60 bytes in length.
  95. The linux aoe initiator will use 16 outstanding frames when
  96. used with vblade. A good default for ensuring frames are
  97. not dropped is to allocate 16KB for 17 frames:
  98. for f in /proc/sys/net/core/rmem_*; do echo $((17 * 16 * 1024)) >$f; done
  99. Be sure to start vblade after changing the buffering defaults
  100. as the buffer value is set when the socket is opened.
  101. AoE Initiator Compatibility
  102. ---------------------------
  103. The Linux aoe driver for the 2.6 kernel is compatible if you use
  104. aoe-2.6-7 or newer. You can use older aoe drivers but you will only
  105. be able to see one vblade per MAC address.
  106. Contrib Patches
  107. ---------------
  108. see contrib/README
  109. Kvblade
  110. -------
  111. While vblade runs as a userland process (like "ls" or "vi"), there
  112. is another program that runs inside the kernel. It is called
  113. kvblade. It is alpha software.