Cannot snapshot volumes with volume types

Bug #1836724 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cinderlib
Fix Released
Undecided
Rajat Dhasmana

Bug Description

When we try to create a snapshot from a volume that has a volume type we get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/geguileo/code/stack/cinderlib/cinderlib/objects.py", line 524, in create_snapshot
    snap.create()
  File "/home/geguileo/code/stack/cinderlib/cinderlib/objects.py", line 915, in create
    self.save()
  File "/home/geguileo/code/stack/cinderlib/cinderlib/objects.py", line 961, in save
    self.persistence.set_snapshot(self)
  File "/home/geguileo/code/stack/cinderlib/cinderlib/persistence/dbms.py", line 231, in set_snapshot
    changed = self.get_changed_fields(snapshot)
  File "/home/geguileo/code/stack/cinderlib/cinderlib/persistence/base.py", line 107, in get_changed_fields
    if ('qos_specs' in resource.volume_type._changed_fields and
  File "/home/geguileo/code/stack/cinderlib/cinderlib/objects.py", line 218, in __getattr__
    return getattr(self._ovo, name)
AttributeError: 'Snapshot' object has no attribute 'volume_type'

Changed in cinderlib:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Changed in cinderlib:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinderlib (master)

Reviewed: https://review.opendev.org/670887
Committed: https://git.openstack.org/cgit/openstack/cinderlib/commit/?id=d6bec909e0a4ab20ec8448f9521485f796d08370
Submitter: Zuul
Branch: master

commit d6bec909e0a4ab20ec8448f9521485f796d08370
Author: whoami-rajat <email address hidden>
Date: Mon Jul 15 22:41:49 2019 +0530

    Fix: Snapshot creation with volume types

    This patch corrects the functionality where a resource with
    'volume_type_id' field is assumed to have a 'volume_type' field
    which isn't the case for snapshots.
    This patch also adds minimal test coverage for get_changed_fields
    method.

    Closes-Bug: #1836724

    Change-Id: If7816bf3deb37c526b86b0baed500bebe637bd40

Changed in cinderlib:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinderlib 1.0.0

This issue was fixed in the openstack/cinderlib 1.0.0 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.