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:
# 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.
# 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>
ifstat dhcp sanboot iscsi:192.168.4.1:::1:iqn.2009-11.com.example:storage.disk1
ifstat vcreate --tag 100 net0 dhcp net0-100 sanboot iscsi:192.168.4.1:::1:iqn.2003-01.org.x:disk1
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
$ 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