2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-16 10:39:23 +00:00

Add vlanid to the vmware deployment support

This commit is contained in:
Jarrod Johnson 2022-10-12 13:08:57 -04:00
parent 145be7ce31
commit 23ec46bb8b
2 changed files with 19 additions and 0 deletions

View File

@ -8,6 +8,17 @@ if [ ! -f /var/run/vmware/show-esx-shell-login ]; then
fi
uuid=$(vsish -e get /hardware/bios/dmiInfo|grep -A15 UUID|sed -e 's/.*://'|sed -e ':a;N;$!ba;s/\n//g' | sed -e 's/ *0x//g')
uuid=${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}
kargs=$(vsish -e get /system/bootCmdLine|grep "command line:")
vlanid=""
for karg in $kargs; do
if [ ${karg%=*} = "vlanid" ]; then
vlanid=${karg/*=}
fi
done
if [ ! -z "$vlanid" ]; then
echo $vlanid > /tmp/confluent.vlanid
localcli network vswitch standard portgroup set -p "Management Network" -v $vlanid
fi
mkdir -p /sys/devices/virtual/dmi/id/
echo $uuid > /sys/devices/virtual/dmi/id/product_uuid
mkdir -p /etc/confluent

View File

@ -52,4 +52,12 @@ if cfg['ipv4_method'] == 'static':
netline += ' --gateway={0}'.format(cfg['ipv4_gateway'])
if cfg['nameservers']:
netline += ' --nameserver={0}'.format(cfg['nameservers'])
vlanid = None
try:
with open('/tmp/confluent.vlanid', 'r') as vlanin:
vlanid = vlanin.read()
except Exception:
pass
if vlanid:
netline += ' --vlanid={0}'.format(vlanid)
print(netline)