)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"f1174c50e2a072a3792fb20f06024779134032ac","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d83d0721_b868eab8","updated":"2023-08-17 13:26:46.000000000","message":"This is a nasty bug.  Surprised it hasn\u0027t been discovered sooner.\n\nThe problem with this fix is that it makes it impossible to rename the default volume type.  I think there may be a different fix, which would provide a workaround:\n\n1. change this line to use get_by_name_or_id() instead of get_volume_type_by_name()\nhttps://opendev.org/openstack/cinder/src/commit/3b9cc13a94668018d8e0aec2dc997262c9c654a8/cinder/volume/volume_types.py#L233\n(probably have to change the exceptions listed in the \"except\" clause on the next line too)\n\nThe get_default_volume_type() function that contains L233 is the one that\u0027s called by the function in cinder/volume/flows/api/create_volume.py, which makes sure there\u0027s a volume_type populated for any volume-create request, so I think everything should continue to work fine:\nhttps://opendev.org/openstack/cinder/src/commit/3b9cc13a94668018d8e0aec2dc997262c9c654a8/cinder/volume/flows/api/create_volume.py#L431\n\n2. if you want to rename the type referred to by the default_volume_type setting, you must first edit your cinder.conf to use the volume_type.id instead of the name (we would update the help text to reflect this)\n\n(As far as i can tell, project-level-default-types use the id, so they don\u0027t have any problems.)\n\nThe bummer is that we can\u0027t put the volume_type.id in cinder.conf by default, because we don\u0027t know what it is until after the db has been installed/upgraded.  On the other hand, the fact that it\u0027s taken so long for someone to notice this indicates that it\u0027s not a widely performed operation, so maybe requiring editing the cinder.conf by hand in order to rename the default volume-type is OK.  (I guess we could add a cinder-manage command to do this? Haven\u0027t thought it through yet.)\n\nAnd the bigger bummer about my suggestion is that it invalidates a lot of your changes in this patch.  But I think we can keep the tests (after making adjustments) to give it a workout.","commit_id":"188be2e3351ff5be57f9ab9774cedf96a69063d4"}]}
