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

"Unsupported parameters for (arista.cvp.cv_container) module: save_topology #142

Closed
e-cnelis opened this issue Feb 21, 2020 · 6 comments
Closed
Assignees
Labels
module: cv_container Issue related to cv_container module
Projects
Milestone

Comments

@e-cnelis
Copy link

Issue Type

  • Question/Bug Report

Module Name

  • cv_container

arista.cvp collection and Python libraries version

ansible 2.9.5
  config file = /scripts/ansible.cfg
  configured module search path = ['/plugins/modules', '/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.6 (default, Jun 27 2018, 22:45:12) [GCC 6.3.0]


ansible 2.9.5
  config file = /scripts/ansible.cfg
  configured module search path = ['/plugins/modules', '/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.6 (default, Jun 27 2018, 22:45:12) [GCC 6.3.0]
py3-ansible-cvp:root% 
py3-ansible-cvp:root% pip freeze
ansible==2.9.5
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cryptography==2.8
idna==2.8
Jinja2==2.11.1
MarkupSafe==1.1.1
pycparser==2.19
PyYAML==5.3
requests==2.22.0
six==1.14.0
treelib==1.5.5
urllib3==1.25.8


py3-ansible-cvp:root%  cat /project/arista/cvp/galaxy.yml | grep version:
version: 1.0.4

$ git version
git version 2.7.4

OS / Environment

Build Information
CloudVision version
2019.1.3
UI version
1.14.1
Build hash
17c4fac03
Build time
Jan 22, 2020 19:26:55 CET

Summary

Ansible failed at module cv_container with the error:

"msg": "Unsupported parameters for (arista.cvp.cv_container) module: save_topology Supported parameters include: cvp_facts, mode, topology"

With either values true or false for save_topology

Steps to reproduce

ansible-playbook playbook.container.2019_override.yaml

Playbook

---
- name: Playbook to validate and demonstrate cv_container module.
  hosts: cvp
  connection: local
  gather_facts: no
  collections:
    - arista.cvp
  
  vars:
    containers_provision:
      IPFabric1:
        parent_container: Tenant
        devices:
        - arista1-Spine-1
      IPFabric:
        parent_container: Tenant
        devices:
        - arista5-Leaf-1
        - arista6-Leaf-2

  tasks:
    - name: "Gather CVP facts from {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: cvp_facts

    - name: Display CVP info
      debug:
        msg: "{{cvp_facts.ansible_facts.cvp_info}}" 

    - name: Display CVP Facts
      debug:
        msg: "{{cvp_facts}}" 

    - name: "Build Container topology on {{inventory_hostname}}"
      arista.cvp.cv_container:
        topology: '{{containers_provision}}'
        cvp_facts: '{{cvp_facts.ansible_facts}}'
        save_topology: false
        mode: override
      register: CVP_CONTAINERS_RESULT

    - name: Display tasks from cv_container
      debug:
        msg: "{{CVP_CONTAINERS_RESULT.data.tasks}}" 

    - name: 'Execute all pending tasks and wait for completion for 60 seconds'
      arista.cvp.cv_task:
        tasks: "{{ CVP_CONTAINERS_RESULT.data.tasks }}"
        wait: 60

    - name: "Refresh CVP facts from {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: cvp_facts

    - name: Display CVP Facts
      debug:
        msg: "{{cvp_facts}}" 

Expected results

Move devices without errors

Actual results

outuput_container2019_override_false.txt


@e-cnelis e-cnelis added the status: Triage New incoming issue label Feb 21, 2020
@titom73 titom73 self-assigned this Feb 22, 2020
@titom73 titom73 added module: cv_container Issue related to cv_container module type: question Further information is requested and removed status: Triage New incoming issue labels Feb 22, 2020
@titom73
Copy link
Contributor

titom73 commented Feb 22, 2020

Hi @roman-so

Because this option shall be set to true every time, it is has been removed starting v1.0.3a as stated in release notes

Change has been tracked with issue #115 and PR #116.

@e-cnelis
Copy link
Author

Thank you for your reply. Like stated above, we have exactly the same behavior for save_topology to true. Should we add aditional traces ?

@titom73
Copy link
Contributor

titom73 commented Feb 22, 2020

This option has been removed from available options. So your task should be like this:

    - name: "Build Container topology on {{inventory_hostname}}"
      arista.cvp.cv_container:
        topology: '{{containers_provision}}'
        cvp_facts: '{{cvp_facts.ansible_facts}}'
        mode: override
      register: CVP_CONTAINERS_RESULT

@e-cnelis
Copy link
Author

e-cnelis commented Feb 24, 2020

We have removed the option and we get this error:

fatal: [cvp_2019]: FAILED! => {"changed": false, "msg": "GET: https://x.x.x.x:443/web/provisioning/getContainerInfoById.do?containerId= : Request Error: Invalid Container id"}

We have changed the naming (deleted the "-") to remove the doubt but we still get the same error.

We also run other smaller playbook

---
- name: Playbook to validate and demonstrate cv_container module.
  hosts: cvp
  connection: local
  gather_facts: no
  collections:
    - arista.cvp
  
  vars:
    containers_provision:
      IPFabric1:
        parent_container: Tenant
        devices:
        - Spine1
      IPFabric:
        parent_container: Tenant
        devices:
        - Leaf1
        - Leaf2

  tasks:
    - name: "Gather CVP facts from {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: cvp_facts

    - name: Display CVP info
      debug:
        msg: "{{cvp_facts.ansible_facts.cvp_info}}" 

    - name: Display CVP Facts
      debug:
        msg: "{{cvp_facts}}" 

    - name: "Build Container topology on {{inventory_hostname}}"
      arista.cvp.cv_container:
        topology: '{{containers_provision}}'
        cvp_facts: '{{cvp_facts.ansible_facts}}'
        #save_topology: false
        mode: override
      register: CVP_CONTAINERS_RESULT

    - name: Display tasks from cv_container
      debug:
        msg: "{{CVP_CONTAINERS_RESULT.data.tasks}}" 

    - name: 'Execute all pending tasks and wait for completion for 60 seconds'
      arista.cvp.cv_task:
        tasks: "{{ CVP_CONTAINERS_RESULT.data.tasks }}"
        wait: 60

    - name: "Refresh CVP facts from {{inventory_hostname}}"
      arista.cvp.cv_facts:
      register: cvp_facts

    - name: Display CVP Facts
      debug:
        msg: "{{cvp_facts}}" 

Here it the cvp topology
image

We tried the API directly from CVP with the container_id from CVP facts and it looks ok
image

@titom73 titom73 added cvp-version: Grant state: accepted Issue is part of the development roadmap and removed type: question Further information is requested labels Feb 24, 2020
@titom73 titom73 added this to Needs triage in Priority via automation Feb 24, 2020
@titom73
Copy link
Contributor

titom73 commented Feb 24, 2020

Hi @roman-so ,
Will take a look at this error. I reproduced it this week end and even if we have an error message, ansible should have been executed as expected.

Change status and will work on this message as soon as possible.

Kind Regards,

@titom73 titom73 moved this from Needs triage to Medium Proiority in Priority Feb 29, 2020
@titom73 titom73 removed the state: accepted Issue is part of the development roadmap label Feb 29, 2020
@titom73
Copy link
Contributor

titom73 commented Feb 29, 2020

Currently working on how to reproduce issue in lab.
Because issue is not present in all runs, a dedicated issue has been opened for dedicated tracking. (#143 )

Closing this issue

@titom73 titom73 closed this as completed Feb 29, 2020
Priority automation moved this from Medium Proiority to Closed Feb 29, 2020
titom73 added a commit that referenced this issue Mar 2, 2020
Fix problem in delete_topology (state absent) and
delete_unused_containers (mode override) where reversed list where not
set to the correct tree list.
titom73 added a commit that referenced this issue Mar 5, 2020
Fix deletion problem w/ additional containers #142
@titom73 titom73 added this to the v1.0.5 milestone Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cv_container Issue related to cv_container module
Projects
Priority
Closed
Development

No branches or pull requests

2 participants