Bug 1567958

Summary: removing label from host's network interface removes also network assigned to it
Product: Red Hat Enterprise Virtualization Manager Reporter: Lucie Leistnerova <lleistne>
Component: ansibleAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.3CC: lleistne, lsvaty, mgoldboi, mkalinin, mperina, omachace
Target Milestone: ovirt-4.2.5Keywords: Automation
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-2.5.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 09:54:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lucie Leistnerova 2018-04-16 13:35:05 UTC
Description of problem:
When user removes label from host's network interface, also network is removed.

Version-Release number of selected component (if applicable):
ansible-2.5.0-2.fc27.noarch
ovirt-engine-4.2.3-0.1.el7.noarch

How reproducible: always


Steps to Reproduce:
1. create dummy_1 interface on host, create test_network in engine
2. assign network and add label to interface

---
- hosts:
    - engine
  tasks:
    - name: Add VM Networks
      ovirt_host_networks:
        auth: "{{ ansible_auth }}"
        name: "vhost05"
        interface: dummy_1
        networks:
          - name: test_network
        labels:
          - INT
        check: true
        save: true

3. label and network added, see in admin portal hosts detail -> Network interfaces -> Setup Host Networks
4. remove the label

---
- hosts:
    - engine
  tasks:
    - name: Remove label
      ovirt_host_networks:
        auth: "{{ ansible_auth }}"
        name: "vhost05"
        interface: dummy_1
        labels:
          - INT
        check: true
        save: true
        state: absent


Actual results: label and network are removed from the interface


Expected results: only label is removed, network stays assigned to interface dummy_1

Comment 2 Lucie Leistnerova 2018-07-16 15:24:11 UTC
When only label or only network is defined for deletion, only the specified item is really removed. When defined both, both are removed.

verified in ansible-2.6.1-1.el7ae.noarch with ovirt-engine-4.2.5.1-0.1.el7ev.noarch

Comment 3 Marina Kalinin 2018-08-31 20:00:31 UTC
HI Ondra / Lucie,

This bug is on verified and 4.2.5 is out.
Why is this bug still open?
Who can confirm the correct status of it?

Thank you!

Comment 4 Martin Perina 2018-09-04 09:54:08 UTC
(In reply to Marina from comment #3)
> HI Ondra / Lucie,
> 
> This bug is on verified and 4.2.5 is out.
> Why is this bug still open?
> Who can confirm the correct status of it?
> 
> Thank you!

The fix was provided in Ansible Engine 2.5.1 released in errata https://errata.devel.redhat.com/advisory/33631 but we cannot add RHV bugs to Ansible Engine erratas, so such bugs need to be closed manually.

Comment 5 Marina Kalinin 2018-09-04 14:05:15 UTC
https://access.redhat.com/errata/RHBA-2018:1210