RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2174857 - nmstatectl service do not support "capture"
Summary: nmstatectl service do not support "capture"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nmstate
Version: 9.2
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-02 14:06 UTC by Quique Llorente
Modified: 2023-11-07 09:02 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:24:02 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 2264 0 None open cli: Support policy file in service mode 2023-03-06 08:44:11 UTC
Red Hat Issue Tracker NMT-357 0 None None None 2023-03-02 14:10:08 UTC
Red Hat Issue Tracker RHELPLAN-150456 0 None None None 2023-03-02 14:10:12 UTC
Red Hat Product Errata RHBA-2023:6323 0 None None None 2023-11-07 08:24:23 UTC

Description Quique Llorente 2023-03-02 14:06:51 UTC
Description of problem:
When using nmstatectl service if the nmpolicy feature is using and the state specify "capture" and "desiredState" then the command fails with 

Mar 02 13:59:48 qemu0 kola-runext-test.sh[1762]: [2023-03-02T13:59:48Z ERROR nmstatectl::service] Failed to apply state file /etc/nmstate/br-ex-policy.yml: serde_yaml::Error: Unsupported keys found: ["capture", "desiredState"]


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


How reproducible: Always


Steps to Reproduce:
1. Create file at /etc/nmstate/state.yml with the content
capture:                                                              
            default-gw-route: routes.running.destination=="0.0.0.0/0"           
            default-gw-iface: interfaces.name==capture.default-gw-route.routes.running.0.next-hop-interface
          desiredState:                                                         
           interfaces:                                                          
            - name: "{{ capture.default-gw-iface.interfaces.0.name }}"          
              description: configured by nmstatectl                             
              type: ethernet                                                    
              state: up                                                         
            - name: br-ex                                                       
              type: linux-bridge                                                
              copy-mac-from: "{{ capture.default-gw-iface.interfaces.0.name }}" 
              state: up                                                         
              ipv4:                                                             
                enabled: true                                                   
                dhcp: true                                                      
              ipv6:                                                             
                enabled: true                                                   
                dhcp: true                                                      
                autoconf: true                                                  
              bridge:                                                           
                port:                                                           
                - name: "{{ capture.default-gw-iface.interfaces.0.name }}"      
2. Run nmstatectl service
3.

Actual results:
Mar 02 13:59:48 qemu0 kola-runext-test.sh[1762]: [2023-03-02T13:59:48Z ERROR nmstatectl::service] Failed to apply state file /etc/nmstate/br-ex-policy.yml: serde_yaml::Error: Unsupported keys found: ["capture", "desiredState"]


Expected results:
Apply the state as expected

Additional info:
We need this at RHEL 9.2 to have RHCOS configure networking with nmstate.service using nmpolicy

Comment 2 Gris Ge 2023-03-06 08:44:11 UTC
Patch posted to upstream: https://github.com/nmstate/nmstate/pull/2264

To test this:
 * Create dummy interface with iproute or nmstate.
 * Store below content as /etc/nmstate/remove_dummy_iface.yml

```yml
capture:
  dummy_iface: interfaces.type == "dummy"
desired:
  interfaces:
  - name: "{{ capture.dummy_iface.interfaces.0.name }}"
    state: absent
```

 * The dummy interface should be removed after `systemctl start nmstate`.

Comment 6 Mingyu Shi 2023-04-24 10:23:15 UTC
Verified with:
nmstate-2.2.9-1.el9.x86_64
nispor-1.2.10-1.el9.x86_64
NetworkManager-1.43.6-1.el9.x86_64
DISTRO=RHEL-9.3.0-20230423.30

Comment 8 errata-xmlrpc 2023-11-07 08:24:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6323


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