Здравствуйте.
Решил создать в своей сетке (клиенты все Win7) бездисковую систему на основе ISCSI.
В качестве таргета Ubuntu.
Какое-то время изучал вопрос на Ubuntu 14.04.
Делал по этой инструкции:
https://interface31.ru/tech_it/2016/08/nastroyka-i...
Более менее разобрался.... Даже что-то работало....
Но когда дело дошло до реализации на практике, решил ставить Ubuntu 18.04
Как всё делал.
Всё основано на этом скрипте:
#Copy on write for vblade server v0.5
#toxicnaan guess what goes here gmail.com
#this uses raw device mapper commands, if your using either LVM,LVM2,DM,LOOP
#then run it at your own risk!
#This will be like crossing the streams, it will be bad, very bad.
#don't run this if you don't understand whats going on
#if this script murders your dog/cat, deletes your server, or causes a war
#you can't blame me.
#useage makecow.sh 'image file name'
#image file name is an image that you want booted over aoe.
#takes a current imagefile, and makes 8 cow devices using loop and devicemapper
#it uses sparse files to cut down on diskspace
#using this script allows for many machines booting over aoe to use
#the same primary disk image.
#all writes your clients with go into the cow files.
#you need to be root to run this.
#for extra fun, try placing your cow files on a suitable large ram disk
#like /dev/shm for extra speeeeeeeeeeeeeed!
#vblade dirly run in background, targets range from 0 0 to 0 7.
#big greets to the masters of #etherboot on freenode. Thanks for all
#your help getting gpxe working for me!!!!!!
#no thanks to device mapper documentation!!!!
modprobe dm_mod
modprobe dm_mirror
modprobe dm_snapshot
IMAGE_FILE=$1
img_loop_dev=`losetup -f`
losetup -v -f $IMAGE_FILE
cow_size=`blockdev --getsize $img_loop_dev`
echo $cow_size
chunk_size=64
FILE=$IMAGE_FILE
for loopnumber in 0 1 2 3
do
dd if=/dev/zero of=/storage/clon/$FILE.cow.$loopnumber bs=512 count=0 seek=$cow_size
COWLOOPDEV=`losetup -f`
losetup -v -f /storage/clon/$FILE.cow.$loopnumber
echo "0 $cow_size snapshot $img_loop_dev $COWLOOPDEV p $chunk_size" | dmsetup create $FILE.cow.$loopnumber
vblade 0 $loopnumber enp4s0 /dev/mapper/$FILE.cow.$loopnumber &
echo $COWLOOPDEV is attached to /storage/clon/$FILE.cow.$loopnumber
done
losetup -a
dmsetup table
Создаю образ диска:
mkdir /storage
dd if=/dev/zero of=/storage/games0.img bs=1M count=2048
Запускаю скрипт:
makecow.sh games0.img
В итоге получаю такое содержание каталогов:
root@tvserver:/storage# ls -lh /dev/mapper/
итого 0
crw------- 1 root root 10, 236 апр 26 12:45 control
lrwxrwxrwx 1 root root 7 апр 26 12:49 games0.img.cow.0 -> ../dm-0
lrwxrwxrwx 1 root root 7 апр 26 12:49 games0.img.cow.1 -> ../dm-1
lrwxrwxrwx 1 root root 7 апр 26 12:49 games0.img.cow.2 -> ../dm-2
lrwxrwxrwx 1 root root 7 апр 26 12:49 games0.img.cow.3 -> ../dm-3
root@tvserver:/storage# ls -lh /storage/clon/
итого 256K
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.0
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.1
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.2
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.3
Конфиг tgt, target00.conf:
# create new
# naming rule : [ iqn.(year)-(month).(reverse of domain name):(any name you like) ]
<target iqn.2019-04.ru.home:target00>
# provided devicce as a iSCSI target
backing-store /dev/mapper/games0.img.cow.0
</target>
С таким раскладом LUN в backing-store не прописывается!
root@tvserver:/etc/tgt/conf.d# tgtadm --mode target --op show
Target 1: iqn.2019-04.ru.home:target00
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 1
Initiator: iqn.1991-05.com.microsoft:work3 alias: none
Connection: 1
IP Address: xx.xx.xx.138
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: null
Backing store path: None
Backing store flags:
Account information:
ACL information:
ALL
Backing store path: None
Почему?