From 0cb9c2b7540afad70324d4ee71e08f8849732dd4 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 10 Oct 2011 18:15:12 +0000 Subject: [PATCH] Advance state of esxi5.0 support of DHCPv6 and install to parity with 4.1 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10732 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 16 ++++++++++++++ .../share/xcat/install/esxi/hypervisor.tmpl | 9 +++++++- .../share/xcat/netboot/esxi/39.ipv6fixup | 21 +++++++++++++++++++ .../share/xcat/netboot/esxi/48.esxifixup | 10 +++++++++ .../share/xcat/netboot/esxi/xcat-ipv6.json | 17 +++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 xCAT-server/share/xcat/netboot/esxi/39.ipv6fixup create mode 100644 xCAT-server/share/xcat/netboot/esxi/48.esxifixup create mode 100644 xCAT-server/share/xcat/netboot/esxi/xcat-ipv6.json diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 2dd68d095..652f1a188 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -4088,6 +4088,10 @@ sub copycd { } open($bootcfg,">","$installroot/$distname/$arch/boot.cfg.install"); foreach (@bootcfg) { + if (/^modules=/ and $_ !~ /xcatmod.tgz/) { + chomp(); + s! *\z! --- xcatmod.tgz\n!; + } print $bootcfg $_; } close($bootcfg); @@ -4174,9 +4178,21 @@ sub makecustomizedmod { if ($osver =~ /esxi4/ and -e "$::XCATROOT/share/xcat/netboot/esxi/38.xcat-enableipv6") { mkpath($tempdir."/etc/vmware/init/init.d"); copy( "$::XCATROOT/share/xcat/netboot/esxi/38.xcat-enableipv6",$tempdir."/etc/vmware/init/init.d/38.xcat-enableipv6"); + } elsif ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json") { + mkpath($tempdir."/usr/libexec/jumpstart/plugins/"); + copy( "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json",$tempdir."/usr/libexec/jumpstart/plugins/xcat-ipv6.json"); } if ($osver =~ /esxi4/ and -e "$::XCATROOT/share/xcat/netboot/esxi/47.xcat-networking") { copy( "$::XCATROOT/share/xcat/netboot/esxi/47.xcat-networking",$tempdir."/etc/vmware/init/init.d/47.xcat-networking"); + } elsif ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup") { + mkpath($tempdir."/etc/init.d"); + copy( "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup",$tempdir."/etc/init.d/39.ipv6fixup"); + chmod(0755,"$tempdir/etc/init.d/39.ipv6fixup"); + } + if ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup") { + mkpath($tempdir."/etc/init.d"); + copy( "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup",$tempdir."/etc/init.d/48.esxifixup"); + chmod(0755,"$tempdir/etc/init.d/48.esxifixup"); } if (-e "$::XCATROOT/share/xcat/netboot/esxi/xcatsplash") { mkpath($tempdir."/etc/vmware/"); diff --git a/xCAT-server/share/xcat/install/esxi/hypervisor.tmpl b/xCAT-server/share/xcat/install/esxi/hypervisor.tmpl index af907fda0..27b68606d 100644 --- a/xCAT-server/share/xcat/install/esxi/hypervisor.tmpl +++ b/xCAT-server/share/xcat/install/esxi/hypervisor.tmpl @@ -41,4 +41,11 @@ echo -e "\nnextdestiny\n" | /bin/o %firstboot --interpreter=busybox # enable SSH on next boot.... - +chkconfig SSH on +chkconfig ESXShell on +esxcli system settings advanced set --int-value 0 --option /VMFS3/EnableBlockDelete +esxcli network ip set -e y +esxcli network firewall ruleset set -r DHCPv6 -e y +esxcli network firewall ruleset set -r sshServer -e y +esxcli network ip interface ipv6 set -i vmk0 -d y +#reboot diff --git a/xCAT-server/share/xcat/netboot/esxi/39.ipv6fixup b/xCAT-server/share/xcat/netboot/esxi/39.ipv6fixup new file mode 100644 index 000000000..fd2fc5b5f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/esxi/39.ipv6fixup @@ -0,0 +1,21 @@ +#!/bin/sh +retval=${SUCCESS} +if [ `uname -r` == '5.0.0' ]; then + #duid=default-duid "\000\001\000\001LnC\304\000\020\030^\340\334"; + duid='default-duid "\000\004'; + + for i in `vsish -e get /hardware/machineUUID|grep \\\[|sed -e 's/.*://'|sed -e ':a;N;$!ba;s/\n//g'`; do + num=`printf "%d" $i` + tnum=`printf "\\%03o" $i` + if [ $num -lt 127 -a $num -gt 31 ]; then + tnum=`printf $tnum` + fi + duid=$duid$tnum + done + duid=$duid'";' + echo $duid > /etc/dhclient6-vmk0.leases + localcli network firewall ruleset set -r DHCPv6 -e y + localcli network ip interface ipv6 set -i vmk0 -d y +fi +return $retval + diff --git a/xCAT-server/share/xcat/netboot/esxi/48.esxifixup b/xCAT-server/share/xcat/netboot/esxi/48.esxifixup new file mode 100644 index 000000000..df4500688 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/esxi/48.esxifixup @@ -0,0 +1,10 @@ +#!/bin/sh +#first off, let's ditch UNMAP, per vwmare's recall... +localcli system settings advanced set --int-value 0 --option /VMFS3/EnableBlockDelete +#ok, now let's turn on some SSH and ESXShell fun +localcli network firewall ruleset set -r sshServer -e y +chkconfig ESXShell on +chkconfig SSH on +/etc/init.d/SSH start +/etc/init.d/ESXShell start +return ${SUCCESS} diff --git a/xCAT-server/share/xcat/netboot/esxi/xcat-ipv6.json b/xCAT-server/share/xcat/netboot/esxi/xcat-ipv6.json new file mode 100644 index 000000000..256b257b5 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/esxi/xcat-ipv6.json @@ -0,0 +1,17 @@ +{ + "operations" : + { + "start" : + [ + "network ip set -e y", + ] + } + , + "metadata" : + { + "version" : 1, + "requires" : ["random", "system uuid"], + "provides" : ["vmw-forced-legacy-34"] + } +} +