From 17546f5bca38bd3da26540f9ff32580860bda54a Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 16 Jun 2009 18:57:12 +0000 Subject: [PATCH] -Make basic modifications for ESX4 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3589 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/esx.esx4.tmpl | 27 ++++++++++ xCAT-server/lib/xcat/plugins/anaconda.pm | 63 ++++++++++++------------ 2 files changed, 59 insertions(+), 31 deletions(-) create mode 100644 xCAT-server/esx.esx4.tmpl diff --git a/xCAT-server/esx.esx4.tmpl b/xCAT-server/esx.esx4.tmpl new file mode 100644 index 000000000..8e08a471c --- /dev/null +++ b/xCAT-server/esx.esx4.tmpl @@ -0,0 +1,27 @@ +install url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch# +timezone --utc "#TABLE:site:key=timezone:value#" +#vmserialnum --esx=todo-prod-key-here +keyboard us +#firewall --disable +rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +auth --enableshadow --enablemd5 +clearpart --firstdisk --overwritevmfs yes +autopart --firstdisk +network --addvmportgroup=true --device=#TABLE:noderes:$NODE:primarynic# --bootproto=dhcp + +#VMware specific +accepteula +#Server Based: +#Standard License Type +#vmlicense --mode=server --server=27000@192.168.0.25 -edition=esxFull +#Starter License Type +#vmlicense --mode=server --server=27000@192.168.0.25 -edition=esxExpress +#File Based: +#Place the content of the lincese file +#in a single line in the %vmlicense_text section +#vmlicense --mode=file + +%pre +#INCLUDE:../scripts/pre.rh# +%post +#INCLUDE:../scripts/post.esx4# diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 0b00548e3..96efc19dc 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -509,20 +509,40 @@ sub mkinstall ); next; } + my $installdir="/install"; #TODO: not hardcode installdir + my $tftpdir = "/tftpboot"; # create the node-specific post scripts #mkpath "/install/postscripts/"; #xCAT::Postage->writescript($node,"/install/postscripts/".$node, "install", $callback); + my $kernpath; + my $initrdpath; + my $maxmem; if ( ( - $arch =~ /x86/ - and -r "/install/$os/$arch/images/pxeboot/vmlinuz" - and -r "/install/$os/$arch/images/pxeboot/initrd.img" - ) - or ( $arch =~ /ppc/ - and -r "/install/$os/$arch/ppc/ppc64/vmlinuz" - and -r "/install/$os/$arch/ppc/ppc64/ramdisk.image.gz") + $arch =~ /x86/ and + ( + -r "$installdir/$os/$arch/images/pxeboot/vmlinuz" + and $kernpath = "$installdir/$os/$arch/images/pxeboot/vmlinuz" + and -r "$installdir/$os/$arch/images/pxeboot/initrd.img" + and $initrdpath = "$installdir/$os/$arch/images/pxeboot/initrd.img" + ) or ( #Handle the case seen in VMWare 4.0 ESX media + #In VMWare 4.0 they dropped the pxe-optimized initrd + #leaving us no recourse but the rather large optical disk + #initrd, but perhaps we can mitigate with gPXE + -d "$installdir/$os/$arch/VMware" + and -r "$installdir/$os/$arch/isolinux/vmlinuz" + and $kernpath ="$installdir/$os/$arch/isolinux/vmlinuz" + and -r "$installdir/$os/$arch/isolinux/initrd.img" + and $initrdpath = "$installdir/$os/$arch/isolinux/initrd.img" + and $maxmem="512M" #Have to give up linux room to make room for vmware hypervisor evidently + ) + ) or ( $arch =~ /ppc/ + and -r "$installdir/$os/$arch/ppc/ppc64/vmlinuz" + and $kernpath = "$installdir/$os/$arch/ppc/ppc64/vmlinuz" + and -r "$installdir/$os/$arch/ppc/ppc64/ramdisk.image.gz" + and $initrdpath = "$installdir/$os/$arch/ppc/ppc64/ramdisk.image.gz") ) { @@ -530,30 +550,8 @@ sub mkinstall unless ($doneimgs{"$os|$arch"}) { mkpath("/tftpboot/xcat/$os/$arch"); - if ($arch =~ /x86/) - { - copy("/install/$os/$arch/images/pxeboot/vmlinuz", - "/tftpboot/xcat/$os/$arch/"); - copy("/install/$os/$arch/images/pxeboot/initrd.img", - "/tftpboot/xcat/$os/$arch/"); - } - elsif ($arch =~ /ppc/) - { - copy("/install/$os/$arch/ppc/ppc64/vmlinuz", - "/tftpboot/xcat/$os/$arch/"); - copy("/install/$os/$arch/ppc/ppc64/ramdisk.image.gz", - "/tftpboot/xcat/$os/$arch/initrd.img"); - } - else - { - $callback->( - { - error => ["Can not handle architecture $arch"], - errorcode => [1] - } - ); - next; - } + copy($kernpath,"$tftpdir/xcat/$os/$arch"); + copy($initrdpath,"$tftpdir/xcat/$os/$arch/initrd.img"); $doneimgs{"$os|$arch"} = 1; } @@ -583,6 +581,9 @@ sub mkinstall . $ent->{nfsserver} . "/install/autoinst/" . $node; + if ($maxmem) { + $kcmdline.=" mem=$maxmem"; + } if ($ent->{installnic}) { $kcmdline .= " ksdevice=" . $ent->{installnic};