#enable SSH root access mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old /bin/sed -e "s/PermitRootLogin no/PermitRootLogin yes/g" /etc/ssh/sshd_config.old >> /etc/ssh/sshd_config /etc/init.d/sshd restart #Upsize console memory mv -f /etc/vmware/esx.conf /etc/vmware/esx.conf.old /bin/sed -e 's/boot\/memSize = \"272\"/boot\/memSize = \"800\"/g' /etc/vmware/esx.conf.old >> /etc/vmware/esx.conf mv -f /boot/grub/grub.conf /tmp/grub.conf.bak /bin/sed -e 's/uppermem 277504/uppermem 818176/g' -e 's/mem=272M/mem=800M/g' /tmp/grub.conf.bak >> /boot/grub/grub.conf #DNS and Gateway mv /etc/resolv.conf /etc/resolv.conf.old echo "search virtualpro.local" >> /etc/resolv.conf echo "nameserver 192.168.11.1" >> /etc/resolv.conf echo "GATEWAY=192.168.11.1" >> /etc/sysconfig/network #set uselunreset enabled and devicereset disabled /usr/sbin/esxcfg-advcfg -s 1 /Disk/UseLunReset /usr/sbin/esxcfg-advcfg -s 0 /Disk/UseDeviceReset /etc/init.d/mgmt-vmware restart #Placeholder for set queuedepth for QLogic adapter - May not be required #/usr/sbin/esxcfg-module -s ql2xmaxqdepth=64 qla2300_707 #/usr/sbin/esxcfg-advcfg -s 64 /Disk/SchedNumReqOutstanding # Create Service Console Portgroup and add extra NIC /usr/sbin/esxcfg-vswitch -A "Service Console" vSwitch0 /usr/sbin/esxcfg-vswitch -L vmnic2 vSwitch0 # Create Server vswitch, portgroup and add NICs /usr/sbin/esxcfg-vswitch -a vSwitch1 /usr/sbin/esxcfg-vswitch -A VLAN2 vSwitch1 /usr/sbin/esxcfg-vswitch -L vmnic1 vSwitch1 /usr/sbin/esxcfg-vswitch -L vmnic3 vSwitch1 /usr/sbin/esxcfg-vswitch -L vmnic4 vSwitch1 /usr/sbin/esxcfg-vswitch -L vmnic5 vSwitch1 # Create Internal vSwitch and Portgroup /usr/sbin/esxcfg-vswitch -a vSwitch2 /usr/sbin/esxcfg-vswitch -A Internal vSwitch2 #Refresh NIC settings with vimsh /usr/sbin/vimsh -n -e "hostsvc/net/refresh" /usr/sbin/vimsh -n -e "internalsvc/refresh_network" # Populate the Hosts File rm -rf /etc/hosts echo "# Do not remove the following line, or various programs" >> /etc/hosts echo "# that require network functionality will fail." >> /etc//hosts echo "127.0.0.1 localhost.localdomain localhost" >> /etc//hosts echo "192.168.11.101 ESX01.Virtualpro.local ESX01" >> /etc//hosts echo "192.168.11.102 ESX02.Virtualpro.local ESX02" >> /etc//hosts echo "192.168.11.103 ESX03.Virtualpro.local ESX03" >> /etc//hosts #enable and configure ntp /usr/sbin/esxcfg-firewall -e ntpClient mv /etc/ntp.conf /etc/ntp.conf.old mv /etc/ntp/step-tickers /etc/ntp/step-tickers.old echo "restrict 127.0.0.1" >> /etc/ntp.conf echo "restrict default kod nomodify notrap" >> /etc/ntp.conf echo "server 192.168.11.141" >> /etc/ntp.conf echo "driftfile /var/lib/ntp/drift" >> /etc/ntp.conf echo "server 192.168.11.141" >> /etc/ntp/step-tickers /sbin/chkconfig --level 345 ntpd on /etc/init.d/ntpd restart /usr/sbin/hwclock --systohc /usr/sbin/ntpdate -q 192.168.11.141 /etc/init.d/ntpd restart # Restart Management Services /etc/init.d/mgmt-vmware restart # Copy over HP Management Agents V8.2.0 cd /tmp echo get hpmgmt-8.2.0-vmware3x.tgz | smbclient //192.168.11.100/dl -N # Deploy HP Management Agents V8.2.0 tar xvzf /tmp/hpmgmt-8.2.0-vmware3x.tgz -C /tmp cd /tmp/hpmgmt/820 echo get hpmgmt.conf | smbclient //192.168.11.100/dl -N \sh PreInstall_Setup.sh \sh installvm820.sh --silent --inputfile /tmp/hpmgmt/820/hpmgmt.conf #Copy over snmpd.conf file and restart HP Services cd /etc/snmp mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old echo get snmpd.conf | smbclient //192.168.11.100/dl -N /etc/init.d/hpasm restart /etc/init.d/snmpd restart #Remove HP Management Agent software after install rm -R -f /tmp/hpmgmt* # Install Health Check Script cd /tmp echo get health_check.sh | smbclient //192.168.11.100/dl -N echo get health_check.conf | smbclient //192.168.11.100/dl -N echo get smtp_send.pl | smbclient //192.168.11.100/dl -N mkdir /usr/lib/perl5/5.8.0/MIME cd /usr/lib/perl5/5.8.0/MIME echo get Lite.pm | smbclient //192.168.11.100/dl -N #Run Health Check /usr/sbin/esxcfg-firewall -o 25,tcp,out,smtp_out cd /tmp chmod 744 health_check.sh chmod 744 smtp_send.pl ./health_check.sh # Health Check Clean Up cd /tmp rm -f /tmp/health* rm -f smtp_send.pl rm -R -f /usr/lib/perl5/5.8.0/MIME /usr/sbin/esxcfg-firewall -c 25,tcp,out,smtp_out