VMware Cloud Community
A_Knight
Contributor
Contributor

Scripted Install Fails In Interactive Mode

I have a scripted installation file which works fine and installs everything including all post network config etc however as soon as I enable interactive mode so that users can change the ip address etc to build different hosts the install falls over with a few anaconda errors ending in the following line:

AttributeError: 'dict' object has no attribute 'order'

The config file is as follows: (for some reason this forum is interpretting hashes in my script file is the number 1)

  1. Regional Settings

keyboard uk

lang en_GB

langsupport --default en_GB

timezone --utc Europe/Dublin

  1. Installation settings

interactive

skipx

text

mouse none

firewall --disabled

  1. Unencrypted root password: V1rTUaLIz3

rootpw --iscrypted $1$5a17$LhBegAZBDjCV8e7Z3hAxz0

reboot

install

cdrom

  1. Driver disks

  1. Load drivers

  1. Bootloader options

bootloader --location=mbr --driveorder=sda

  1. Authentication

auth --enableshadow --enablemd5

  1. Partitioning

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

part /boot --fstype ext3 --size 200 --ondisk=sda --asprimary

part swap --size 1600 --ondisk=sda --asprimary

part / --fstype ext3 --size 3072 --ondisk=sda --asprimary

part /home --fstype ext3 --size 512 --ondisk=sda

part /tmp --fstype ext3 --size 2048 --ondisk=sda

part /var --fstype ext3 --size 4096 --ondisk=sda

part /opt --fstype ext3 --size 2048 --ondisk=sda

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

  1. part None --fstype vmfs3 --size 20480 --ondisk=sda

  1. Network Configurations

network --device eth0 --bootproto static --ip 192.168.163.95 --netmask 255.255.255.0 --gateway 192.168.163.1 --nameserver 192.168.163.4 --hostname scripted.vmdomain.com --addvmportgroup=0

  1. VMWare License options

vmaccepteula

vmlicense --mode=server --server=27000@192.168.163.5 --edition=esxfull --features=backup,vsmp

%vmlicense_text

%packages

@base

%post

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

cp /etc/localtime /etc/localtime.old

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

#!/bin/sh

  1. Add extra uplink to vSwitch0

  1. esxcfg-vswitch -L vmnic1 vSwitch0

  1. Create Production Virtual Switch

esxcfg-vswitch -a vSwitch1

esxcfg-vswitch -L vmnic1 vSwitch1

  1. esxcfg-vswitch -L vmnic2 vSwitch1

  1. esxcfg-vswitch -L vmnic4 vSwitch1

  1. Create a Backup Virtual Switch

esxcfg-vswitch -a vSwitch2

esxcfg-vswitch -L vmnic2 vSwitch2

  1. esxcfg-vswitch -L vmnic3 vSwitch2

  1. esxcfg-vswitch -L vmnic5 vSwitch2

  1. Create an Internal Virtual Switch

esxcfg-vswitch -a vSwitch3

  1. Create Port Groups

esxcfg-vswitch -A VMotion vSwitch0

esxcfg-vswitch -A Production vSwitch1

esxcfg-vswitch -A Backup vSwitch2

esxcfg-vswitch -A Internal vSwitch3

  1. Create VMotion Interface

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

service mgmt-vmware restart

sleep 20

  1. Use the vimsh shell to activate the VMotion functionality

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

  1. Open Firewall Ports

esxcfg-firewall -e ntpClient

esxcfg-firewall -e sshClient

  1. Add Extra DNS Servers

  1. echo nameserver 192.168.50.200 >>/etc/resolv.conf

  1. Add NTP Servers

mv /etc/ntp.conf /etc/ntp.conf.bak

echo "restrict 127.0.0.1" >>/etc/ntp.conf

echo "restrict default kod nomodify notrap" >>/etc/ntp.conf

  1. echo "server 192.168.50.30" >>/etc/ntp.conf

echo "driftfile /var/lib/ntp/drift" >>/etc/ntp.conf

  1. Modify Step-Tickers File

  1. mv /etc/ntp/step-tickers /etc/ntp/step-tickers.bak

  1. echo "192.168.50.30" >>/etc/ntp/step-tickers

  1. echo " " >>/etc/ntp/step-tickers

ln -sf /usr/share/zoneinfo/Europe/Dublin /etc/localtime

  1. Allow Root User SSH Access - Disable These Commands If Unsure

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

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

  1. service sshd restart

  1. Add local SSH user

useradd -p ziG3isbGhHixg ssh_user

  1. Increase the Service Console Memory in esx.conf

sed -i -e 's/272/800/' /etc/vmware/esx.conf

  1. Increase the Service Console Memory in grub.conf

sed -i -e 's/272M/800M/' /boot/grub/grub.conf

sed -i -e 's/277504/818176/' /boot/grub/grub.conf

  1. Return rc

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

reboot

EOF1

Does anybody have any idea why this is not working? As soon as I comment out the 'interactive' bit it flies through fine.

Thanks

0 Kudos
2 Replies
kjb007
Immortal
Immortal

Have you checked to make sure that line is in the correct format? Meaning, no ^M at the end of the line?

Run cat -A against the file to see if the correct end of line marker exists.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
A_Knight
Contributor
Contributor

Every time I change the file I pass it through a format conversion program so that it is in linux format and has all the correct formatting so i don't think it is that.

Thanks for the reply though .

0 Kudos