Bug 1368109

Summary: [RHVH] Update documentation to use plain ifcfg files for network configuration
Product: Red Hat Enterprise Virtualization Manager Reporter: Fabian Deutsch <fdeutsch>
Component: DocumentationAssignee: Tahlia Richardson <trichard>
Status: CLOSED CURRENTRELEASE QA Contact: Megan Lewis <melewis>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.0.0CC: cshao, danken, dguo, fdeutsch, gklein, huzhao, leiwang, lsurette, mburman, mgoldboi, rbalakri, rbarry, srevivo, trichard, weiwang, yaniwang, ycui, ykaul, ylavi
Target Milestone: ovirt-4.0.3   
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: 2016-08-24 23:42:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Docs RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1368650    
Bug Blocks:    

Description Fabian Deutsch 2016-08-18 12:50:55 UTC
Description of problem:
Currently the docs reference cockpit for network configuration.
Because of bug 1367669 network configuration through cockpit is not available for 4.0 GA.
But the network can be configured through nmtui a commandline tool.

The docs should be updated to reference nmtui instead of cockpit.

In addition to use nmtui, there is one relevant thing when using nmtui/nmcli:
The connection anme must follow the legacy interface naming: bond0, bond1, bond0.20, ...

This is critical to allow it to work with vdsm

Comment 3 Fabian Deutsch 2016-08-18 13:13:18 UTC
Comment 2 is _NOT_ enough.

A special requirement to make this compatible to vdsm is:
The "connection name" needs to match the ifname.

I.e.

The connection names should be like:
For nics: eth0, enp6s0, p1p2, …
For bonds: bond0, bond1, …
For vlans: eth0.20, bond0.20, …

Comment 4 Ryan Barry 2016-08-18 19:41:51 UTC
Tested the following, with success:

Install RHV-H

SSH to RHV-H
Remove the ifcfg files for interfaces to attach to the bond (networkmanager will hold in-memory models, and the connections will stay up)
nmtui ->

<Edit>
<Add>
<Bond>

Set "Profile name" to "bond0"
Set "device" to "bond0"

Add slaves ("Profile name" and "device" should match)

The correct ifcfg files are written

# For all slaves
nmcli c down ${bond_slave} && nmcli c up ${bond_slave}

Result:

The bond is up
Correct ifcfg file naming
SSH connection never drops (it hangs a bit after the first connection is set down then up as DHCP renegotiates, but this should be nearly instant with static IPs)

Comment 5 Tahlia Richardson 2016-08-19 05:48:54 UTC
*** Bug 1368129 has been marked as a duplicate of this bug. ***

Comment 6 Tahlia Richardson 2016-08-19 06:10:41 UTC
It looks like this should be a note/warning that includes:

* A mention that the networking GUI isn't currently available in RHVH Cockpit.
* A link to the RHEL docs for nmtui
* A warning that the connection name must match the ifname.

Please let me know (when you know) when the networking tab is added back, so I can remove this note when appropriate.

Comment 7 Fabian Deutsch 2016-08-19 07:52:50 UTC
Can we also add that the safest way to configure networking is to write ifcfg files

Comment 8 Michael Burman 2016-08-21 07:32:00 UTC
comment 6 is correct. We would like to also add a successful means to create a bond via nmcli while maintaining old-style ifcfg names, assuming that both SLAVE1 and SLAVE2 have preexisting NM connections. Verify this with `nmcli con show`.

SLAVE1=enp4s0
SLAVE2=enp6s0
HOSTCIDR=192.168.0.1/16
GATEWAY=192.168.0.254
nmcli connection add type bond con-name bond1 ifname bond1 mode active-backup ipv4.method manual ipv4.addresses $HOSTCIDR ipv4.gateway $GATEWAY; \
nmcli connection modify id $SLAVE1 connection.slave-type bond connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
nmcli connection modify id $SLAVE2 connection.slave-type bond connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
nmcli connection up id bond1; \
nmcli connection up id $SLAVE1; \
nmcli connection up id $SLAVE2

Before adding the host to Engine verify that indeed ifcfg files are properly named and that /sys/class/net/bond1/bonding/slaves has both slaves listed.

Comment 9 Michael Burman 2016-08-21 08:10:49 UTC
(In reply to Michael Burman from comment #8)
> comment 6 is correct. We would like to also add a successful means to create
> a bond via nmcli while maintaining old-style ifcfg names, assuming that both
> SLAVE1 and SLAVE2 have preexisting NM connections. Verify this with `nmcli
> con show`.
> 
> SLAVE1=enp4s0
> SLAVE2=enp6s0
> HOSTCIDR=192.168.0.1/16
> GATEWAY=192.168.0.254
> nmcli connection add type bond con-name bond1 ifname bond1 mode
> active-backup ipv4.method manual ipv4.addresses $HOSTCIDR ipv4.gateway
> $GATEWAY; \
> nmcli connection modify id $SLAVE1 connection.slave-type bond
> connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
> nmcli connection modify id $SLAVE2 connection.slave-type bond
> connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
> nmcli connection up id bond1; \
> nmcli connection up id $SLAVE1; \
> nmcli connection up id $SLAVE2
> 
> Before adding the host to Engine verify that indeed ifcfg files are properly
> named and that /sys/class/net/bond1/bonding/slaves has both slaves listed.

We should first add the bond and then modify it --> 

nmcli connection add type bond con-name bond1 ifname bond1 mode active-backup; \
nmcli con mod id bond1 ipv4.addresses $HOSTCIDR ipv4.gateway $GATEWAY ipv4.method manual; \
nmcli connection modify id $SLAVE1 connection.slave-type bond 
connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
nmcli connection modify id $SLAVE2 connection.slave-type bond
connection.master bond1 connection.autoconnect yes ipv4.method disabled; \
nmcli connection up id bond1; \
nmcli connection up id $SLAVE1; \
nmcli connection up id $SLAVE2

Comment 10 Ying Cui 2016-08-22 06:47:30 UTC
The detail Virt QE test steps on simple bond via nmtui.
https://bugzilla.redhat.com/show_bug.cgi?id=1368650#c0  and
https://bugzilla.redhat.com/show_bug.cgi?id=1368650#c14

Summary here:
1.Install the RHVH successful.
2.Drop to shell, and run # nmtui, then enter NM TUI, delete the previous NICs via NM TUI firstly, e.g. enp2s0 and enp1s7.
3.Setup the bond0 over two NICs, and get IP with static successfully. 
The connection names should be set like in this bug comment 3.
4.Modify the ifcfg devices files, e.g.ifcfg-enp2s0 and ifcfg-enp1s7, Change the slaves "MASTER" value from the bond UUID to its bond name, e.g. bond0.
5.Restart the NetworkManager, the still can get IP.
6.Add rhvh to engine, and then wait for a while, Host is up.

Comment 11 Fabian Deutsch 2016-08-22 12:49:24 UTC
An update:

vdsm does not work properly with all ifcfg files generated by NM (independently how it was created, nmtui, nmcli, or Cockpit).
There are some cases where it might work (i.e. simple nic configuration), but it depends on the network setup and other factors (naming of the connection, and other defined connections).

Thus the statement is that currently the networking configuration needs to be done through manually writing ifcfg files. Configuring networking through NetworkManager, including nmcli, nmtui and Cockpit, is currently not supported.
This statement is true for both RHVH and RHEL-H.

This statement should be in a place which applies to both host types.
With this we can also drop the RHVH specific networking documentation.

Comment 15 Fabian Deutsch 2016-08-24 05:58:39 UTC
http://file.bne.redhat.com/trichard/RHEV/4.0/Install/html-single/#Red_Hat_Virtualization_Hosts

currently says:

"""Configuring networking through NetworkManager (including nmcli, nmtui, and the Cockpit user interface) is currently not supported. If additional network configuration is required before adding a host to the Manager, you must manually write ifcfg files. See the Red Hat Enterprise Linux Networking Guide for more information.
In order to work with VDSM, new connection names must follow the ifname conventions used in previous versions of Red Hat Enterprise Virtualization."""

We need to remove the last paragraph, because it only applies to NM - which should not be used, thus:

"""Configuring networking through NetworkManager (including nmcli, nmtui, and the Cockpit user interface) is currently not supported. If additional network configuration is required before adding a host to the Manager, you must manually write ifcfg files. See the Red Hat Enterprise Linux Networking Guide for more information."""

Comment 17 Tahlia Richardson 2016-08-24 06:24:49 UTC
Thanks, Fabian. I've fixed that up, and the two affected guides are in the queue to be published.