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

Kickstart Post section

$
0
0

Hi

 

I'm hoping someone can help me.

 

i have a problem with the post section of a kickstart script. I just can't get the post section to run.

 

i get an error saying

 

"no such file or directory cd /tmp

 

 

no such file or directory /tmp/esxcfg.sh

 

 

mv: cannot stat 'etc/rc.d/rc.local.bak': no such file or directory

 

 

/etcrc3.d/s99local: line11: EOF: command not found"

 

 

if i remove the section of the script this is refereing to as i've seen in other kickstart scripts i don't get any errors but still the post section does not run!

 

 

the file is downloaded form the following website and modified for my environment

 

 

http://www.rtfm-ed.co.uk/downloads/hp.cfg

 

 

i'm running this in a test environment which is ESX within workstation 6

 

 

if anyone can help i would really appreciate it!

 

 

here's my script, by the way i'm using editpad lite as a text editor

  1. Installation Method

cdrom

 

  1. root Password

rootpw --iscrypted  $1$XCsHfLzw$Ej9sXmmdMY1XO/V2pW8Py/

 

  1. Authconfig

auth --enableshadow --enablemd5

 

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

bootloader --location=mbr

 

  1. Timezone

timezone Europe/London

 

  1. X windowing System

skipx

 

  1. Install or Upgrade

install

 

  1. Text Mode

text

 

  1. Network install type

network --bootproto static --ip=ADS_IP_ADDRESS --netmask=ADS_SUBNET_MASK --hostname=ADS_COMPUTER_NAME --gateway 192.168.0.1 --nameserver=ADS_DNS_SERVER --addvmportgroup=0 --vlanid=0

 

  1. Language

lang en_US

 

  1. Langauge Support

langsupport --default en_US

 

  1. Keyboard

keyboard uk

 

  1. Mouse

mouse none

 

  1. Reboot after install ?

reboot

 

  1. Firewall settings

firewall --disabled

 

  1. Clear Partitions

clearpart --all --initlabel --drives=sda

 

  1. Partitioning

  2. Boot

part /boot --fstype ext3 --size 102 --ondisk sda

 

  1. Root - SHOULD BE 5000

part / --fstype ext3 --size 2997 --ondisk sda

 

  1. Swap

part swap --size 544 --ondisk sda

 

#Part Logs SHOLD BE 4096

part /var/log --fstype ext3 --size 2096 --ondisk sda

 

#Part tmp files - SHOULD BE 2048

part /tmp --fstype ext3 --size 1048 --ondisk sda

 

#Local VMFS partition - SHOULD BE 6000

part None --fstype vmfs3 --size 1000 --grow --ondisk sda

 

#VMKcore Partition

part None --fstype vmkcore --size 100 --ondisk sda

 

  1. VMware Specific Commands

vmaccepteula

 

 

#Licensing Info

vmlicense --mode=server --server=27010@192.168.0.20 --edition=esxFull

 

%packages

@base

 

%post

  1. Your postinstall script goes here!

cat > /tmp/esxcfg.sh <<EOF1

#!/bin/sh

  1. Configure ESX Server

 

  1. Create vSwitch1 with a port group of Internal

esxcfg-vswitch -a vSwitch1

esxcfg-vswitch -A Internal vSwitch1

 

  1. Create a vSwitch2 with a port group of Production using vmnic1

esxcfg-vswitch -a vSwitch2

esxcfg-vswitch -A Production vSwitch2

esxcfg-vswitch -L vmnic1 vSwitch2

esxcfg-vswitch -L vmnic2 vSwitch2

 

  1. Create a vSwitch3 with a port group of VMotion using vmnic3

esxcfg-vswitch -a vSwitch3

esxcfg-vswitch -A VMotion vSwitch3

esxcfg-vswitch -L vmnic3 vSwitch3

esxcfg-vmknic -a VMotion -i 10.0.0.3 -n 255.255.255.0

  1. On its own vmknic cannot enable VMotion...

 

  1. BUT this does - By using vimsh together with the portgroup internal ID

  2. A restart of the management service and a sleep is required...

service mgmt-vmware restart

sleep 20

vimsh -n -e "/hostsvc/vmotion/vnic_set portgroup4"

 

  1. Create add with a port group for iSCSI/iSCSI-CIS using vSwitch3

esxcfg-vswitch -a vSwitch3

esxcfg-vswitch -A iSCSI vSwitch3

esxcfg-vmknic -a iSCSI -i 172.168.3.113 -n 255.255.255.0

esxcfg-vswitch -A iSCSI-COS vSwitch3

esxcfg-vswif -a vswif1 -p iSCSI-COS -i 172.168.3.103 -n 255.255.255.0

 

  1. Set-up iSCSI Software Emulator

  2. esxcfg-swiscsi -e

  3. vmkiscsi-tool -D -a 172.168.3.210 vmhba40

  4. esxcfg-swiscsi -s

  5. esxcfg-rescan vmhba40

 

  1. VLAN Example

  2. esxcfg-vswitch -a vSwitch2

  3. esxcfg-vswitch -A accounts vSwitch2

  4. esxcfg-vswitch -A rnd vSwitch2

  5. esxcfg-vswitch -A sales vSwitch2

  6. esxcfg-vswitch -L vmnic4 vSwitch2

  7. esxcfg-vswitch -L vmnic5 vSwitch2

  8. esxcfg-vswitch -v 10 -p accounts vSwitch2

  9. esxcfg-vswitch -v 20 -p rnd vSwitch2

  10. esxcfg-vswitch -v 30 -p sales vSwitch2

 

  1. Connect to a NAS...

  2. esxcfg-nas -a iso -o nfs1.vi3book.com -s /iso

 

  1. Add 2nd/3rd DNS settings

echo nameserver 192.168.3.131 >> /etc/resolv.conf

echo nameserver 192.168.3.132 >> /etc/resolv.conf

 

  1. Create a local user for SSH Access - Default password is password

  2. useradd -p '$1$Rg69B9QA$JUtqStBrjNFbyzyP9zTsf0' -c "Mike Laverick" lavericm

 

  1. DANGEROUS: Allow ROOT access using SSH

  2. sed -e 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config > /etc/ssh/sshd_config.new

  3. mv -f /etc/ssh/sshd_config.new /etc/ssh/sshd_config

  4. service sshd restart

 

  1. Enable the SSH client (Out/From an ESX hosts)

esxcfg-firewall -e sshClient

EOF1

 

  1. Make esxcfg.sh eXcutable

chmod +x /tmp/esxcfg.sh

 

  1. Backup original rc.local file

cp /etc/rc.d/rc.local /etc/rc.d/rc.local.bak

 

  1. Make esxcfg.sh run from rc.local and make rc.local reset itself

cat >> /etc/rc.d/rc.local <<EOF

cd /tmp

/tmp/esxcfg.sh

mv -f /etc/rc.d/rc.local.bak /etc/rc.d/rc.local

EOF


Viewing all articles
Browse latest Browse all 60069

Trending Articles



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