Share
Embed
Transcript
75 slides
-
iSCSI RFCͰඪ४Խ͞Ε͍ͯΔ 3'$ J4$4*ͷجຊతͳن֨ 3'$ తͷλʔήοτΛݟ͚ͭΔํ๏ 3'$ ΠχγΤʔλλʔήοτͷ໊લͷॻ͖ํ 3'$ ೝূʹ͍ͭͯ
3'$ J4$4*ରԠػث͕ຬ͖ͨ͢ཁ݅ʹ͍ͭͯ 3'$ J4$4*ͷίϚϯυͷ࣮ߦॱংʹ͍ͭͯͷҙࣄ߲ 3'$ ຊՈͷ4$4*ͷ༷͕ߋ৽͞Ε͔ͨΒै͢Δͥ 3'$ 4-1WͰJ4$4*୳ͤΔΑ͏ʹ͢Δ֦ு ଞଟ -
LinuxڥͰiSCSIλʔήοτΛϚϯτ͠Α͏ $ iscsid Open-iSCSIͷσʔϞϯΛىಈ $ iscsiadm -m discovery -t st
-p 192.168.152.1 -P 1! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.406262d1b87f! !Portal: 192.168.152.1:3260,1! !!Iface Name: iface0! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f! !Portal: 192.168.152.1:3260,1! !!Iface Name: iface0 ϙʔλϧʹଓͯ͠λʔήοτΛ୳͢ iSCSIϙʔλϧͷϗετ iSCSIλʔήοτͷ໊લ -
$ iscsiadm -m node --targetname \! iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f --login! Logging in
to [iface: iface0, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.f3d75f94ab5f, portal: 192.168.152.1,3260]! Login to [iface: iface0, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.f3d75f94ab5f, portal: 192.168.152.1,3260] successful. iSCSIλʔήοτʹϩάΠϯ iSCSIλʔήοτͷ໊લ Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.406262d1b87f! !Portal: 192.168.152.1:3260,1! !!Iface Name: iface0! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f! !Portal: 192.168.152.1:3260,1! !!Iface Name: iface0 ϙʔλϧʹଓͯ͠λʔήοτΛ୳͢ -
iscsi.hahnela.x8664:sn.f3d75f94ab5f, portal: 192.168.152.1,3260] successful. iSCSIλʔήοτʹϩάΠϯ [776839.671781] scsi host10: iSCSI Initiator
over TCP/IP! [776839.932116] scsi 10:0:0:0: Direct-Access LIO-ORG IBLOCK 4.0 PQ: 0 ANSI: 5! [776839.933116] sd 10:0:0:0: Attached scsi generic sg2 type 0! [776839.933865] sd 10:0:0:0: [sdc] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)! [776839.933872] sd 10:0:0:0: [sdc] 4096-byte physical blocks! [776839.936005] sd 10:0:0:0: [sdc] Write Protect is off! [776839.936012] sd 10:0:0:0: [sdc] Mode Sense: 43 00 10 08! [776839.936422] sd 10:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA! [776839.962054] sdc: unknown partition table! [776839.965261] sd 10:0:0:0: [sdc] Attached SCSI disk ৽͍͠SCSIσΟεΫ͕ݱΕͨ -
$ mount -t auto /dev/sdc /mnt/iscsi! $ mount|grep /mnt/iscsi! /dev/sdc
on /mnt/iscsi type ext4 (rw) LinuxڥͰiSCSIλʔήοτΛϚϯτ͠Α͏ ͋ͱϩʔΧϧͷσΟεΫͱಉ͡Α͏ʹ͑Δ $ umount /dev/sdc! $ iscsiadm -m node --targetname \! iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f —logout! Logging out of session [sid: 7, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.f3d75f94ab5f, portal: 192.168.152.1,3260]! Logout of [sid: 7, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.f3d75f94ab5f, portal: 192.168.152.1,3260] successful. ཁΒͳ͘ͳͬͨΒumountͯ͠ϩάΞτ iSCSIλʔήοτͷ໊લ -
͍ $ dd if=/dev/zero of=./hoge.img bs=1024 count=500K! 512000+0 Ϩίʔυೖྗ! 512000+0
Ϩίʔυग़ྗ! 524288000 όΠτ (524 MB) ίϐʔ͞Ε·ͨ͠ɺ 9.79909 ඵɺ 53.5 MB/ඵ $ dd if=/dev/zero of=./hoge.img bs=1024 count=500K! 512000+0 Ϩίʔυೖྗ! 512000+0 Ϩίʔυग़ྗ! 524288000 όΠτ (524 MB) ίϐʔ͞Ε·ͨ͠ɺ 2.49186 ඵɺ 210 MB/ඵ NFSv4(async)+btrfsͰγʔέϯγϟϧϥΠτ iSCSI+btrfsͰγʔέϯγϟϧϥΠτ 53.5 MB/ඵ 210 MB/ඵ -
͍ $ time tar xf linux-3.19.3.tar! ! real! 4m3.048s! user!
0m0.835s! sys! 0m9.715s $ time tar xf linux-3.19.3.tar ! ! real 0m15.334s! user 0m0.454s! sys 0m3.097s NFSv4(async)+btrfsͰϑΝΠϧΛࢁ࡞ iSCSI+btrfsͰϑΝΠϧΛࢁ࡞ 43ඵ 15ඵ -
gcc -Wall -fno-strict-aliasing -I. -D_GNU_SOURCE -c -o server.o server.c! In
file included from server.c:7:0:! isns.h:249:1: Τϥʔ: ෆ໌ͳܕ໊ ‘time_t’ Ͱ͢! extern time_t isns_object_last_modified(const isns_object_t *);! ^! isns.h:348:1: Τϥʔ: ෆ໌ͳܕ໊ ‘time_t’ Ͱ͢! extern time_t isns_db_expire(isns_db_t *);! ^! isns.h:377:1: Τϥʔ: ෆ໌ͳܕ໊ ‘time_t’ Ͱ͢! extern time_t isns_run_timers(void);! ^! isns.h:500:50: ܯࠂ: ԾҾϦετͰ ‘struct timeval’ ͕એݴ͞Ε͍ͯ·͢ [σϑΥϧτ Ͱ༗ޮ]! extern isns_message_t * isns_recv_message(struct timeval *timeout);! ^! isns.h:500:50: ܯࠂ: ͦͷείʔϓ͜ͷఆٛ·ͨએݴͷΈͰ͢ɻ͜Εଟرͨ͠ͷͰ ͳ͍Ͱ͠ΐ͏ [σϑΥϧτͰ༗ޮ]! isns.h:671:1: Τϥʔ: ෆ໌ͳܕ໊ ‘time_t’ Ͱ͢! extern time_t isns_scn_transmit_all(void);! HMJCDͰଞͷϔομ͔ΒJODMVEF͞Ε͍ͯΔϔομΛ ࣗͰJODMVEF͍ͯ͠ͳ͍ -
cc -O2 -g -fPIC -Wall -Wstrict-prototypes -I../../include -I../../usr - D_GNU_SOURCE
-c -o prom_lex.o prom_lex.c! cc -O2 -g -fPIC -Wall -Wstrict-prototypes -I../../include -I../../usr - D_GNU_SOURCE -c -o prom_parse.tab.o prom_parse.tab.c! cc -O2 -g -fPIC -Wall -Wstrict-prototypes -I../../include -I../../usr - D_GNU_SOURCE -c -o fwparam_ppc.o fwparam_ppc.c! fwparam_ppc.c: ؔ ‘loop_devs’ :! fwparam_ppc.c:359:45: Τϥʔ: ‘__compar_fn_t’ ͕એݴ͞Ε͍ͯ·ͤΜ (͜ͷؔͰͷ࠷ ॳͷ༻)! qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);! ^! fwparam_ppc.c:359:45: උߟ: ະએݴͷࣝผࢠग़ݱ֤ͨؔ͠ͰҰճͷΈใࠂ͞Ε·͢! fwparam_ppc.c:359:59: Τϥʔ: expected ‘)’ before ‘nic_cmp’! qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);! ^! <builtin>: recipe for target 'fwparam_ppc.o' failed! make[1]: *** [fwparam_ppc.o] Error 1! make[1]: Leaving directory '/usr/src/open-iscsi-2.0-873.orig/utils/ fwparam_ibft'! Makefile:30: recipe for target 'user' failed! make: *** [user] Error 2 ඇඪ४ͷܕΛԕྀͳ͍ͬͯ͘Δ -
$ iscsiadm -m discovery -t st -p 192.168.152.1 -P 1!
iscsiadm: unrecognized character 'P' ͋ΒΏΔΦϓγϣϯ͕ະͷΦϓγϣϯѻ͍͞ΕΔ ͜ΕΒΛमਖ਼ͯ͠ग़དྷ্͕ͬͨόΠφϦΛ࣮ߦ͢Δͱ -
optopt = 0;! while ((ch = getopt_long(argc, argv, short_options,! long_options,
&longindex)) >= 0) {! (ུ)! }! if (optopt) {! log_error("unrecognized character '%c'", optopt);! rc = ISCSI_ERR_INVAL;! goto free_ifaces;! } HMJCDͰͦͷΑ͏ʹಈ͕͘ ಛʹن֨Ͱอূ͞Ε͍ͯΔΘ͚Ͱͳ͍ڍಈʹґଘ͍ͯ͠Δ getopt͕ࣦഊ࣌ʹҾΛॻ͖ࠐΉάϩʔόϧมoptoptʹ ޭ࣌ʹԿॻ͖ࠐ·Εͳ͍͜ͱΛظ͍ͯ͠Δ POSIXޭ࣌ͷʹ͍ͭͯԿنఆ͍ͯ͠ͳ͍ -
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/uip - I../../../src/unix -I../../../src/unix/libs -I../../../src/apps/ dhcpc
-I../../../../include -I../../../../usr -g -O2 -O2 -Wall - MT bnx2x.o -MD -MP -MF .deps/bnx2x.Tpo -c -o bnx2x.o bnx2x.c! In file included from ../../../src/unix/nic.h:46:0,! from bnx2x.h:41,! from bnx2x.c:57:! /usr/include/netinet/if_ether.h:96:8: Τϥʔ: ‘struct ethhdr’ ͷ ࠶ఆٛͰ͢! struct ethhdr {! ^! In file included from /usr/include/linux/ethtool.h:17:0,! from bnx2x.c:45:! /usr/include/linux/if_ether.h:137:8: උߟ: ݩʑ͜͜Ͱఆٛ͞Ε·ͨ͠! struct ethhdr {! ^! Makefile:352: recipe for target 'bnx2x.o' failed! NVTMMJCDͰ0QFOJ4$4*Λ͏ͷΛఘΊͨ -
$ targetcli! Warning: Could not load preferences file /root/.targetcli/prefs.bin.! targetcli
GIT_VERSION (rtslib GIT_VERSION)! Copyright (c) 2011-2013 by Datera, Inc.! All rights reserved.! Created '/sys/kernel/config/target/loopback'.! Created '/sys/kernel/config/target/iscsi'.! Created '/sys/kernel/config/target/srpt'.! /> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]! | o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> targetcliͰઃఆ -
ݸʑͷઃఆͦΕͧΕͷσΟϨΫτϦʹcdͯ͠ߦ͏ lsͰݱࡏͷσΟϨΫτϦҎԼʹ͋Δઃఆ߲Λ֬ೝ /> ls! o- / ................................................................... [...]! o- backstores
........................................................ [...]! | o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> ಉ໊͡લͷίϚϯυͰσΟϨΫτϦʹΑͬͯػೳ͕ҧ͏ʹҙ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> backstores ಡΈॻ͖͞ΕΔσʔλΛอଘ͓ͯ͘͠ॴ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> fileio ϑΝΠϧʹσʔλΛอଘ͢Δ -
fileio create <ετϨʔδ໊> <ϑΝΠϧ໊> <αΠζ> [ <bufferd> ] /> cd
/backstores/fileio! /backstores/fileio> create back0 /root/test.img 10M! Generating a wwn serial.! Not using buffered mode.! Created fileio back0.! /backstores/fileio> ls! o- fileio ................................................. [1 Storage Object]! o- back0 ...................................... [/root/test.img deactivated]! /backstores/fileio> createͰ৽͍͠backstoreΛ࡞ -
fileio delete <ετϨʔδ໊> /backstores/fileio> ls! o- fileio ................................................. [1 Storage
Object]! o- back0 ...................................... [/root/test.img deactivated]! /backstores/fileio> delete back0! Deleted storage object back0.! /backstores/fileio> ls! o- fileio ................................................. [0 Storage Object]! /backstores/fileio> deleteͰbackstoreΛআ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> iblock ϒϩοΫσόΠεʹσʔλΛอଘ͢Δ -
iblock create <ετϨʔδ໊> <σόΠε໊> /backstores/iblock> cd /! /> cd /backstores/iblock
! /backstores/iblock> create back0 /dev/sda4! Generating a wwn serial.! Created iblock storage object back0 using /dev/sda4.! /backstores/iblock> ls! o- iblock ................................................. [1 Storage Object]! o- back0 ........................................... [/dev/sda4 deactivated]! /backstores/iblock> createͰ৽͍͠backstoreΛ࡞ deletefileioͱಉ͡ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> pscsi SCSIύεεϧʔ SCSIίϚϯυΛLIOͰղऍͤͣʹ ผͷSCSIλʔήοτʹؙ͛͢Δ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> rd_dr/rd_mcp RAMʹσʔλΛอଘ͢Δ rd_mcp memcpyΛ͏खݎ͍࣮ rd_dr DMAΛ͏͍࣮ -
rd_dr/rd_mcp create <ετϨʔδ໊> <αΠζ> /> cd /backstores/rd_mcp /backstores/rd_mcp> create back1
10M Generating a wwn serial. Created rd_mcp ramdisk back1 with size 10M. /backstores/rd_mcp> ls o- rd_mcp ................................................. [1 Storage Object] o- back1 ............................................. [ramdisk deactivated] /backstores/rd_mcp> createͰ৽͍͠backstoreΛ࡞ deletefileioͱಉ͡ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> ετϨʔδͷݟͤํ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> SCSI RDMA Protocol ib_srpt InfinibandʹSCSIϓϩτίϧΛͤΔ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> loopback ͜ͷϗετʹ ৽͍͠SCSIσόΠε͕ଓ͞ΕͨΑ͏ʹݟ͑Δ -
loopback create [<wwn>] createͰ৽͍͠ϧʔϓόοΫλʔήοτΛ࡞ /> cd /loopback ! /loopback> create!
Created target naa.600140589cd08660.! /loopback> ls! o- loopback ....................................................... [1 Target]! o- naa.600140589cd08660 ............................. [naa.6001405cb9de14a5]! o- luns ......................................................... [0 LUNs]! /loopback> -
Logical Unit Number ͭͷ4$4*λʔήοτʹ ෳͷετϨʔδΛͿΒԼ͛Δ͜ͱ͕Ͱ͖Δ /> cd /loopback ! /loopback>
create! Created target naa.600140589cd08660.! /loopback> ls! o- loopback ....................................................... [1 Target]! o- naa.600140589cd08660 ............................. [naa.6001405cb9de14a5]! o- luns ......................................................... [0 LUNs]! /loopback> -
Logical Unit Number LUN0 LUN1 LUN2 LUN3 LUN4 ͍ʹ͑͠ͷύϥϨϧSCSI ετϨʔδΛचͭͳ͗ʹ͢Δ͜ͱ͕Ͱ໊͖ͨ
SCSIλʔήοτ గਖ਼ൃදதͰ-6/σΠδʔνΣʔϯͷσόΠεΛࣝผ͢Δͷ ʹ༻͍Δͱ͍ͯ͠·͕ͨ͠ɺͦͷ༻్Ͱ༻͍ΒΕΔͷλʔήοτ *%Ͱ-6/ͱผͰͨ͠ɻ-6/୯ҰͷσόΠε͕ෳͷػೳΛ ఏڙ͍ͯ͠Δ߹ʹɺͦΕΒΛࣝผ͢Δҝʹ༻͍ΒΕ·͢ -
/> cd loopback/naa.600140589cd08660/luns /loopback/naa...9cd08660/luns> create /backstores/fileio/back0 Selected LUN 0. Successfully
created LUN 0. /loopback/naa...9cd08660/luns> ls o- luns .............................................................. [1 LUN] o- lun0 ..................................... [fileio/back0 (/root/usb.img)] /loopback/naa...9cd08660/luns> Logical Unit Number create <ετϨʔδ໊> [<LUN>] createͰࢦఆͨ͠ετϨʔδͰ৽͍͠LUNΛ࡞ -
/> saveconfig! WARNING: Saving Olivia.localnet current configuration to disk will
overwrite your boot settings.! The current target configuration will become the default boot config.! Are you sure? Type 'yes': yes ઃఆΛอଘͯ͠λʔήοτ͕ग़དྷ͔ͨݟͯΈΑ͏ -
৽͍͠σΟεΫ͕ग़དྷͯΔ $ dmesg! (ུ)! [31290.708141] init_tag_map: adjusted depth to 256!
[31290.708145] init_tag_map: adjusted depth to 256! [31290.708221] scsi 4:0:1:0: Direct-Access LIO-ORG FILEIO 4.0 PQ: 0 ANSI: 5! [31290.708952] sd 4:0:1:0: [sdb] 204800 512-byte logical blocks: (104 MB/100 MiB)! [31290.709000] sd 4:0:1:0: [sdb] Write Protect is off! [31290.709003] sd 4:0:1:0: [sdb] Mode Sense: 43 00 00 08! [31290.709274] sd 4:0:1:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA! [31290.709519] sdb: unknown partition table! [31290.709679] sd 4:0:1:0: [sdb] Attached SCSI disk -
$ mkfs.ext4 /dev/sdb ! mke2fs 1.42.12 (29-Aug-2014)! Creating filesystem with
102400 1k blocks and 25688 inodes! Filesystem UUID: 58d4ec84-a14a-4b9a-874d-cf3cc1b06331! Superblock backups stored on blocks: ! ! 8193, 24577, 40961, 57345, 73729! ! Allocating group tables: done ! Writing inode tables: done ! Creating journal (4096 blocks): done! Writing superblocks and filesystem accounting information: done ! ! $ mount /dev/sdb /mnt/loop/! $ df -h! ϑΝΠϧγε αΠζ ༻ Γ ༻% ϚϯτҐஔ! (ུ)! /dev/sdb 93M 1.6M 85M 2% /mnt/loop! $ ϚϯτͰ͖ΔΑ -
/> ls! o- / ................................................................... [...]! o- backstores ........................................................ [...]!
| o- fileio ............................................. [0 Storage Object]! | o- iblock ............................................. [0 Storage Object]! | o- pscsi .............................................. [0 Storage Object]! | o- rd_dr .............................................. [0 Storage Object]! | o- rd_mcp ............................................. [0 Storage Object]! o- ib_srpt ..................................................... [0 Targets]! o- iscsi ....................................................... [0 Targets]! o- loopback .................................................... [0 Targets]! /> iSCSI TCP/IPωοτϫʔΫʹSCSIϓϩτίϧΛͤΔ -
/> cd iscsi ! /iscsi> create! Created target iqn.2003-01.org.linux-iscsi.olivia.x8664:sn.7bb390f60a12.! Selected
TPG Tag 1.! Successfully created TPG 1.! /iscsi> ls! o- iscsi .......................................................... [1 Target]! o- iqn.2003-01.org.linux-iscsi.olivia.x8664:sn.7bb390f60a12 ........ [1 TPG]! o- tpgt1 ....................................................... [enabled]! o- acls ....................................................... [0 ACLs]! o- luns ....................................................... [0 LUNs]! o- portals ................................................. [0 Portals]! /iscsi> iSCSI create [<wwn>] createͰ৽͍͠iSCSIλʔήοτΛ࡞ -
/iscsi> cd iqn.2003-01.org.linux-iscsi.olivia.x8664:sn.7bb390f60a12/tpgt1/luns ! /iscsi/iqn.20...12/tpgt1/luns> create /backstores/fileio/back0 ! Selected LUN
0.! Successfully created LUN 0.! /iscsi/iqn.20...12/tpgt1/luns> ls! o- luns .............................................................. [1 LUN]! o- lun0 ..................................... [fileio/back0 (/root/usb.img)]! /iscsi/iqn.20...12/tpgt1/luns> Logical Unit Number create <ετϨʔδ໊> [<LUN>] createͰࢦఆͨ͠ετϨʔδͰ৽͍͠LUNΛ࡞ ͜ͷ෦loopbackͷ߹ͱҰॹ -
/iscsi/iqn.20...0f60a12/tpgt1> cd portals ! /iscsi/iqn.20...tpgt1/portals> create 192.168.67.1! Using default IP
port 3260! Successfully created network portal 192.168.67.1:3260.! /iscsi/iqn.20...tpgt1/portals> ls! o- portals ........................................................ [1 Portal]! o- 192.168.67.1:3260 ................................... [OK, iser disabled]! /iscsi/iqn.20...tpgt1/portals> Portals create <IPΞυϨε> [<ϙʔτ>] ΠχγΤʔλ͔ΒͷଓΛͪड͚Δ ΞυϨεͱϙʔτΛࢦఆ͢Δ σϑΥϧτͷϙʔτ3260൪ -
/iscsi/iqn.20...12/tpgt1/acls> create iqn.2014-02.localnet.hahnela:openiscsi-5! bdbe8b0c609a2e4c0fa2a056ef7a686! Successfully created Node ACL for iqn.
2014-02.localnet.hahnela:openiscsi-5bdbe8b0c609a2e4c0fa2a056ef7a686! Created mapped LUN 0.! /iscsi/iqn.20...12/tpgt1/acls> ls! o- acls .............................................................. [1 ACL]! o- iqn.2014-02.localnet.hahnela:openiscsi-5bdbe8b0c609a2e4c0fa2a056ef7a686 [1 Mapped LUN]! o- mapped_lun0 ............................................... [lun0 (rw)]! /iscsi/iqn.20...12/tpgt1/acls> Access Control List create <ΠχγΤʔλͷ໊લ> ϩάΠϯΛڐՄ͢ΔΠχγΤʔλͷϦετ ೝূํ๏ύεϫʔυͷઃఆ͜͜ͰΔ -
/iscsi/iqn.20...12/tpgt1/acls> cd iqn.2014-02.localnet.hahnela:openiscsi-5bdbe8! b0c609a2e4c0fa2a056ef7a686/! /iscsi/iqn.20...a2a056ef7a686> set auth userid=foobar! Parameter userid
is now 'foobar'.! /iscsi/iqn.20...a2a056ef7a686> set auth password=hogefuga! Parameter password is now ‘hogefuga'.! /iscsi/iqn.20...a2a056ef7a686> get auth! AUTH CONFIG GROUP! authenticate_target=0 [ro]! The authenticate_target auth_attr.! ! password=hogefuga! The password auth_attr.! ! password_mutual=! The password_mutual auth_attr.! ! userid=foobar! The userid auth_attr.! ! userid_mutual=! The userid_mutual auth_attr. Ϣʔβ໊ͱύεϫʔυΛઃఆ͠Α͏ -
$ vim /etc/iscsi/iscsi.conf! (ུ)! # *************! # CHAP Settings! #
*************! ! # To enable CHAP authentication set node.session.auth.authmethod! # to CHAP. The default is None.! node.session.auth.authmethod = CHAP ← CHAPʹΑΔೝূΛ༗ޮʹ͢Δ! # To set a CHAP username and password for initiator! # authentication by the target(s), uncomment the following lines:! node.session.auth.username = foobar ← Ϣʔβ໊! node.session.auth.password = hogefuga ← ύεϫʔυ! ! # To set a CHAP username and password for target(s)! (ུ) ΠχγΤʔλଆʹϢʔβ໊ͱύεϫʔυΛઃఆ͠Α͏ -
$ iscsiadm -m discovery -t st -p 192.168.67.1 -P 1!
Target: iqn.2003-01.org.linux-iscsi.olivia.x8664:sn.7bb390f60a12! ! Portal: 192.168.67.1:3260,1! ! ! Iface Name: iface0! $ iscsiadm -m node --targetname iqn.2003-01.org.linux-iscsi.olivia.x8664:sn. 7bb390f60a12 --login! Logging in to [iface: iface0, target: iqn.2003-01.org.linux- iscsi.olivia.x8664:sn.7bb390f60a12, portal: 192.168.67.1,3260]! Login to [iface: iface0, target: iqn.2003-01.org.linux-iscsi.olivia.x8664:sn. 7bb390f60a12, portal: 192.168.67.1,3260] successful. ΠχγΤʔλଆ͔Βଓͯ͠ΈΑ͏ -
[967161.130736] scsi host33: iSCSI Initiator over TCP/IP! [967162.523325] scsi 33:0:0:0:
Direct-Access LIO-ORG FILEIO 4.0 PQ: 0 ANSI: 5! [967162.720618] sd 33:0:0:0: Attached scsi generic sg2 type 0! [967162.881617] sd 33:0:0:0: [sdc] 204800 512-byte logical blocks: (104 MB/100 MiB)! [967163.263347] sd 33:0:0:0: [sdc] Write Protect is off! [967163.263354] sd 33:0:0:0: [sdc] Mode Sense: 43 00 00 08! [967163.413784] sd 33:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA! [967164.335413] sdc: unknown partition table! [967165.274567] sd 33:0:0:0: [sdc] Attached SCSI disk ৽͍͠σΟεΫ͕ग़དྷͯΔ -
͜ͷଞʹ৭Μͳݟͤํ͕ग़དྷΔ 'JCSF$IBOOFM 'JCSF$IBOOFMʹ4$4*ϓϩτίϧΛͤΔ 'JCSF$IBOOFMPWFS &UIFSOFU '$P&ʹ4$4*ϓϩτίϧΛͤΔ 'JSF8JSF 'JSF8JSFଓͷσΟεΫʹͳΓ͖Δ *#.W4$4* *#.7JSUVBM*0ʹ4$4*ϓϩτίϧΛͤΔ
J4&3 *OpOJCBOEͰ5$1*1௨৴Λ͍ͯ͠Δ߹ʹ͑Δ ΑΓޮͷྑ͍J4$4* 64#(BEHFU 64#ଓͷσΟεΫʹͳΓ͖Δ WJSUJP LWNͷήετڥʹ4$4*σΟεΫΛఏڙ͢Δ -
$ /etc/init.d/iscsid start! * Use of the opts variable is
deprecated and will be! * removed in the future.! * Please use extra_commands, extra_started_commands or extra_stopped_commands.! * Checking open-iSCSI configuration ...! * Loading iSCSI modules ...! * Loading libiscsi ... [ ok ]! * Loading scsi_transport_iscsi ... [ ok ]! * Loading iscsi_tcp ... [ ok ]! * Starting iscsid ...! * Setting up iSCSI targets ...! iscsiadm: No records found! [ !! ]! BeagleBoneBlackͰOpen-iSCSIΛىಈ -
$ /etc/init.d/iscsid start! * Use of the opts variable is
deprecated and will be! * removed in the future.! * Please use extra_commands, extra_started_commands or extra_stopped_commands.! * Checking open-iSCSI configuration ...! * Loading iSCSI modules ...! * Loading libiscsi ... [ ok ]! * Loading scsi_transport_iscsi ... [ ok ]! * Loading iscsi_tcp ... [ ok ]! * Starting iscsid ...! * Setting up iSCSI targets ...! iscsiadm: No records found! [ !! ]! $ iscsiadm -m discovery -t st -p 192.168.152.1 -P1! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.406262d1b87f! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.aa5bd06b61e8! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! LIO͕ಈ͍͍ͯΔαʔόʹଓ -
* Please use extra_commands, extra_started_commands or extra_stopped_commands.! * Checking open-iSCSI
configuration ...! * Loading iSCSI modules ...! * Loading libiscsi ... [ ok ]! * Loading scsi_transport_iscsi ... [ ok ]! * Loading iscsi_tcp ... [ ok ]! * Starting iscsid ...! * Setting up iSCSI targets ...! iscsiadm: No records found! [ !! ]! $ iscsiadm -m discovery -t st -p 192.168.152.1 -P1! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.406262d1b87f! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.f3d75f94ab5f! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.aa5bd06b61e8! ! Portal: 192.168.152.1:3260,1! ! ! Iface Name: default! $ iscsiadm -m node --targetname iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8 --login! Logging in to [iface: default, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8, portal: 192.168.152.1,3260]! Login to [iface: default, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8, portal: 192.168.152.1,3260] successful.! iSCSIλʔήοτʹϩάΠϯ -
! ! Iface Name: default! Target: iqn.2003-01.org.linux-iscsi.hahnela.x8664:sn.aa5bd06b61e8! ! Portal: 192.168.152.1:3260,1!
! ! Iface Name: default! $ iscsiadm -m node --targetname iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8 --login! Logging in to [iface: default, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8, portal: 192.168.152.1,3260]! Login to [iface: default, target: iqn.2003-01.org.linux- iscsi.hahnela.x8664:sn.aa5bd06b61e8, portal: 192.168.152.1,3260] successful.! $ dmesg|tail! [ 786.904712] iscsid (933): /proc/933/oom_adj is deprecated, please use /proc/ 933/oom_score_adj instead.! [ 865.973831] scsi0 : iSCSI Initiator over TCP/IP! [ 867.037208] scsi 0:0:0:0: Direct-Access LIO-ORG IBLOCK 4.0 PQ: 0 ANSI: 5! [ 867.042950] sd 0:0:0:0: [sda] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)! [ 867.042999] sd 0:0:0:0: [sda] 4096-byte physical blocks! [ 867.047639] sd 0:0:0:0: [sda] Write Protect is off! [ 867.047698] sd 0:0:0:0: [sda] Mode Sense: 43 00 10 08! [ 867.049386] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA! [ 867.088748] sda: unknown partition table! [ 867.104140] sd 0:0:0:0: [sda] Attached SCSI disk! /dev/sdaొ