Inserting location does not insert the new location at the right place

Bug #1914531 reported by Cyril Roelandt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Won't Fix
Undecided
Unassigned

Bug Description

Hello!

I am providing a reproducer: http://paste.openstack.org/show/802308/ To run it:

1) Setup devstack
2) Install jq
3) Add these two lines in the DEFAULT section of glance-api.conf:

show_multiple_locations = True
show_image_direct_url = True

I know these options are deprecated, but I think using them allows us to see a potential bug.

$ bash reproducer.sh
[+] Creating an image with no locations
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2021-02-04T03:26:32Z |
| disk_format | qcow2 |
| id | eaeb5759-e41a-420c-9ef0-4707097eaf52 |
| locations | [] |
| min_disk | 0 |
| min_ram | 0 |
| name | test-img |
| os_hash_algo | None |
| os_hash_value | None |
| os_hidden | False |
| owner | f6372bed278b4d04a78084e86be60103 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2021-02-04T03:26:32Z |
| virtual_size | Not available |
| visibility | shared |
+------------------+--------------------------------------+
[+] Adding location at index 0 (https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz)
[
  {
    "url": "https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz",
    "metadata": {}
  }
]
[+] Adding location at index 0 (https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2)
[
  {
    "url": "https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2",
    "metadata": {}
  },
  {
    "url": "https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz",
    "metadata": {}
  }
]
[+] Showing locations
[
  {
    "url": "https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.raw.xz",
    "metadata": {}
  },
  {
    "url": "https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2",
    "metadata": {}
  }
]

Basically, the answers from the API look fine: first we add the .raw.xz image, and it's the only available location. Then we insert the .qcow2 image at position 0, and our 2 locations are in the right order. But then, when showing the image, it seems like the .raw.xz image comes first.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

We decided this was not a valid use case.

Changed in glance:
status: New → Invalid
status: Invalid → Won't Fix
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.