I am using Ansible version ansible 2.1.0 (devel 0c013f592a) last updated 2015/12/21 14:26:10 (GMT -700)
I am using Ubuntu on 14.04 on the target system with OpenStack Kilo release.
i am using the Ansible os_network module which is described here: http://goo.gl/UhzIWl
I can create openstack network (using os_network), subnet and start virtual machine using Ansible os_ modules.
I can delete the virtual machine (using os_server) and subnet using os_network but when I try to delete the network
with os_network, I get ‘service catalog is empty’ error. Here is the task and error message:
TASK [os_test : remove network] ************************************************
fatal: [3.0.0.10]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Error fetching network list: The service catalog is empty.”}
I can create and delete networks using openstack CLI (or Horizon) and it works correctly.
I have tried various values for the os_network endpoint_type and get same error.
All OpenStack neutron commands work correctly at the command line.
Any idea why I cannot delete the OpenStack network (with os_network) which I have just created?
I am using Ansible version ansible 2.1.0 (devel 0c013f592a) last updated 2015/12/21 14:26:10 (GMT -700)
I am using Ubuntu on 14.04 on the target system with OpenStack Kilo release.
i am using the Ansible os_network module which is described here: http://goo.gl/UhzIWl
I can create openstack network (using os_network), subnet and start virtual machine using Ansible os_ modules.
I can delete the virtual machine (using os_server) and subnet using os_network but when I try to delete the network
with os_network, I get ‘service catalog is empty’ error. Here is the task and error message:
TASK [os_test : remove network] ************************************************
fatal: [3.0.0.10]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Error fetching network list: The service catalog is empty.”}
That is a REALLY strange error. I honestly cannot imagine a scenario that would cause that.
I can create and delete networks using openstack CLI (or Horizon) and it works correctly.
I have tried various values for the os_network endpoint_type and get same error.
All OpenStack neutron commands work correctly at the command line.
Any idea why I cannot delete the OpenStack network (with os_network) which I have just created?
thanks,
Rod
I have no idea what could cause that problem. Can you provide some more details that might
help us debug this? Can we see the playbook that reproduces this (this simpler the better)?
What cloud provider are you using?
My playbook will create an OpenStack (Kilo) compute node and then run a minimal self test on the new compute node. The os_network error is happening in the ‘os_test’ role in the playbook. The self test will
create neutron network and subnet
start new VM instance
list running VMs
remove/delete the VM
5.delete the subnet and network
attachments:
i set ANSIBLE_KEEP_REMOTE_FILES=1 and the os_network script was saved on the target. Ihave attached the os_network script which was generated by ansible. I notice that when I run this script
manually on the target, it seems to complete correctly and the openstack network is deleted.
Here is the output when i run the os_network manually:
i attached the playbook ‘compute_playbook.yml’; the error is happening in the ‘os_test’ role.
i attached the main.yml task list for the os_test role. The error is happening on the ‘remove network task’ within this task list. Just focus on what is happening in this task list and don’t worry about the whole playbook.
If you could help me know why the os_network script is failing (see red error msg above) to delete
the network, that would be great.
You specify a different endpoint type when deleting the network (internal) for
some reason. Try removing that. I don’t know what cloud provider you are using
so I’m not sure how they have their endpoints setup.
Also, have you tried simplifying the issue with a smaller playbook? Try one
that simply creates a network then immediately deletes it.
I figured out why the os_network delete task was failing. I assidentially ommited one line in the credentials (the project name).
The following os_network task will correctly delete the nework:
name: remove network
become: no
os_network:
name: mynetwork
state: absent
timeout: 200
wait: yes
auth:
auth_url: “{{ os_auth_url }}”
project_domain_id: “{{ os_project_domain_id }}”
user_domain_id: “{{ os_user_domain_id }}”
username: “{{ os_username }}”
password: “{{ os_password }}”
project_name: “{{ os_project_name }}” << this is the line i left out in my original code
register: mynet_results