VMware vSphere

 View Only
  • 1.  OSCustomizationSpec and RHEL9 with NetworkManager

    Posted Sep 24, 2024 01:12 PM

    Hello,

    For many time I've used Powercli and OSCustomizationSpec to assign Network settings to VM Os.

    But with the Release of RHEL9 the classical /etc/sysconfig/network-scripts/ifcfg-files  will be no longer supported

    If I deploy a template with RH9 using OSCustomization Scripts, I'll have a duplicated network configuration for the ifcfg-ens192

    one ifcfg-ens192 file is created at /etc/sysconfig/network-scripts and another under /etc/NetworkManager/system-connections. And both were active when I type nmcli con show

    I've tested configuring NetworkManager.conf assigning this parameter to plugin entry, I've removed ifcfg-rh
    [main]
    plugins = keyfile

    With this configuration I only have active the NetworkManager configuration, but there is still a file created under 'network-scripts', the file is still created by the OsCustomization Script (the file contains this note).

    My question is, how should I deploy a RHEL9 that should use NetworkManager? and avoid the automatic creation of network-script files?
    should I change My deployment method? If Yes? how should assign Network settings to the deployed virtual machine?

    can I still continue using OsCustomization with RHEL9? 

    My current powercli version is VMware.PowerCLI 13.0.0 build 20829139

    Thanks in advance

    Regards



  • 2.  RE: OSCustomizationSpec and RHEL9 with NetworkManager

    Broadcom Employee
    Posted Oct 08, 2024 12:30 PM

    Hi alpatio,

    Yes, you can still continue using OsCustomization with RHEL9. And Yes, OsCustomization writes network configuration to /etc/NetworkManager/system-connections/VMware-customization-{NAME}.connection and /etc/sysconfig/network-scripts/ifcfg-{NAME}. {NAME} is the connection name. Please check KB article: https://knowledge.broadcom.com/external/article/311956. The reason is NetworkManager default plugin is keyfile since RHEL9 and RHEL9-like Linux, while ifcfg-rh plugin is still supported although RedHat is deprecating it. 

    I see you removed ifcfg-rh plugin from NetworkManager.conf, then only keyfile will be activated. The network configuration in /etc/NetworkManager/system-connections/VMware-customization-{NAME}.connection will be active, you can check this by "nmcli c s --active".

    Thanks,
    Pengpeng




  • 3.  RE: OSCustomizationSpec and RHEL9 with NetworkManager

    Broadcom Employee
    Posted Oct 08, 2024 12:30 PM

    Hi alpatio,

    Yes,  you can still continue using OsCustomization with RHEL9, no change needed for your deployment method.

    And Yes, OsCustomization writes network configuration to both /etc/NetworkManager/system-connections/VMware-customization-{NAME}.connection and /etc/sysconfig/network-scripts/ifcfg-{NAME}. {NAME} is the connection name. Please check KB article: https://knowledge.broadcom.com/external/article/311956. The reason is NetworkManager default plugin is keyfile since RHEL9 and RHEL9-like Linux, while ifcfg-rh plugin is still supported although RedHat is deprecating it.

    I see you removed ifcfg-rh plugin from NetworkManager.conf, then only keyfile will be loaded and activated, you can check this by "nmcli c s --active". 

    Please feel free to let me know if you have any other concerns.

    Best regards,

    Pengpeng




  • 4.  RE: OSCustomizationSpec and RHEL9 with NetworkManager

    Posted Oct 08, 2024 06:20 PM

    Hi,

    Thanks for suggestion. But this alternative of network priority doesn't work in my case.

    I've done a setup of RH9 from and ISO, this means that is a new and clean VM, and then I've tried to use the powercli script over it. But none works as expected.

    What I expect is that new VM will be configure with their static IP Address, using the NetworkManager format, because according this article are deprecated Chapter 7. Deprecated functionality | Red Hat Product Documentation 

    Once this VM has been created I've tested several options (in all cases I've added the autoconnect-priority=-999 setting

    tested with a commented Networkmanager option

    # plugins = keyfile, ifcfg-rh

    Then Network settings are set, but the active connection is the ifcfg-ens192 (network Scripts)

    If I test with 

    plugins=keyfile,ifcfg-rh 

    It has the same effect than previous configuration

    When I test with Only

    plugins=keyfile

    Then original IP is not replaced by the new one on the new deployed VM

    My only alternatives seems that are to run a post-deploy script that will run a 'nmcli connection migrate' that will convert ifcfg-configuration files to keyfile format. Or deploy it using cloud-init options (i've already did, but I guess that is quite complex to deploy machine)

    Regards




  • 5.  RE: OSCustomizationSpec and RHEL9 with NetworkManager

    Broadcom Employee
    Posted Oct 08, 2024 11:00 PM

    Hi alpatio,

    Native NetworkManager Keyfile format support is from vSphere 8.0 U3 release. May I know what's your vCenter server version?

    And the OsCustomization log file /var/log/vmware-imc/toolsDeployPkg.log can tell how network configuration was set in the vm, would you please share it, thanks.

    Best regards,

    Pengpeng




  • 6.  RE: OSCustomizationSpec and RHEL9 with NetworkManager

    Posted Oct 09, 2024 05:10 AM

    Hi Pengpeng,
    First of all, Thanks for your time.

    My vSphere is still on 7.03, that's probably the explanation of the behavior that I've found deploying rhel9 using Oscustomspecs.

    I've leaved 'NetworkConfiguration' with default options,  and when the new VM is deployed I'll have to  run "nmcli connection migrate". Doing these steps network configuration is the desired one

    But I'll have to take care to remove any network keyfile definition before deploy the new VM if I want to have a clean configuration.
    I'm removing the /etc/NetworkManager/system-connections/ens192.nmconnection file before poweroff the template for a good success.

    Now I'll have to see how run this command after deploy, well using a customScript (oscustomization option), or perhaps later using an Invoke-VMSCRIPT

    Regards