Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE SAN boot VBox with Fedora14
2011-04-08, 17:21
Post: #1
iPXE SAN boot VBox with Fedora14
Hi Everyone!

I have been trying to SAN boot VBox for the past few weeks. Now that I figure out how to get everything work. Here are the steps:

1. Set up iSCSI Target with your server:

1.1. Install iSCSI Enterprise Target to Server:
Assuming your server IP is 192.168.1.1.
See, http://iscsitarget.sourceforge.net/ for instructions.

1.2. Make a RAW disk image (8GB):
Code:
# dd if=/dev/zero of =/directory/of/target/disk.img bs=1M count=0 seek=8196

1.3. Add iSCSI Target by editing /etc/iet/ietd.conf:
Code:
Target iqn.2011-03.com.domain:disk.img
        Lun 0 Path=/directory/of/target/disk.img,Type=fileio

1.4. Restart IET service:
Code:
# service iscsi-target restart

2. Install Virtualbox:
See, http://www.virtualbox.org/.

3. Install Fedora 14 into iSCSI Target using Virtualbox:

3.1. Compile iPXE to get an image. I use floppy image (ipxe.dsk) and believe that CD/DVD (ipxe.iso) image should work equally well.

3.2. Prepare a iPXE boot script file (install.ipxe). It should look like:
Code:
#!ipxe
set initiator-iqn iqn.2011-04.com.domain:vbox.initiator
set iscsi-target iscsi:domain.com::::iqn.2011-03.com.domain:disk.img
set root-path ${iscsi-target}
set skip-san-boot 1
set keep-san 1
sanboot ${root-path} ||
# Use BFO to install
set base-url http://fedora.mirrors.pair.com/linux/releases/14/Fedora/i386/os/images
kernel ${base-url}/pxeboot/vmlinuz stage2=${base}/install.img
initrd ${base-url}/pxeboot/initrd.img
boot

3.3. Boot VBox with ipxe.dsk and press CTRL_B for manual boot. In command line, key in:
Code:
iPXE> dhcp
iPXE> chain http://domain.com/install.ipxe
This should connect your VBox with the iSCSI Target and load BFO. Follow the instructions on the screen. You should be able to install Fedora 14 into the iSCSI target.

4. Boot from the iSCSI target using VBox:
Once you are done with the installation, you can use the same iPXE image to SAN boot from the iSCSI target. I created another iPXE script file which looks like:
Code:
#!ipxe
set initiator-iqn iqn.2011-04.com.domain:vbox.initiator
set iscsi-target iscsi:domain.com::::iqn.2011-03.com.domain:disk.img
set root-path ${iscsi-target}
sanboot ${root-path} ||
After bringing up command line, you can type:
Code:
iPXE> dhcp
iPXE> chain http://domain.com/boot.ipxe
After a while, you should be able to SAN boot your Virtualbox using the newly installed Fedora Linux over the Internet. The speed may be slow, but it works! Kudos to the iPXE project!

5. Notes:

5.1. I choose Fedora because its installer supports iSCSI installation. Other distros should work, but haven't tried any. I would be interested in hearing any of your experiences.

5.2. I still cannot boot the same iSCSI target using different VMs. Any suggestions are welcomed!
Find all posts by this user
Quote this message in a reply
2011-04-08, 17:37
Post: #2
RE: iPXE SAN boot VBox with Fedora14
Thanks for writing that up!

(2011-04-08 17:21)hsuanyeh Wrote:  Once you are done with the installation, you can use the same iPXE image to SAN boot from the iSCSI target. I created another iPXE script file which looks like:
Code:
#!ipxe
set initiator-iqn iqn.2011-04.com.domain:vbox.initiator
set iscsi-target iscsi:domain.com::::iqn.2011-03.com.domain:disk.img
set root-path ${iscsi-target}
sanboot ${root-path} ||

If you want to, you can use the prompt command to unify the install.ipxe and boot.ipxe scripts into a single fedora.ipxe script:

Code:
#!ipxe
set initiator-iqn iqn.2011-04.com.domain:vbox.initiator
set iscsi-target iscsi:domain.com::::iqn.2011-03.com.domain:disk.img
set root-path ${iscsi-target}
# Set "skip-san-boot" only if user presses F12
prompt --key 0x197e --timeout 2000 Press F12 to install Fedora... && set skip-san-boot-1 ||
set keep-san 1
sanboot ${root-path} ||
# Use BFO to install
set base-url http://fedora.mirrors.pair.com/linux/releases/14/Fedora/i386/os/images
kernel ${base-url}/pxeboot/vmlinuz stage2=${base}/install.img
initrd ${base-url}/pxeboot/initrd.img
boot

If the user presses F12 within two seconds, then the installer will run, otherwise the system will boot normally from the SAN.
Visit this user's website Find all posts by this user
Quote this message in a reply
2011-04-12, 14:49
Post: #3
RE: iPXE SAN boot VBox with Fedora14
Quote:If the user presses F12 within two seconds, then the installer will run, otherwise the system will boot normally from the SAN.

Thanks for your suggestion, Michael! I have prepared a floppy image and an ISO image with embedded scripts. They are available here:

https://sites.google.com/site/apisodeproject/iscsi-boot

Assuming there's an active iSCSI target for installation/boot, the iPXE images allow users to enter iSCSI initiator and target information and thereafter install or boot Fedora. Hope it's useful.
Find all posts by this user
Quote this message in a reply
2011-08-08, 18:07
Post: #4
RE: iPXE SAN boot VBox with Fedora14
(2011-04-08 17:21)hsuanyeh Wrote:  I have been trying to SAN boot VBox for the past few weeks. Now that I figure out how to get everything work. Here are the steps ...
Cool. Smile

(2011-04-08 17:21)hsuanyeh Wrote:  5.2. I still cannot boot the same iSCSI target using different VMs. Any suggestions are welcomed!
I'm not sure that I understand why you'd want to boot more than one computer to the same SAN.

If multiple computers write to the same filesystem and that filesystem isn't designed for such multi-client use, that could be trouble!
Find all posts by this user
Quote this message in a reply
2011-08-09, 19:25
Post: #5
RE: iPXE SAN boot VBox with Fedora14
(2011-08-08 18:07)Sha0 Wrote:  I'm not sure that I understand why you'd want to boot more than one computer to the same SAN.

If multiple computers write to the same filesystem and that filesystem isn't designed for such multi-client use, that could be trouble!

1. I was trying to use one SAN image for different users, similar to the idea of terminal server. Unfortunately, Fedora 14 locks MAC address. It's not that trivial for me to unlock...

2. Also, a bit unrelated, I was trying to boot and run VBox (or other VM) using SAN as the root file system. I am hoping that after a short period of network outage, the system can still work. It looks like open-iscsi does not yet work for off-line mode. Any suggestions on the off-line mode?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)