VMware Cloud Community
tdubb123
Expert
Expert

kickstart script esxi 4.1 not working

I cannot seem to get SSH enabled as well as setting vmkernel as vmotion

vmaccepteula

rootpw --iscrypted $1$vP/2Aaii$p3x/2htjd5BragreMltBZ/

clearpart --alldrives --overwritevmfs

autopart --firstdisk --overwritevmfs

serialnum --esx=150A1-AE046-N8838-0C1UP-0MMNH

install nfs --server=x.x.x.x --dir=/export/esxi/41

network --bootproto=dhcp --device=vmnic0

reboot

%firstboot --unsupported --interpreter=busybox

/sbin/chkconfig --level 345 TSM on

/sbin/chkconfig --level 345 TSM-SSH on

esxcfg-vswitch -D 'VM Network' vSwitch0

esxcfg-vswitch -L vmnic4 vSwitch0

esxcfg-vswitch -A VMkernel vSwitch0

esxcfg-vmknic -a -i DHCP -p "VMkernel"

vim-cmd hostsvc/vmotion/vnic_set vmk1

vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active=vmnic0 --nicorderpolicy-standby=vmnic6 vSwitch4 'Management Network'

vim-cmd hostsvc/net/portgroup_set --nicorderpolicy-active=vmnic4 --nicorderpolicy-standby=vmnic0 vSwitch0 VMkernel

any idea why this is not working?

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

To enable SSH also know as remote TSM (Tech Support Mode)

You need a entry as the following:

vim-cmd hostsvc/enable_remote_tsm
vim-cmd hostsvc/start_remote_tsm

The first commands enables it, but you also need to start it as well.

The other thing, you need to set your firstboot level to something really high, because some of these commands rely on certain VMware components to start up first. I suggest adding --level 9999 so it's the last script that runs.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
tdubb123
Expert
Expert

Thanks! how do I enable the MAnagement Traffic (check box) on vmk0

I tried vim-cmd hostsvc/advopt/update Net.ManagementIface string vmk0

but what string is it asking for?

0 Kudos
lamw
Community Manager
Community Manager

You have the right syntax, though that advanced option will not enable Mgmt Interface from what I recall from testing. You can automate enabling vMotion & FT traffic using vimsh vim-cmd but not the management interface, this might be one of those that needs to be performed using APIs from a remote system.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
cxo
Contributor
Contributor

This works for me to make vmk0 the management nic via kickstart method:

# Update the file /etc/vmware/hostd/hostsvc.xml with the parameters to tick the
# Management Network portgroup Management Traffic box
echo "Stopping the hostd"
/etc/init.d/hostd stop
sleep 5
echo "Enabling 'Management' on vmk0"
sed  -ie 's/<ConfigRoot>/<ConfigRoot>\n <mangementVnics>\n <nic id="0000">vmk0<\/nic>\n <\/mangementVnics>/' /etc/vmware/hostd/hostsvc.xml
echo "Starting the hostd"
/etc/init.d/hostd start

0 Kudos