diff --git a/confluent_osdeploy/esxi7/initramfs/bin/dcuiweasel b/confluent_osdeploy/esxi7/initramfs/bin/dcuiweasel index 7c08b001..e0da8100 100644 --- a/confluent_osdeploy/esxi7/initramfs/bin/dcuiweasel +++ b/confluent_osdeploy/esxi7/initramfs/bin/dcuiweasel @@ -8,7 +8,9 @@ mkdir -p /etc/confluent localcli network firewall unload touch /etc/confluent/confluent.info while ! grep NODENAME /etc/confluent/confluent.info; do + echo "Searching for deployment service on local network..." /opt/confluent/bin/copernicus > /etc/confluent/confluent.info + esxcfg-nics -l done node=$(grep NODENAME: /etc/confluent/confluent.info|head -n 1|awk '{print $2}') mgr=$(grep MANAGER: /etc/confluent/confluent.info|head -n 1|awk '{print $2}') diff --git a/confluent_osdeploy/esxi7/profiles/hypervisor/kickstart b/confluent_osdeploy/esxi7/profiles/hypervisor/kickstart index eeba686c..99c2934b 100644 --- a/confluent_osdeploy/esxi7/profiles/hypervisor/kickstart +++ b/confluent_osdeploy/esxi7/profiles/hypervisor/kickstart @@ -4,7 +4,7 @@ install --firstdisk --overwritevmfs %include /tmp/ksnet %include /tmp/rootpw reboot -%post +%post --interpreter=busybox localcli network firewall unload STATUP=$(mktemp) echo '{"status": "complete"}' > $STATUP diff --git a/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet b/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet index 531db356..cf27ff78 100644 --- a/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet +++ b/confluent_osdeploy/esxi7/profiles/hypervisor/scripts/makeksnet @@ -1,5 +1,8 @@ #!/usr/bin/python +import re +import subprocess +uplinkmatch = re.compile('^\s*Uplinks:\s*(.*)') nodename = None for inf in open('/etc/confluent/confluent.info', 'r').read().split('\n'): if inf.startswith('NODENAME: '): @@ -24,8 +27,15 @@ for line in deploycfg: else: nslist=False cfg['nameservers'] = ','.join(nameservers) - +vswinfo = subprocess.check_output(['localcli', 'network', 'vswitch', 'standard', 'list']).decode('utf8') +vmnic = None +for info in vswinfo.split('\n'): + upinfo = uplinkmatch.match(info) + if upinfo: + vmnic = upinfo.group(1) netline = 'network --hostname={0} --bootproto={1}'.format(nodename, cfg['ipv4_method']) +if vmnic: + netline += ' --device={0}'.format(vmnic) if cfg['ipv4_method'] == 'static': netline += ' --ip={0} --netmask={1}'.format(cfg['ipv4_address'], cfg['ipv4_netmask']) if cfg.get('ipv4_gateway', 'null') not in (None, '', 'null'):