| Article Index |
|---|
| VMware vSphere - Scripted Installer for ESX Server |
| The Pre Section |
| The Post Sections |
| The esx-post-script |
| The Actual Config |
| All Pages |
Page 5 of 5
The actual configuration
All the rest is pretty much standard ESX config stuff, and goes into the "MORE CONFIG..." section in the esx-post-script.sh file. The main exception is that we now have access to the ESXID variables.
esxcfg
# During auto-install a vSwitch0 is created, but I wanted a different naming echo "Deleting default vSwitch" esxcfg-vswif --del vswif0 esxcfg-vswitch --del-pg='Service Console' vSwitch0 esxcfg-vswitch --delete vSwitch0 # Create the Service Console network echo "Creating new Service Console switch" esxcfg-vswitch --add VMwareSwitch esxcfg-vswitch --link=vmnic1 VMwareSwitch esxcfg-vswitch --link=vmnic3 VMwareSwitch esxcfg-vswitch --add-pg='Service Console' VMwareSwitch esxcfg-vswitch --add-pg="Service Console Management" VMwareSwitch esxcfg-vswif --add vswif0 --portgroup 'Service Console' --ip $ESXSCIP --netmask 255.255.0.0 # Create the Storage network echo "Creating Storage vSwitch and port-groups" esxcfg-vswitch --add StorageSwitch esxcfg-vswitch --link=vmnic0 StorageSwitch esxcfg-vswitch --link=vmnic2 StorageSwitch esxcfg-vswitch --add-pg="Storage Management" StorageSwitch esxcfg-vswitch --add-pg="Storage" StorageSwitch # Create the Storage VM Kernel Port, and enable Jumbo frames on it esxcfg-vmknic -a -i $ESXSTORAGEIP -n 255.255.0.0 -m 9000 Storage esxcfg-vswitch -m 9000 StorageSwitch # Create the Production network echo "Creating Production vSwitch and port-groups" esxcfg-vswitch --add ProductionSwitch esxcfg-vswitch --link=vmnic4 ProductionSwitch esxcfg-vswitch --link=vmnic5 ProductionSwitch esxcfg-vswitch --link=vmnic6 ProductionSwitch esxcfg-vswitch --link=vmnic7 ProductionSwitch esxcfg-vswitch --add-pg="Production" ProductionSwitch esxcfg-vswitch --add-pg="DMZ" ProductionSwitch esxcfg-vswitch --add-pg="Testing" ProductionSwitch esxcfg-vswitch --vlan=40 --pg=DMZ ProductionSwitch esxcfg-vswitch --vlan=50 --pg=Production ProductionSwitch esxcfg-vswitch --vlan=60 --pg=Testing ProductionSwitch # Enable the Software iSCSI adapter # The adapter name given to the iSCSI HBA was changing sometimes, so I've # determined it from the esxcfg-swiscsi command's "scan" subcommand now. # (note that the inlined functions need to be escaped) echo "Adding iSCSI interfaces" esxcfg-swiscsi -e >> /tmp/post.log HBANAME=\`esxcfg-swiscsi -s | awk '{print \$2}' | sed 's/\.\.\.\$//'\` vmkiscsi-tool -D -a 10.10.10.10 \$HBANAME >> /tmp/post.log esxcfg-rescan \$HBANAME >> /tmp/post.log # Activate changes to reflect them into Virtual Center echo "Restarting the Management interface" service mgmt-vmware restart #Configure Firewall and startup services echo "Configuring firewall" chkconfig snmpd on esxcfg-firewall -e ntpClient esxcfg-firewall -e snmpd esxcfg-firewall -e sshClient esxcfg-firewall -e CIMSLP esxcfg-firewall -e VCB esxcfg-firewall -e swISCSIClient esxcfg-firewall -e CIMHttpsServer esxcfg-firewall -e vpxHeartbeats esxcfg-firewall -e sshServer esxcfg-firewall -e updateManager #Configure hosts files to prevent DNS failure echo "Configuring hosts file" echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts echo "10.20.30.1 esx-01.mydomain.vm.local esx-01" >> /etc/hosts echo "10.20.30.2 esx-02.mydomain.vm.local esx-02" >> /etc/hosts echo "10.20.30.3 esx-03.mydomain.vm.local esx-03" >> /etc/hosts echo "10.20.30.4 esx-04.mydomain.vm.local esx-04" >> /etc/hosts echo "10.20.10.1 vc-01.mydomain.com vc-01" >> /etc/hosts
The full scripts can be downloaded here.
Last Updated on Wednesday, 05 August 2009 12:53


