VMware Cloud Community
Bhanta
Contributor
Contributor

Configure vMotion in ks.cfg by prompting for IP address

Hi all,

I am having some difficultly configuring vmotion in my ks.cfg file and was hoping somebody could offer some advice. The rest of my script works fine now and the build completes ok but when i login afterwoods and check if vmotion is configured nothing shows.

What i am trying to do is when the script first runs and the ks.cfg is kicked off...i am prompting the user for the fqdn of the esx host, service console ip and also vmotion ip. Then the builds continues....i would like the vmotion ip address entered by the user when the build first starts to be assigned once the build completes.

Here is a little snippet of my ks.cfg file

%pre --interpreter=bash

while ;do

header

echo -n "Please Enter vMotion IP Address: "

read vmotionipnew

done

cat <<EOF> /tmp/vmotionnetworkconfig

$vmotionipnew

EOF

%post --interpreter=bash

/usr/sbin/esxcfg-vswitch -a vSwitch_vmotionVLAN

/usr/sbin/esxcfg-vswitch -A VMotionVLAN vSwitch_vmotionVLAN

/usr/sbin/esxcfg-vswitch -L vmnic6 vSwitch_vmotionVLAN

/usr/sbin/esxcfg-vmknic --add --ip=$vmotionipnew --netmask=255.255.255.0 VMotionVLAN

service mgmt-vmware restart

sleep 60

  1. Enable VMotion on the VMKernel Interface

/usr/bin/vmware-vim-cmd hostsvc/vmotion/vnic_set vmk0

/usr/bin/vmware-vim-cmd hostsvc/net/refresh

0 Kudos
0 Replies