Bug 1464999 - After setting ipv6 to dhcp its not possible to set it back to static
Summary: After setting ipv6 to dhcp its not possible to set it back to static
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: GA
: 5.9.0
Assignee: Gregg Tanzillo
QA Contact: luke couzens
URL:
Whiteboard: black:ipv6
Depends On:
Blocks: 1472842
TreeView+ depends on / blocked
 
Reported: 2017-06-26 11:48 UTC by luke couzens
Modified: 2018-03-06 15:38 UTC (History)
10 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1472842 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:38:02 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description luke couzens 2017-06-26 11:48:13 UTC
Description of problem:After setting ipv6 to dhcp its not possible to set it back to static


Version-Release number of selected component (if applicable):5.8.1.0


How reproducible:100%


Steps to Reproduce:
1.Provision appliance
2.ssh to appliance
3.Launch appliance_console
4.set ipv6 to dhcp
5.Try setting it back to static

Actual results:
Network interface failed to start using the values supplied

Expected results:static ipv6 set correctly


Additional info:
After this failure both ipv6 and ipv4 have been lost from configuration

Comment 3 Nick Carboni 2017-07-17 21:39:48 UTC
I'm not sure we have a solution for this yet, but we have made some progress.

TLDR; There are two work-arounds for this, either:
`rm /var/run/dhclient6-eth0.pid` (assuming a process with pid in the file doesn't exist)
or:
Just do the config through the console again

More detail to follow:

After making changes to a network interface config file we run `ifdown eth0` then `ifup eth0` to make the changes take effect.

For some reason when we set ipv6 config to dhcp, dhclient fails to start properly, leaving a pid file (/var/run/dhclient6-eth0.pid). This, in my opinion, is a bug in dhclient. In my testing I typically will get an address, but dhclient will not be running for IPv6 (the command line should have the -6 option).

When we then try to set the config to static, we attempt to `ifdown eth0` which tries to stop the instance of dhclient that should be running based on the presence if the pid file. This causes the ifdown command to return an error status and we fail.

Because the error is being caused by a file rather than a misconfiguration you can simply remove the pid file and then set the static address using the console. Alternatively, after hitting the issue once, you should be able to run through the configuration again because ifdown removes the pid file (even though it fails).

Luke,

Can you test out these workarounds?

Comment 4 CFME Bot 2017-07-18 20:15:21 UTC
New commit detected on ManageIQ/linux_admin/master:
https://github.com/ManageIQ/linux_admin/commit/568f56a5fa66fb87bb62aff7458089d30bc15420

commit 568f56a5fa66fb87bb62aff7458089d30bc15420
Author:     Bo Yao <boyao>
AuthorDate: Fri Jul 14 11:47:32 2017 -0400
Commit:     Bo Yao <boyao>
CommitDate: Tue Jul 18 16:06:51 2017 -0400

    Fix configure network fails after a success DHCP configuration
    https://bugzilla.redhat.com/show_bug.cgi?id=1464999

 lib/linux_admin/network_interface/network_interface_rh.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comment 5 Satoe Imaishi 2017-07-19 13:54:55 UTC
PR to bump linux_admin version: https://github.com/ManageIQ/manageiq-gems-pending/pull/243

Comment 7 luke couzens 2017-07-20 09:11:35 UTC
Both workarounds do seem to work for setting ipv6, but its still required to run this from a provider console and not through ssh to the appliance as ipv4 still gets dropped.

Comment 8 Bo Yao 2017-07-21 13:49:41 UTC
(In reply to luke couzens from comment #7)
> Both workarounds do seem to work for setting ipv6, but its still required to
> run this from a provider console and not through ssh to the appliance as
> ipv4 still gets dropped.

Currently what we did in setting the network is shutting down network interface and change in network configuration file then start network interface. I did some search found both ipv4 and ipv6 change to an interface (eth0) need restart network service. 
https://askubuntu.com/questions/76742/restarting-the-ipv6-network-stack-without-restarting-the-ipv4-network-stack
This is not very authoritative, but no more I can found for adding ipv6 address without restarting network interface in Red Hat, Debian, Ubuntu and Archlinux official docs, so we can generally think it's not possible.

Reference:
https://access.redhat.com/solutions/347693
https://wiki.debian.org/DebianIPv6
https://wiki.ubuntu.com/IPv6
https://wiki.archlinux.org/index.php/IPv6

But there are simple ways to do this in ssh client side to avoid drop ssh connection:
1) using screen or tmux with ssh to suspend the ssh client;
2) using mosh: https://github.com/mobile-shell/mosh
It's a enhanced ssh run "server" on both client and server side. When server ip address change/temporarily restart, it can keep connection alive.

Comment 9 luke couzens 2017-10-12 13:49:28 UTC
Verified in 5.9.0.2


Note You need to log in before you can comment on or make changes to this bug.