Quantcast
Channel: VMware Communities : Popular Discussions - VI: VMware ESX® 3.0
Viewing all articles
Browse latest Browse all 60069

New to install script - can't get %post working

$
0
0

 

I'm having one hell of a time getting my post scritp working and I'm a little unsure what to do now. here is my script

 

 

  1. Auto-Generated Scripted Install Configuration file.

  2. This file is used for VMware ESX Server Scripted Install Deployment

 

 

 

  1. Installation Method

cdrom

 

 

  1. root Password

rootpw --

 

 

  1. Authconfig

auth --enableshadow --enablemd5

 

 

  1. BootLoader ( The user has to use grub by default )

bootloader --location=mbr

 

 

  1. Timezone

timezone US/Eastern

 

 

  1. X windowing System

skipx

 

 

  1. Install or Upgrade

install

 

 

  1. Text Mode

text

 

 

  1. Network install type

network --bootproto static --ip 192.168.2.57 --netmask 255.255.248.0 --gateway 192.168.1.249 --nameserver 192.168.1.249 --hostname peter.pan.com --addvmportgroup=0 --vlanid=0

 

 

  1. Language

lang en_US

 

 

  1. Langauge Support

langsupport --default en_US

 

 

  1. Keyboard

keyboard us

 

 

  1. Mouse

mouse none

 

 

  1. Reboot after install ?

reboot

 

 

  1. Firewall settings

firewall --disabled

 

 

  1. Clear Partitions

clearpart --all --initlabel --drives=cciss/c0d0

 

 

  1. Partitioning

part /boot --fstype ext3 --size 300 --ondisk cciss/c0d0

part / --fstype ext3 --size 4069 --ondisk cciss/c0d0

part swap --size 1638 --ondisk cciss/c0d0

part None --fstype vmfs3 --size 10000 --grow --ondisk cciss/c0d0

part None --fstype vmkcore --size 110 --ondisk cciss/c0d0

part /var/log --fstype ext3 --size 1992 --ondisk cciss/c0d0

part /home --fstype ext3 --size 2096 --ondisk cciss/c0d0

part /admin --fstype ext3 --size 4096 --ondisk cciss/c0d0

part /vmimages --fstype ext3 --size 15360 --ondisk cciss/c0d0

 

 

 

  1. VMware Specific Commands

vmaccepteula

vmlicense --mode=server --server=27000@192.168.1.249 --edition=esxFull

 

 

%packages

@base

%vmlicense_text

 

 

%post

 

 

cat << \EOF > /etc/rc3.d/S99postconfig.sh

#!/bin/sh

 

 

  1. Change the amount of RAM allocated to the Service Console

cp /etc/vmware/esx.conf /etc/vmware/esx.conf.ORIG

perl -spi -e 's|/boot/memSize = \"272\"|/boot/memSize = \"800\"|' /etc/vmware/esx.conf

cp /etc/grub.conf /etc/grub.conf.ORIG

esxcfg-boot -g

esxcfg-boot -b

 

 

  1. Unlink the default Virtual Switches created during install

  2. since it was created with < 64 virtual ports:

/usr/sbin/esxcfg-vswitch -U vmnic0 vSwitch0

/usr/sbin/esxcfg-vswif -d vswif0

/usr/sbin/esxcfg-vswitch -d vSwitch0

 

 

  1. Create the vSwitch0 vSwitch and the Service Console port group

/usr/sbin/esxcfg-vswitch -a vSwitch0:64

/usr/sbin/esxcfg-vswitch -A 'Service Console' vSwitch0

/usr/sbin/esxcfg-vswitch -M vmnic0 vSwitch0 -p "Service Console"

/usr/sbin/esxcfg-vswitch -L vmnic0 vSwitch0

 

 

  1. Create the vSwitch1 vSwitch and the VMotion port group

/usr/sbin/esxcfg-vswitch -a vSwitch1:64

/usr/sbin/esxcfg-vswitch -A "VMotion" vSwitch1

/usr/sbin/esxcfg-vswitch -M vmnic1 vSwitch1 -p "VMotion"

/usr/sbin/esxcfg-vswitch -L vmnic1 vSwitch1

 

 

  1. Create the vSwitch2 vSwitch for VM traffic

/usr/sbin/esxcfg-vswitch -a vSwitch2:64

/usr/sbin/esxcfg-vswitch -A "Virtural Maching Network" vSwitch2

/usr/sbin/esxcfg-vswitch -M vmnic2 vSwitch2 -p "Virtural Maching Network"

/usr/sbin/esxcfg-vswitch -M vmnic3 vSwitch2 -p "Virtural Maching Network"

/usr/sbin/esxcfg-vswitch -L vmnic2 vSwitch2

/usr/sbin/esxcfg-vswitch -L vmnic3 vSwitch2

 

 

  1. Assign IP addresses to the Service Console interface and save it permanently:

/usr/sbin/esxcfg-vswif -a -i 192.168.2.57 -n 255.255.248.0 -p 'Service Console' vswif0

  1. /sbin/route add default gw ESX_GATEWAY

 

 

  1. Assign an IP addresses to the VMotion interface and add a VMkernel default route:

/usr/sbin/esxcfg-vmknic -a -i 192.168.0.132 -n 255.255.248.0 VMotion

  1. /usr/sbin/esxcfg-route -a default VMOTION_GATEWAY

 

 

  1. Enable VMotion on the VMKernel Interface ( this only works on ESX 3.5 )

  2. vimsh -n -e "/hostsvc/vmotion/vnic_set vmk0" #not working#

 

 

 

  1. Reset system to normal boot mode

echo "Seting System to normal boot up mode"

rm /etc/rc3.d/S99postconfig.sh

 

 

EOF

 

 

 

So I take this file and add it to a floppy called ks.cfg - boot off of the CD and point the install to esx ks=floppy and let it rip. Everything runs fine and when I get back to the server everything is installed. However from some reason nothing in the %post script runs. Non of my vswitch configs work.

 

 

When I nav to /etc/rc3.d/S99postconfig.sh I can see all of the commands but nothing has run. I'm new to Linux and scripting so I'm sorry if this is a stupid question.

 

 

 

 

 

Thank you for your help 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 60069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>