Can't update cinder volume type is_public property

Bug #1533289 reported by Oleksii Chuprykov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Oleksii Chuprykov

Bug Description

Create the stack with the following template:
heat_template_version: 2013-05-23

resources:
        my_volume_type:
            type: OS::Cinder::VolumeType
            properties:
                name: volumeBackend
                metadata: {volume_backend_name: lvmdriver}
                projects:
                    - demo
                is_public: False

Then update stack to:
heat_template_version: 2013-05-23

resources:
        my_volume_type:
            type: OS::Cinder::VolumeType
            properties:
                name: volumeBackend
                metadata: {volume_backend_name: lvmdriver}
                is_public: True

You get the following error:
2016-01-12 18:27:42.259 TRACE heat.engine.resource Traceback (most recent call last):
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 626, in _action_recorder
2016-01-12 18:27:42.259 TRACE heat.engine.resource yield
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 697, in _do_action
2016-01-12 18:27:42.259 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
2016-01-12 18:27:42.259 TRACE heat.engine.resource step = next(subtask)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 668, in action_handler_task
2016-01-12 18:27:42.259 TRACE heat.engine.resource handler_data = handler(*args)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/cinder/volume_type.py", line 95, in handle_create
2016-01-12 18:27:42.259 TRACE heat.engine.resource volume_type = self.client().volume_types.create(**args)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/cinderclient/v2/volume_types.py", line 129, in create
2016-01-12 18:27:42.259 TRACE heat.engine.resource return self._create("/types", body, "volume_type")
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/cinderclient/base.py", line 299, in _create
2016-01-12 18:27:42.259 TRACE heat.engine.resource resp, body = self.api.client.post(url, body=body)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 315, in post
2016-01-12 18:27:42.259 TRACE heat.engine.resource return self._cs_request(url, 'POST', **kwargs)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 275, in _cs_request
2016-01-12 18:27:42.259 TRACE heat.engine.resource **kwargs)
2016-01-12 18:27:42.259 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 258, in request
2016-01-12 18:27:42.259 TRACE heat.engine.resource raise exceptions.from_response(resp, body)
2016-01-12 18:27:42.259 TRACE heat.engine.resource ClientException: Volume Type volumeBackend already exists. (HTTP 409) (Request-ID: req-223f80bb-aa8f-43d6-9a66-990284c43771)

Seems that we save this resource to backup stack and then try to create resource with the same name, but cinder volume types should have unique names.
Fortunately, cinder allows to update is_public field, so just make it updatable and this solves the problem.

Changed in heat:
assignee: nobody → Oleksii Chuprykov (ochuprykov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/266486

Changed in heat:
status: New → In Progress
Changed in heat:
milestone: none → mitaka-2
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/266486
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=c5aec2b980a43fdca2dd809b02f59801e6b5c76e
Submitter: Jenkins
Branch: master

commit c5aec2b980a43fdca2dd809b02f59801e6b5c76e
Author: Oleksii Chuprykov <email address hidden>
Date: Tue Jan 12 18:58:40 2016 +0200

    Make volume type is_public property updatable

    This actually updatable via cinder API.

    Closes-Bug: #1533289
    Change-Id: Ia9eaf5c90481bae49a9f291dcc53505cd8592799

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b2

This issue was fixed in the openstack/heat 6.0.0.0b2 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

This issue was fixed in the openstack/heat 6.0.0.0b2 development milestone.

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.