User Tools

Site Tools


Sidebar

software:iscsi:rhel_on_iscsi

What?

My notes on installing RHEL on iscsi. Here iscsi target is Fedora18, RHEL is installed in KVM guests. iscsi can be used in 2 ways:

iscsi RHEL deployment on KVM

# The following is used to create the virtual machine
virt-install -n $HOSTNAME -r 1024 --cpu host --nodisks \
        --location /mnt/store/deploy/repos/$DISTRO/ \
        --vcpus 2 -w bridge=virbr0 --os-variant rhel5.4 --graphics vnc \
        --extra-args "ip=$IPADDR netmask=255.255.255.0 ks=http://192.168.4.1/ks/$HOSTNAME repo=http://192.168.4.1/x86_64/$DISTRO"

# the following snippets in the kickstart file do
# - configure the installation on the iscsi target
# - create a simple single partition, so the vmlinuz/initrd can be accessed easily after installation
# - also /etc/grub.conf can be used easily
part / --size 256 --asprimary --grow --fstype=ext4
iscsiname iqn.2009-11.com.example:storage.disk1
iscsi --ipaddr=192.168.4.1 --port=3260 

With this the system can be installed on the iSCSI disk.

booting the iSCSI RHEL with explicit ip handover

# After installation we will mount the iscsi target to access kernel/initrd and /etc/grub.conf
# Here the iscsi target backend is blockdevice /dev/loop8, so we create the partition devnode
# and mount it
kpartx -ay /dev/loop8
mount /dev/mapper/loop8p1 /mnt/tmp
$ ls -1 /mnt/tmp/boot/initramfs* /mnt/tmp/boot/vmlinuz* /mnt/tmp/etc/grub.conf
/mnt/tmp/boot/initramfs-2.6.32-358.el6.x86_64.img
/mnt/tmp/boot/vmlinuz-2.6.32-358.el6.x86_64
/mnt/tmp/etc/grub.conf

cat /mnt/tmp/etc/grub.conf


virsh edit rhel5u8i
# and modify for this:
  <os>
    <type arch='x86_64' machine='pc-1.2'>hvm</type>
    <kernel>/mnt/tmp/boot/vmlinuz-2.6.32-358.el6.x86_64</kernel>
    <initrd>/mnt/tmp/boot/initramfs-2.6.32-358.el6.x86_64.img</initrd>
    <cmdline>ro root=UUID=3a8ab4f8-b383-4517-bc9e-3eee06704b02 ifname=eth0:52:54:00:03:0e:c2 netroot=iscsi:@192.168.4.1::3260::iqn.2009-11.com.example:storage.disk1 rd_NO_LUKS rd_NO_LVM ip=192.168.4.22::192.168.4.1:255.255.255.0:rhel6u3i:eth0:none iscsi_initiator=iqn.2009-11.com.example:storage.disk1 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM LANG=en_US.UTF-8</cmdline>
    <boot dev='hd'/>
  </os>

booting the iSCSI RHEL, including setting of iBFT

ifstat
dhcp
sanboot iscsi:192.168.4.1:::1:iqn.2009-11.com.example:storage.disk1
  • now we need to change the kernel options for iBFT. After boot of the system also change in ifcfg-eth0:
    • “ro root=/dev/mapper/vg_rhel6u3i-lv_root rd_NO_LUKS ip=ibft iscsi_firmware=1 ifname=eth0:52:54:00:1d:f9:f9 rd_NO_MD rd_LVM_LV=vg_rhel6u3i/lv_root rd_LVM_LV=vg_rhel6u3i/lv_swap rd_NO_DM LANG=en_US.UTF-8”
  • after boot of the system use “BOOTPROTO=ibft” in /etc/sysconfig/network-scripts/ifcfg-eth0

booting the iSCSI RHEL, including setting of iBFT, using VLAN

  • get ipxe.org ISO from http://ipxe.org - current builds include the required patches
  • direct ip config (did not work for me, only dhcp): http://ipxe.org/cmd/set
  • boot it, interrupt with <strg>+<b>, on the ipxe prompt:
ifstat
vcreate --tag 100 net0
dhcp net0-100
sanboot iscsi:192.168.4.1:::1:iqn.2003-01.org.x:disk1
  • alternatively, static ip:
vcreate --tag 123 net1
set net1-123/ip 192.168.4.23
set net1-123/gateway 192.168.4.1
set net1-123/netmask 255.255.255.0
ifopen net1-123
sanboot iscsi:192.168.4.2:::1:iqn.2003-01.org.x:disk1
  • for now the initrd does not evaluate VLAN info from the iBFT. You can modify the initrd to pick up the VLAN from iBFT.
  • booting from harddisk: sanboot --no-describe --drive 0x80

reading iBFT infos on booted linux

$ modprobe iscsi_ibft
$ iscsiadm -m fw
# BEGIN RECORD 6.2.0-873.2.el6
iface.initiatorname = iqn.2010-04.org.ipxe:05f0f0cb-29f4-3f30-8792-f3bf89b3426f
iface.transport_name = tcp
iface.hwaddress = 52:54:00:1d:f9:f9
iface.bootproto = STATIC
iface.ipaddress = 192.168.4.237
iface.subnet_mask = 255.255.255.0
iface.primary_dns = 192.168.4.1
iface.vlan_id = 0
iface.net_ifacename = eth0
node.name = iqn.2009-11.com.example:storage.disk1
node.conn[0].address = 192.168.4.1
node.conn[0].port = 3260
node.boot_lun = 01000000
# END RECORD
  • kernel: ip=ibft
  • sanhook
  • 'man dracut' for all commandline options. Can these options use ibft instead of details?
software/iscsi/rhel_on_iscsi.txt · Last modified: 2021/03/23 12:22 (external edit)