Bug 2222571

Summary: [Azure][ondemand] Suggest to enable nm-cloud-setup in Azure images
Product: Red Hat Enterprise Linux 9 Reporter: Yuxin Sun <yuxisun>
Component: NetworkManagerAssignee: Yuxin Sun <yuxisun>
Status: NEW --- QA Contact: Yuxin Sun <yuxisun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: anujmaurya, bgalvani, desktop-qa-list, litian, lrintel, rkhan, sfaye, sukulkar, thaller, till, xuli, xxiong, yacao
Target Milestone: rcKeywords: TestOnly
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yuxin Sun 2023-07-13 06:52:48 UTC
Description of problem:
Suggest to install NetworkManager-cloud-setup package, enable Azure configuration and enable nm-cloud-setup.timer and nm-cloud-setup.service. This service can detect the secondary IPs from Azure metadata and configure it inside the VM.

Version-Release number of selected component (if applicable):
RHEL-8/9 RHEL images in the Azure Marketplace
* NetworkManager-nm-cloud-setup version must larger than NetworkManager-1.30.0-13.el8_4, or will hit a critical issue, see BZ#2014510

How reproducible:
100%

Steps to Reproduce:

Actual Results:
There's no NetworkManager-cloud-setup installed in the RHEL images

Expected Results:
1. Install NetworkManager-cloud-setup package
2. mkdir -p /etc/systemd/system/nm-cloud-setup.service.d
cat > /etc/systemd/system/nm-cloud-setup.service.d/10-enable-azure.conf << EOF
[Service]
Environment=NM_CLOUD_SETUP_AZURE=yes
EOF
3. Enable nm-cloud-setup.service, nm-cloud-setup.timer

Additional info:
It has been enabled in the AWS RHEL images. Suggest to also enable it in the Azure images.

Comment 1 Thomas Haller 2023-07-13 08:18:37 UTC
> 2. There's "Environment=NM_CLOUD_SETUP_AZURE=yes" in /usr/lib/systemd/system/nm-cloud-setup.service

Files in /usr/lib are provided by the RPM package. It's not good to modify them.
Instead, systemd supports overlaying configuration in /etc.

See "EXAMPLE SETUP FOR CONFIGURING AND PREDEPLOYING NM-CLOUD-SETUP" in `man nm-cloud-setup` for how to enable nm-cloud-setup.

Comment 2 Yuxin Sun 2023-07-17 09:39:51 UTC
(In reply to Thomas Haller from comment #1)
> > 2. There's "Environment=NM_CLOUD_SETUP_AZURE=yes" in /usr/lib/systemd/system/nm-cloud-setup.service
> 
> Files in /usr/lib are provided by the RPM package. It's not good to modify
> them.
> Instead, systemd supports overlaying configuration in /etc.
> 
> See "EXAMPLE SETUP FOR CONFIGURING AND PREDEPLOYING NM-CLOUD-SETUP" in `man
> nm-cloud-setup` for how to enable nm-cloud-setup.

Thank you so much Thomas!

According to 'man nm-cloud-setup', the step 2 should be:

mkdir -p /etc/systemd/system/nm-cloud-setup.service.d
cat > /etc/systemd/system/nm-cloud-setup.service.d/10-enable-azure.conf << EOF
[Service]
Environment=NM_CLOUD_SETUP_AZURE=yes
EOF

I'll correct my step in the comment 0. Thanks!