Hello all!
I am having trouble PXE booting a CentOS client in VMware which doesn't support iSCSI booting. I have set up a Debian (Wheezy) SAN to boot a CentOS6 client in VMWare Workstation 9 as a project for work. VMWare Workstation 9 doesn't support iSCSI boot, but it does support PXE, so I have resorted to PXE chainloading.
The Debian server has bind9, isc-dhcp-server and tftpd-hpa configured to serve a DHCP address the the client and TFTP boot an iPXE file (undionly.kpxe) that will give the ability to boot iSCSI. Everything works great as CentOS boots, but errors on connecting to the SAN.
I took extensive notes for those of you who are either extremely thorough or gluttons for punishment! My notes are below, the problem seems to be in the syntax used in /etc/dhcp/dhcpd.conf "iscsi:initiator1.example.com::::iqn.2013-06.com.example:storage.lun0"
Anybody here have an idea of what my mistake may be? I have added a .png screenshot of the error as CentOS loads attached if you'd like to see the error.
Thanks in advance for your time! And here comes the pain:
// Another day, another attempt at configuring this!
// Reverted back to a snapshot of a freshly installed Debian "san0"
// going to set up Bind9 first, make sure there are no loopholes in my topology...
apt-get install bind9
vim /etc/resolv.conf
search example.com
nameserver 192.168.99.6
chattr +i /etc/resolv.conf
// A new command I learned to make this file unwritable/delete-able by anyone!
// chattr -i {file} to remove this attribute, write to file and then chattr +i {file} again to lock it
vim /etc/network/interfaces
# San to Client interface
auto eth1
iface eth1 inet static
address 192.168.99.6
netmask 255.255.255.0
network 192.168.99.0
nameserver 192.168.99.6
cp /etc/bind/named.conf.local named.conf.local_ORIGINAL
cp /etc/bind/db.local example.com
cp /etc/bind/db.127 example.com.loopback
vim /etc/bind/named.conf.local
# San to Client zone
zone "example.com" IN {
Type master;
file "/etc/bind/example.com";
allow-update {none;};
};
# Reverse-lookup zone
zone "99.168.192.in-addr.arpa" IN {
Type master;
file "/etc/bind/example.com.loopback";
allow-update {none;};
};
vim /etc/bind/example.com
@ IN SOA example.com. root.example.com. (
{arbitrary stuff written here...}
;
@ IN NS example.com.
@ IN A 192.168.99.6
@ IN MX 0 mail
san0 IN A 192.168.99.6
san1 IN A 192.168.99.5
initiator1 IN A 192.168.99.10
initiator2 IN A 192.168.99.11
vim /etc/bind/example.com.loopback
@ IN SOA san0.example.com. root.example.com. (
{arbitrary stuff written here...}
;
99.168.192.in-addr.arpa. IN NS san0.example.com.
6 IN PTR san0.example.com
5 IN PTR san1.example.com
10 IN PTR initiator1.example.com.
11 IN PTR initiator2.example.com.
nslookup example.com
Server: 192.168.99.6
Address: 192.168.99.6#53
Name:example.com
Address: 192.168.99.6
nslookup initiator1
Server: 192.168.99.6
Address 192.168.99.6#53
Name: initiator1.example.com
Address: 192.168.99.10
nslookup 192.168.99.11
Server: 192.168.99.6
Address 192.168.99.6#53
11.99.168.192.in-addr.arpa name = initiator2.example.com
// Sweet, looks like our DNS is working like it should!
// A minor success, but a success nonetheless!
// Time to take a break and work on DHCP after the wife goes to bed...
// Ok, it's only 1030pm... sart with setting up DHCP
// Should I use isc-dhcp-server or dnsmasq?
// It looks like dnsmasq can double as dhcp and tftp, but will its dns affect bind9?
// Let's just use isc-dhcp-server since we know that one...
// But let's reinstall CentOS to our iSCSI Target image & find the undionly.kpxe we need
// Uh, let's make a snapshot since even awesome notes can't save me sometimes! (san0_1)
w3m
http://etherboot.org/wiki/pxechaining
// Ok, found a preconfigured file from rom-o-matic (fingers crossed...)
// It's in root (/) and is named "gpxe-1.0.1-undionly.kpxe"
mkdir /storage
dd if=/dev/zero of=/storage/lun0.img bs=1024 count=5000000
dd if=/dev/zero of=/storage/lun1.img bs=1024 count=5000000
cd /storage
ls -alh
4.8G lun0.img
4.8G lun1.img
// And we're gonna' need our iscsi target running to install...
apt-get install iscsitarget iscsitarget-dkms
vim /etc/default/iscsitarget
ISCSITARGET_ENABLE=true
vim /etc/iet/ietd.conf
#
#iSCSI connection to Client (initiator1 @ 192.168.99.10)
Target iqn.2013-06.com.example:storage.lun0
Lun 0 Path=/storage/lun0.img
Alias LUN0
reboot
// Just for good measure...
service isc-dhcp-server status
Running
service iscsitarget status
Running
// Now over to the CentOS install...
eth0 is configured DHCP to Comcast to get the netinstall
http://mirror.centos.org/centos/6/os/x86_64
eth1 is configured static to SAN0 (192.168.99.6)
Advanced Storage Options:
Add iSCSI target
Bind targets to network interfaces
Target IP: 192.168.99.6
iSCSI Initiator Name: initiator1
Vendor: iet
Interconnect: SCSI
Device: mpatha
Hostname:initiator1
// Ok, now that our extra stuff is ready(?), we can install CentOS again & work on DHCP
vim /etc/dhcp/dhcpd/conf
ddns-update-style none;
option domain-name "example.com";
option domain-name-servers san0.example.com;
default-lease-time 6000;
max-lease-time 7200;
authorative;
subnet 192.168.99.0 netmask 255.255.255.0 {
range 192.168.99.15 192.168.99.20;
}
//Put this in because DHCP was complaining about having no declaration for eth1...
host initiator1 {
hardware ethernet 00:0C:29:A8:93
F;
fixed-address 192.168.99.10;
}
if exists user-class and option user-class = "iPXE" {
filename "";
option root-path "iscsi:initiator1.example.com::::iqn.2013-06.com.example:storage.lun0";
} else {
next-server 192.168.99.6;
filename "undionly.kpxe";
}
service isc-dhcp-server restart
// After installing CentOS, it looks like it is getting an address and looking for a TFTP server
// Unfortunately it's now almost 3am... time to finish tomorrow.
'
'
// Ok, time to look for 2am spelling errors, now that it's Monday morning!
// Take another snapshot (san0_2)
apt-get install tftpd-hpa
wget
http://boot.ipxe.org/undionly.kpxe
// The older gPXE I got from etherboot isn't supported, get an iPXE instead
vim /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
cp undionly.kpxe /srv/tftp/undionly.kpxe
service tftpd-hpa restart
service tftpd-hpa status
// Running
service isc-dhcp-server restart
service isc-dhcp-server status
// Running
// Time to boot the client again...
// Limited success! Boots to PXE, finds a TFTP server and boots iPXE but then errors out...
// "Could not open SAN device: Connection timed out"
// It looks like my syntax:
Root path: iscsi:initiator1.example.com::::iqn.2013-06.com.example:storage.lun0
// May be incorrect.... it's Monday, lets see what Abe thinks of this error...