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

OpenNebula one_service fails to create a service with unique name #3137

Closed
1 task done
netcho opened this issue Aug 3, 2021 · 6 comments · Fixed by #8887
Closed
1 task done

OpenNebula one_service fails to create a service with unique name #3137

netcho opened this issue Aug 3, 2021 · 6 comments · Fixed by #8887
Labels
bug This issue/PR relates to a bug cloud has_pr module module needs_triage plugins plugin (any type) python3

Comments

@netcho
Copy link

netcho commented Aug 3, 2021

Summary

Reinstantiating a service with the same name from a template fails when unique: true. This happens if one undeploys the service either via Sunstone or OneFlow CLI. In this case, the service transitions to state DONE. When trying to instantiate a service with the same name, one_service module fetches all services, including those in state DONE. It finds a service with the specified name, and it decides that it's not creating a service but rather updating it. It then decides to update it, but OneFlow rejects the requests as the service is in state DONE.

Issue Type

Bug Report

Component Name

plugins/modules/cloud/opennebula/one_service.py

Ansible Version

AWX 19.2.2

ansible-playbook [core 2.11.2.post0] 
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.6 (default, Jan 29 2021, 17:38:16) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
  jinja version = 2.10.3
  libyaml = True

Configuration

$ ansible-config dump --only-changed

OS / Environment

AWX EE 0.5.0

Steps to Reproduce

Run a task, similar to the one below

- name: Instantiating OpenNebula service
  one_service:
    template_id: "{{ one_template_id }}"
    service_name: "{{ deployment_name }}"
    unique: true
    wait: true

Then delete the instantiated service either via Sunstone or via OneFlow. Then run the task above again.

Expected Results

The service should be created. However, OneFlow rejects it as it believes one is trying to instantiate an already undeployed service.

Actual Results

TASK [Instantiating OpenNebula service] ****************************************
task path: /runner/project/deploy.yaml:25
redirecting (type: modules) ansible.builtin.one_service to community.general.one_service
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Deploying is unsuccessful. Service state: DONE. Error message: "}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot

This comment has been minimized.

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug needs_triage python3 labels Aug 3, 2021
@netcho
Copy link
Author

netcho commented Aug 3, 2021

!component plugins/modules/cloud/opennebula/one_service.py

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added cloud module module plugins plugin (any type) labels Aug 3, 2021
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@felixfontein
Copy link
Collaborator

There's a PR for this: #8887. Would be great if someone interested in this bug could test it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud has_pr module module needs_triage plugins plugin (any type) python3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants