[ipxe-devel] Status Update: Booting VMWare ESXi 5.1 installer via iPXE native Multiboot (+iSCSI)
Thomas Glanzmann
thomas at glanzmann.de
Mon Sep 17 17:15:50 UTC 2012
Hello Marek,
> BTW - can you provide me any links to materials how can I use the perl
> in kickstart configs? Is it possible eg. to pass the MAC address or
> hostname (from DHCP) of the ESXi host to kickstart script and generate
> it dynamically?
most certainly it is, but I simply use the ip address of the calling
client:
(excalibur) [/export/ISO] cat /usr/lib/cgi-bin/esxi5.pl
#!/usr/bin/perl -w
use strict;
use warnings FATAL => 'all';
use Socket;
print "Content-type:text/plain\r\n\r\n";
my $hostname = gethostbyaddr(inet_aton($ENV{REMOTE_ADDR}), AF_INET) or die "Can't resolve $ENV{REMOTE_ADDR}: $!";
my $gateway = '10.10.10.1';
print <<EOF;
vmaccepteula
rootpw Pa\$\$w0rd
install --firstdisk --overwritevmfs
network --addvmportgroup=true --device=vmnic0 --bootproto=static --ip=$ENV{REMOTE_ADDR} --netmask=255.255.255.0 --gateway=${gateway} --nameserver=10.10.10.1 --hostname=$hostname
reboot
EOF
Cheers,
Thomas
More information about the ipxe-devel
mailing list