Quantcast
Channel: VMware Communities : All Content - VMware ESXi 5
Viewing all articles
Browse latest Browse all 18761

Kickstart help needed

$
0
0

Hi, I need some help with this kickstart. I am still learning and I am not expert in it. This script I am using to deploy ESXi 5.1 via EDA and few of the settings work fine. But, I am having a hard time getting all the scripts up and running. Like remote ssh and remote TSM is not enabled after the installaion. IPv6 is still running even though the cmd is given to disable it.

 

I am not sure, where the logs are kept post installation and how to get the fix the issues.

 

Any pointers/suggestion will be very helpful

 

 

 

 

##################################################
#Adding vSwitches
####################################################

 

echo ------Adding Virtual Switches------

 

esxcfg-vswitch --add vSwitch1
esxcfg-vswitch --add vSwitch2
sleep 10

 

####################################################
# Adding PortGroups to vSwitches
####################################################

 

echo ------Adding Port Groups------

 

esxcfg-vswitch --add-pg=10.1.76.x vSwitch2
esxcfg-vswitch --add-pg=10.2.75.x vSwitch2
esxcfg-vswitch --add-pg=10.1.80.x vSwitch2
sleep 10

 


####################################################
# Adding vLAN ID to PortGroups
####################################################

 

echo ------Adding VLAN to Portgroups------

 

esxcfg-vswitch --vlan=76 --pg=10.1.76.x vSwitch2
esxcfg-vswitch --vlan=75 --pg=10.2.75.x vSwitch2
esxcfg-vswitch --vlan=74 --pg=10.1.80.x vSwitch2

 

sleep 20
service mgmt-vmware restart
sleep 30

 

####################################################
# Change the vSwitch portnumber to 248
####################################################

 

echo ------Changing Port Numbers for Virtual Switches------

 

/usr/bin/vmware-vim-cmd  hostsvc/net/vswitch_setnumports vSwitch0 256
service mgmt-vmware restart
sleep 30
/usr/bin/vmware-vim-cmd  hostsvc/net/vswitch_setnumports vSwitch1 256
/usr/bin/vmware-vim-cmd  hostsvc/net/vswitch_setnumports vSwitch2 256

 

####################################################
# Adding Nic Cards to vSwitches
####################################################

 

echo ------Adding Uplinks to vSwitches------

 

esxcfg-vswitch -L vmnic2 vSwitch0
esxcfg-vswitch -L vmnic1 vSwitch1
esxcfg-vswitch -L vmnic6 vSwitch1
esxcfg-vswitch -L vmnic3 vSwitch2
esxcfg-vswitch -L vmnic4 vSwitch2
esxcfg-vswitch -L vmnic5 vSwitch2
esxcfg-vswitch -L vmnic7 vSwitch2

 

sleep 20
service mgmt-vmware restart
sleep 30

 


####################################################
# Adding Vmkernel Portgroup information
####################################################

 

echo ------Adding VMkernel information------

 

esxcfg-vswitch -A VMotion vSwitch1

 

# Dont edit the next line! check ks link in table of ESX hosts for output
esxcfg-vmknic -a VMotion -i ###HOSTIP### -n 255.255.255.0
service mgmt-vmware restart
sleep 5
while [ \$(vimsh -n -e "hostsvc/net/vswitch_info vSwitch1" 2>&1 | grep "Failed to connect: 514" | wc -l) -gt 0 ]; do
  sleep 5
  echo Waiting for hostd to accept connections..
done

 

 

 

##################################################
# Enable vMotion and Default Gateway for VMkernel
##################################################

 

echo ------Updating VMkernel information------
service mgmt-vmware restart
sleep 30
vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0
sleep 5
service mgmt-vmware restart
sleep 30

 

esxcfg-route 10.20.72.1

 


####################################################
# VMkernel Configuration
####################################################

 

echo ------Adding Active and Standby nics to VMkernel------

 

# Active and Standby Nic - chck this
#vmware-vim-cmd hostsvc/net/vswitch_setpolicy --nicorderpolicy-active #vmnic1 --nicorderpolicy-standby vmnic6 vSwitch1
#sleep 10

 

####################################################
# Allowing SSH login via Root
####################################################

 

#echo ------Making root login to ESX Server------

 

#perl -pi -e "s/PermitRootLogin no/PermitRootLogin yes/" #/etc/ssh##########/sshd_config
#service sshd restart

 

####################################################
# Adding DNS Server Configuration to ESX Server
####################################################
echo ----Adding SDC DNS Server Details

 

echo nameserver 172.2.1.2 >> /etc/resolv.conf

 


####################################################
# Adding NTP Server information
####################################################

 

echo ------Adding NTP settings to ESX Server------

 

esxcfg-firewall -e ntpClient
echo restrict default kod nomodify notrap noquery nopeer > /etc/ntp.conf
echo restrict 127.0.0.1 >> /etc/ntp.conf
echo server ntp1.test.com >> /etc/ntp.conf
echo server ntp2.test.com >> /etc/ntp.conf
echo server ntp3.test.com >> /etc/ntp.conf
echo server ntp4.test.com >> /etc/ntp.conf
echo driftfile /var/lib/ntp/drift >> /etc/ntp.conf
chkconfig --level 345 ntpd on
service ntpd start
sleep 10
service ntpd restart
sleep 10

 

####################################################
# Adding SSH Banner
####################################################

 

echo ------Adding SSH Banner to ESX Server------

 

echo  >> /etc/ssh_banner
echo >> /etc/ssh_banner 'This....'
echo  >> /etc/ssh_banner
echo Banner /etc/ssh_banner >> /etc/ssh/sshd_config

 

sleep 30

 

####################################################
# Change Local Datastore Name
####################################################

 

echo ------Renaming the local Datastore------

 

vim-cmd hostsvc/datastore/rename Storage1 "$(hostname -s)-local-storage"
sleep 30
service mgmt-vmware restart
sleep 50

 

####################################################
# Disable IPV6
# Got this from this link - http://www.virtuallyghetto.com/2012/09
# /disabling-ipv6-via-command-line-for.html
####################################################

 

esxcli system module parameters set -m tcpip3 -p ipv6=0

 

####################################################
# Enter maintenance mode
####################################################
esxcli system maintenanceMode set -e true

 


####################################################
# enable VHV (Virtual Hardware Virtualization to run nested 64bit #Guests + Hyper-V VM)
####################################################

 

grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config

####################################################
# enable & start remote ESXi Shell  (SSH)
####################################################
vim-cmd hostsvc/enable_ssh
sleep 5
vim-cmd hostsvc/start_ssh

 

####################################################
# enable & start ESXi Shell (TSM)
####################################################

 

vim-cmd hostsvc/enable_esx_shell
sleep 5
vim-cmd hostsvc/start_esx_shell

 

 

 

-----------------------------------
cat > /etc/ntp.conf << __NTP_CONFIG__
restrict default kod nomodify notrap noquerynopeer
restrict 127.0.0.1
driftfile /etc/ntp.drift
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
__NTP_CONFIG__
/sbin/chkconfig ntpd on
/etc/init.d/ntpd start

 

# enable remote shell
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh

 

# add extra switch
esxcli network vswitch standard add --ports 256 --vswitch-name vSwitch1
esxcli network vswitch standard portgroup add --portgroup-name VMs --vswitch-name vSwitch1

 

# enable management traffic
/etc/init.d/hostd stop
while [ $( ps -v | grep hostd-worker ) ]; do sleep 1; done
cd /etc/vmware/hostd/
sed -i "1a<mangementVnics><nic id=\"0000\">vmk0</nic></mangementVnics>" hostsvc.xml
chmod 1644 hostsvc.xml
/etc/init.d/hostd start

 

vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1


Viewing all articles
Browse latest Browse all 18761

Trending Articles



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