I want to try out iSCSI[wiki-iscsi] more, I've always liked the idea but never really got it working the way I wanted to.

So my plan right now is to use FreeBSD as both target and initiator so I kind of have a sane grip on both ends of the string. That also meens I'll be following the manual step by step at first till I figure out what some of all the funny names meens.

And to make it a bit more fun I'll be combining it all with [iPXE and DHCPd][ipxe-dhcpd] to see if I can, at first, get a virtual machine to boot up on a writeable iPXE volume...

Later on that volume could, with effort, be customized to facilitate an automated deployment system of heterogene service providers. (ooh, buzzword bingo)o

First time I'm not going to deal with authentication and security, I'm on a closed LAN so it's not an issue.

First I create a place for the volume.

root@storage:~ # zfs create zroot/iscsi
root@storage:~ # zfs set mountpoint=/iscsi zroot/iscsi
root@storage:~ # zfs create -V 8G zroot/iscsi/pxevolume0

So now the volume exists as /dev/zvol/zroot/iscsi/pxevolume0 and I can add that to the ctl.conf file.

portal-group pg0 {
        discovery-auth-group no-authentication
        listen 0.0.0.0
        listen [::]
}

target iqn.1670-04.com.example:pxevolume0 {
        auth-group no-authentication
        portal-group pg0

        lun 0 {
                path /dev/zvol/zroot/iscsi/pxevolume0
                size 8G
        }
}

Fortunately, I've got more than one FreeBSD computer, so for the initial client I'll use my laptop. That should also be able to mount the target and install so the disk isn't blank and the iPXE client can boot from it.

First you enable the iscsi client by adding iscsid_enable="YES" to /etc/rc.conf, start it with a simple service iscsid start then everything so far worked..

root@laptop:~ # iscsictl 
Target name                          Target portal    State
root@laptop:~ # iscsictl -A -p storage -t iqn.1670-04.com.example:pxevolume0
root@laptop:~ # iscsictl
Target name                          Target portal    State
iqn.1670-04.com.example:pxevolume0   storage            Connected: da0 

So far so good, I manually installed a basic system with MBR table and bootloader, so now for the tough part, getting iPXE to actually boot the stuff, but that's going to be an entirely different writeup!


Comments

comments powered by Disqus