[magnum][pike] Image upload in playbook does not work

Bug #1778463 reported by Christian Zunker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Medium
Mohammed Naser

Bug Description

Hi,

os_magnum offers the variable magnum_glance_images to upload images during installation, but that does not work:
TASK [os_magnum : Upload images to Glance] **************************************************************************************************************************************************************************
Thursday 21 June 2018 06:18:41 +0000 (0:00:03.813) 0:01:05.583 *********
skipping: [ctrjnjd005_magnum_container-104b953d] => (item={u'name': u'fedora-atomic-28', u'checksum': u'sha256:3a6c4a036a5574db6ed32d887c65d140836e0df80912e751406e7cc113de3e26', u'disk_format': u'raw', u'file': u'https://dl04.fedoraproject.org/pub/alt/atomic/stable/Fedora-Atomic-28-20180613.1/AtomicHost/x86_64/images/Fedora-AtomicHost-28-20180613.1.x86_64.raw.xz', u'image_format': u'bare', u'public': True, u'distro': u'fedora-atomic'})
skipping: [ctrjnjd004_magnum_container-278ecd21] => (item={u'name': u'fedora-atomic-28', u'checksum': u'sha256:3a6c4a036a5574db6ed32d887c65d140836e0df80912e751406e7cc113de3e26', u'disk_format': u'raw', u'file': u'https://dl04.fedoraproject.org/pub/alt/atomic/stable/Fedora-Atomic-28-20180613.1/AtomicHost/x86_64/images/Fedora-AtomicHost-28-20180613.1.x86_64.raw.xz', u'image_format': u'bare', u'public': True, u'distro': u'fedora-atomic'})
skipping: [ctrjnjd005_magnum_container-104b953d] => (item={u'name': u'coreos-1745.7.0', u'checksum': u'sha512:c376c94763de01501ae7c990a1d8a630ccf3f582bcedbc2fd1b6d253128255d6adff7209fca9efb36b7b0b398f89f24df350e342bc9f4b8a1d1a4ed019adf1c1', u'disk_format': u'qcow2', u'file': u'https://stable.release.core-os.net/amd64-usr/1745.7.0/coreos_production_openstack_image.img.bz2', u'image_format': u'bare', u'public': True, u'distro': u'coreos'})
skipping: [ctrjnjd004_magnum_container-278ecd21] => (item={u'name': u'coreos-1745.7.0', u'checksum': u'sha512:c376c94763de01501ae7c990a1d8a630ccf3f582bcedbc2fd1b6d253128255d6adff7209fca9efb36b7b0b398f89f24df350e342bc9f4b8a1d1a4ed019adf1c1', u'disk_format': u'qcow2', u'file': u'https://stable.release.core-os.net/amd64-usr/1745.7.0/coreos_production_openstack_image.img.bz2', u'image_format': u'bare', u'public': True, u'distro': u'coreos'})
failed: [ctrjnjd006_magnum_container-56f72d05] (item={u'name': u'fedora-atomic-28', u'checksum': u'sha256:3a6c4a036a5574db6ed32d887c65d140836e0df80912e751406e7cc113de3e26', u'disk_format': u'raw', u'file': u'https://dl04.fedoraproject.org/pub/alt/atomic/stable/Fedora-Atomic-28-20180613.1/AtomicHost/x86_64/images/Fedora-AtomicHost-28-20180613.1.x86_64.raw.xz', u'image_format': u'bare', u'public': True, u'distro': u'fedora-atomic'}) => {"failed": true, "item": {"checksum": "sha256:3a6c4a036a5574db6ed32d887c65d140836e0df80912e751406e7cc113de3e26", "disk_format": "raw", "distro": "fedora-atomic", "file": "https://dl04.fedoraproject.org/pub/alt/atomic/stable/Fedora-Atomic-28-20180613.1/AtomicHost/x86_64/images/Fedora-AtomicHost-28-20180613.1.x86_64.raw.xz", "image_format": "bare", "name": "fedora-atomic-28", "public": true}, "module_stderr": "mesg: ttyname failed: Inappropriate ioctl for device\nTraceback (most recent call last):\n File \"/tmp/ansible_euqzHH/ansible_module_os_image.py\", line 202, in <module>\n main()\n File \"/tmp/ansible_euqzHH/ansible_module_os_image.py\", line 153, in main\n cloud = shade.openstack_cloud(**module.params)\n File \"/usr/local/lib/python2.7/dist-packages/shade/__init__.py\", line 109, in openstack_cloud\n cloud_config = config.get_one_cloud(**kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/os_client_config/config.py\", line 1041, in get_one_cloud\n config = self._get_base_cloud_config(cloud)\n File \"/usr/local/lib/python2.7/dist-packages/os_client_config/config.py\", line 460, in _get_base_cloud_config\n name=name))\nos_client_config.exceptions.OpenStackConfigException: Cloud default was not found.\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

The task in os_magnum depends on the /etc/openstack/clouds.yaml file which isn't present when the task is executed.

I think the problem is the role order in the os-magnum-install playbook:
  roles:
    - role: "os_magnum"
    - role: "openstack_openrc"
      tags:
        - openrc

The file /etc/openstack/clouds.yaml is generated by openstack_openrc, which is executed after magnum.

Queens has the same problem. master branch is missing openstack_openrc completely. I currently don't know how it is handled there.

Revision history for this message
Mohammed Naser (mnaser) wrote :

fixed in master already: https://review.openstack.org/#/c/543256/
backport will be merging soon: https://review.openstack.org/#/c/578147/

expect it to be fixed in the next release :)

Changed in openstack-ansible:
assignee: nobody → Mohammed Naser (mnaser)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Christian Zunker (christian-zunker) wrote :

Hadn't found these. Nice.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/queens)

Reviewed: https://review.openstack.org/578147
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=bde7b4119a013c5de6ab0802f6a5a65bf65680ef
Submitter: Zuul
Branch: stable/queens

commit bde7b4119a013c5de6ab0802f6a5a65bf65680ef
Author: Mohammed Naser <email address hidden>
Date: Sun Feb 11 16:12:37 2018 -0500

    Run openstack_openrc before Magnum installation

    The Magnum role attempts to upload images for the operation of
    Magnum, however, the role for openrc is installed after magnum
    which means the role cannot use the 'default' cloud profile
    to upload images.

    This patch adjusts the order so that the os_magnum role is able
    to upload images.

    Closes-Bug: #1778463
    Change-Id: I10846e5844c2f02c1a5450eaa950b3704672c324
    (cherry picked from commit 1fd26bc0e841a8cf65715f6236eef53bed4ed71a)

tags: added: in-stable-queens
Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 17.0.6

This issue was fixed in the openstack/openstack-ansible 17.0.6 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.