glance bootstrap error when try to create image with the same name

Bug #1923408 reported by hanchl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-helm
Triaged
Medium
Unassigned

Bug Description

Glance bootstrap.sh will create a new image when show error. When there are more than one images named as {{ .name }} foe example "cirros", the command 'openstack image show XXX' will get an non-zero return value. So it will create a new image has the same name. However It is not allowed to create a mirror with the same name when use Victoria. We will get an error like:

More than one Image exists with the name 'cirros'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python3.8/site-packages/osc_lib/command/command.py", line 39, in run
    return super(Command, self).run(parsed_args)
  File "/usr/local/lib/python3.8/site-packages/cliff/display.py", line 117, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/local/lib/python3.8/site-packages/openstackclient/image/v2/image.py", line 488, in take_action
    image = image_client.create_image(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/openstack/image/_base_proxy.py", line 157, in create_image
    current_image = self.find_image(name)
  File "/usr/local/lib/python3.8/site-packages/openstack/image/v2/_proxy.py", line 479, in find_image
    return self._find(_image.Image, name_or_id,
  File "/usr/local/lib/python3.8/site-packages/openstack/proxy.py", line 369, in _find
    return resource_type.find(self, name_or_id,
  File "/usr/local/lib/python3.8/site-packages/openstack/image/v2/image.py", line 336, in find
    result = super(Image, cls).find(session, name_or_id, True,
  File "/usr/local/lib/python3.8/site-packages/openstack/resource.py", line 1862, in find
    result = cls._get_one_match(name_or_id, data)
  File "/usr/local/lib/python3.8/site-packages/openstack/resource.py", line 1816, in _get_one_match
    raise exceptions.DuplicateResource(msg)
openstack.exceptions.DuplicateResource: More than one Image exists with the name 'cirros'.
clean_up CreateImage: More than one Image exists with the name 'cirros'.

Do we need to modify the script?

Gage Hugo (gagehugo)
Changed in openstack-helm:
importance: Undecided → Medium
status: New → Triaged
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.