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

Attaching additional_volumes to an os_server fails not able to find the system #1139

Closed
Dannyb48 opened this issue May 23, 2019 · 4 comments
Closed

Comments

@Dannyb48
Copy link
Contributor

This is a contintuation of #1137 using linchpin 1.7.4.1.

Where once I patched the schema locally, I re-ran the pinfile and this time it is able to provision the VM, create the volume, but fails to attach it to the system. The error from the ansible task is below as well as the pinfile.

The problem seems to be that the server name is db2_ci_test_client_a but linchpin is appending a number based on count, db2_ci_test_client_a1. Which causes the os_server_volume module to fail because it can find the system. It seems to stem from this filter plugin
https://github.com/CentOS-PaaS-SIG/linchpin/blob/develop/linchpin/provision/filter_plugins/render_os_server_insts.py

This conflicts with what the rest of the provision_os_server.yml playbook is doing when it provisions the instance.

Might make more sense to remove the system naming logic from the filter plugin and then just move the following tasks in provision_os_server.yml BEFORE performing the rendering so that the filter plugin just creates the required server dict using the provided names from the two tasks below and volume info from the res_def?

- name: generate res_def_names
  set_fact:
    res_def_names: "{{ res_def_names  + [os_resource_name + default_delimiter + inst_c] }}"
  with_sequence: start=0 end={{ res_def['count']|int - 1 }}
  when: res_def['count'] > 1
  loop_control:
    loop_var: inst_c

- name: generate res_def_names
  set_fact:
    res_def_names: "{{ res_def_names  + [os_resource_name] }}"
  when: res_def['count'] == 1
--
os-server-addl-vols:
  topology:
    topology_name: os-server-addl-vols
    resource_groups:
      - resource_group_name: os-server-addl-vols
        resource_group_type: openstack
        resource_definitions:
          - name: "db2_ci_test_client_a"
            role: os_server
            flavor: m1.small
            image: rhel-7.4-server-x86_64-released
            count: 1
            keypair: db2-test
            additional_volumes:
              - name: "test_vol"
                size: 2
                device_name: "/dev/vdb"
            networks:
              - provider_net_cci_4
        credentials:
          filename: clouds.yaml
          profile: ci-rhos
  layout:
    inventory_layout:
      vars:
        hostname: __IP__
      hosts:
        addl-vols-node:
          count: 2
          host_groups:
            - db2_ci_test_client_a
2019-05-23 16:00:51,823 p=16631 u=dbaez |  TASK [openstack : Attach addtional volumes] ***********************************************************************************************************************************************************************
2019-05-23 16:00:54,020 p=16631 u=dbaez |  An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'id'
2019-05-23 16:00:54,021 p=16631 u=dbaez |  failed: [localhost] (item={'device_name': u'/dev/vdb', 'name': u'test_vol-db2_ci_test_client_a1', 'server_name': u'db2_ci_test_client_a1', 'size': 2}) => {"add_vol": {"device_name": "/dev/vdb", "name": "test_vol-db2_ci_test_client_a1", "server_name": "db2_ci_test_client_a1", "size": 2}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/dbaez/.ansible/tmp/ansible-tmp-1558641651.89-96864677547322/AnsiballZ_os_server_volume.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/home/dbaez/.ansible/tmp/ansible-tmp-1558641651.89-96864677547322/AnsiballZ_os_server_volume.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/dbaez/.ansible/tmp/ansible-tmp-1558641651.89-96864677547322/AnsiballZ_os_server_volume.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_os_server_volume_payload_Waz3Ge/__main__.py\", line 147, in <module>\n  File \"/tmp/ansible_os_server_volume_payload_Waz3Ge/__main__.py\", line 107, in main\nAttributeError: 'NoneType' object has no attribute 'id'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@Dannyb48
Copy link
Contributor Author

Dannyb48 commented Jun 4, 2019

@samvarankashyap Do you mind if I contribute a fix for this and #1137 some time this week?

@samvarankashyap
Copy link
Contributor

Hi, @Dannyb48 Thankyou for reporting the issue.
Since it is a very small fix are you willing to contribute a fix for the current issue? As we are a small team we are currently working with other issues which came up. It might take time by the time we try to fix this bug.
However, We highly encourage external contributors and try to merge their changes as soon as possible.
Please let me know if you are interested.
Thank you

@samvarankashyap samvarankashyap added this to the v1.7.6 milestone Jun 4, 2019
@Dannyb48
Copy link
Contributor Author

Dannyb48 commented Jun 4, 2019

Yeah that would great. Thanks

@Dannyb48
Copy link
Contributor Author

This is resolved by the MR #1160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants