Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
More information from customer tests
-----------------------
the default gateway is not set up because of the lack of the "PRIMARY" parameter:
/usr/lib/python3.6/site-packages/cloudinit/sources/helpers/vmware/imc/nic.py --> check if nic is PRIMARY (line 37)
/usr/lib/python3.6/site-packages/cloudinit/sources/helpers/vmware/imc/config_nic.py --> add default gw only if nic is promary (line 160)
to test it I simply added "PRIMARY = true" to the NIC session:
<...>
[ens224]
PRIMARY = true <---------------------------
MACADDR = 00:50:56:a2:61:41
<...>
and running the net_convert.py utility with the modified cust.cfg it creates the correct file with the gateway:
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=none
DEFROUTE=yes
DEVICE=ens224
GATEWAY=192.168.160.1 <--------------
HWADDR=00:50:56:a2:47:c1
IPADDR=192.168.160.242
NETMASK=255.255.252.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
only a test - it does not work for multi-nic setup
diff -Naur /usr/lib/python3.6/site-packages/cloudinit/sources/helpers/vmware/imc/config_nic.py.orig /usr/lib/python3.6/site-packages/cloudinit/sources/helpers/vmware/imc/config_nic.py
@@ -158,7 +158,7 @@
subnet.update({'netmask': v4.netmask})
# Add the primary gateway
- if nic.primary and v4.gateways:
+ if v4.gateways:
self.ipv4PrimaryGateway = v4.gateways[0]
subnet.update({'gateway': self.ipv4PrimaryGateway})
return ([subnet], route_list)
Now, with this change, I can provision a RHEL8 vm from a vmware template with all parameters correctly set up (gw included).
--------------------------------------
Adding more info from the latest customer test
----------------------
I confirm that the issue is related to the lack of compatibility between cloud-init 18.2 and vshere 6.5 "OS Guest customization" format (because of the lack of PRIOMARY parameter) .
You can't use "OS Guest customization" (triggered by vmware tools) *and* cloud-init at the same time to post-configure a system.
Removing cloud-init from my templates (I tried with both RHEL 7 and 8) I can successfully deploy VMs with a correct network setup (gateway included).
--------------------------
Thank you
(In reply to Jaroslav Spanko from comment #4)
> Adding more info from the latest customer test
> ----------------------
> I confirm that the issue is related to the lack of compatibility between
> cloud-init 18.2 and vshere 6.5 "OS Guest customization" format (because of
> the lack of PRIOMARY parameter) .
> You can't use "OS Guest customization" (triggered by vmware tools) *and*
> cloud-init at the same time to post-configure a system.
>
> Removing cloud-init from my templates (I tried with both RHEL 7 and 8) I can
> successfully deploy VMs with a correct network setup (gateway included).
> --------------------------
>
> Thank you
Yes, this is due to lack of PRIMARY NIC parameter in the current vSphere6.5 Guest OS Customization specification.
Without a primary NIC, static route but default gateway will be set.
config_nic.py
# Add routes if there is no primary nic
if not self._primaryNic and v4.gateways:
subnet.update(
{'routes': self.gen_ipv4_route(nic, v4.gateways, v4.netmask)})
A fix is available on the next vSphere vCenter Server 6.5 update release and vSphere vCenter Server 6.7 Update 2 release. There will be PRIMARY NIC set when the NIC is the first NIC and also has a static IPv4 and a gateway configured. Details at "You cannot set a primary virtual NIC" in https://docs.vmware.com/en/VMware-vSphere/6.7/rn/vsphere-vcenter-server-67u2-release-notes.html
Thanks,
Pengpeng