Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] waagent missing ipv6.addr-gen-mode eui64 from nmcli command #2927

Open
bwilkinscloud opened this issue Sep 19, 2023 · 1 comment
Open
Assignees

Comments

@bwilkinscloud
Copy link

bwilkinscloud commented Sep 19, 2023

Running sudo waagent -deprovision+user and I got this error:

ERROR MainThread Command: [nmcli device modify eth0 ipv4.dhcp-hostname localhost.localdomain ipv6.dhcp-hostname localhost.localdomain], return code: [6], result: [Error: Reapplying connection to device 'eth0' (/org/freedesktop/NetworkManager/Devices/2) failed: The settings specified are invalid: ipv6.addr-gen-mode: property is invalid

The fix is to do the following:

Run

$ nmcli device modify eth0 ipv4.dhcp-hostname localhost.localdomain ipv6.dhcp-hostname localhost.localdomain ipv6.addr-gen-mode eui64

before

running sudo waagent deprovision

Distro: RHEL8.7
WALinuxAgent version: 2.7.0.6 running on redhat 8.7
Python: 3.6.8

Additional context
N/A

Log file attached
N/A

@bwilkinscloud bwilkinscloud changed the title [BUG] Waagent and NetworkManager.conf missing ipv6.addr-gen-mode leaves system in bad state [BUG] waagent missing ipv6.addr-gen-mode eui64 from nmcli command Sep 21, 2023
@bwilkinscloud
Copy link
Author

bwilkinscloud commented Sep 21, 2023

I updated the title to now reflect the actual problem and provided the fix.

The bad state part was due to cloud-init. That problem is covered under: https://bugzilla.redhat.com/show_bug.cgi?id=1957532

and the workaround for RHEL8.7 because it does not have the fixed version of cloud-init is: For VMs that were upgraded from RHEL 8.4 or earlier, you must work around the issue manually.

To do so, edit the cloud.cfg file and changing the ssh_genkeytypes: ~ line to ssh_genkeytypes: ['rsa', 'ecdsa', 'ed25519']. This makes it possible for SSH keys to be deleted and generated correctly when provisioning a RHEL 8 VM in the described circumstances.

I recommend you put the nmcli and the cloud.cfg into an Ansible playbook then run it from your hardening pipeline that should have an automated capture capability (e.g. with terraform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants