glance_image keeps trying to update an image from location causing an error

Bug #1471364 reported by Matt Fischer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-glance
Invalid
Undecided
Unassigned

Bug Description

I have a very basic glance image that puppet sets up. Every time puppet runs now, it attempts to run image-update on the image, I think to set location based on the error. This is not a valid operation, in addition it's wasteful to update this every 30 minutes.

  $cirros_version = '0.3.4'
  glance_image { 'cirros':
    location => "https://download.cirros-cloud.net/${cirros_version}/cirros-${cirros_version}-x86_64-disk.img",
    name => "Cirros ${cirros_version}",
    is_public => 'Yes',
    container_format => 'bare',
    disk_format => 'qcow2',
  }

Debug: Executing '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-list'
Debug: Executing '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-show 888479c0-3d7e-4f60-932c-f040de9b168b'
Debug: Executing '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-update 888479c0-3d7e-4f60-932c-f040de9b168b --location=https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img'
Debug: Executing '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-update 888479c0-3d7e-4f60-932c-f040de9b168b --location=https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img'
Error: Execution of '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-update 888479c0-3d7e-4f60-932c-f040de9b168b --location=https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img' returned 1: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Attempted to update Location field for an image not in queued status.<br /><br />

 </body>
</html> (HTTP 400)

Error: /Stage[main]/Deployments::Profile::Glance/Glance_image[cirros]/location: change from absent to https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img failed: Execution of '/usr/bin/glance --os-tenant-name services --os-username glance --os-password service_user_pass --os-region-name RegionOne --os-auth-url http://127.0.0.1:35357/v2.0/ image-update 888479c0-3d7e-4f60-932c-f040de9b168b --location=https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img' returned 1: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Attempted to update Location field for an image not in queued status.<br /><br />

 </body>
</html> (HTTP 400)

Revision history for this message
Emilien Macchi (emilienm) wrote :

Can you try again with latest version of the module ? ie stable/kilo.

Changed in puppet-glance:
status: New → Triaged
Revision history for this message
Matt Fischer (mfisch) wrote :

The solution here is to use SOURCE not LOCATION. This bug is invalid.

Changed in puppet-glance:
status: Triaged → Invalid
Revision history for this message
Murali Krishna Marimekala (murali-marimekala) wrote :

Hi Matt, could you please explain the solution in detail. Where exactly we need to SOURCE instead of LOCATION.

Do you mean below change ? Please clarify

----
  $cirros_version = '0.3.4'
  glance_image { 'cirros':
    source => "https://download.cirros-cloud.net/${cirros_version}/cirros-${cirros_version}-x86_64-disk.img",
    name => "Cirros ${cirros_version}",
    is_public => 'Yes',
    container_format => 'bare',
    disk_format => 'qcow2',
  }
---

Revision history for this message
Matt Fischer (mfisch) wrote :

Yes, like that.

  glance_image { 'cirros':
    location => "https://download.cirros-cloud.net/${cirros_version}/cirros-${cirros_version}-x86_64-disk.img",
    name => "Cirros ${cirros_version}",
    is_public => 'Yes',
    container_format => 'bare',
    disk_format => 'qcow2',
  }

Revision history for this message
Matt Fischer (mfisch) wrote :

Actually I take that back, location also works.

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.