Raise 403 instead of 500 error from attach volume API
Currently, the libvirt driver has a limit on the maximum number of
disk devices allowed to attach to a single instance of 26. If a user
attempts to attach a volume which would make the total number of
attached disk devices > 26 for the instance, the user receives a
500 error from the API.
This adds a new exception type TooManyDiskDevices and raises it for the
"No free disk devices names" condition, instead of InternalError, and
handles it in the attach volume API. We raise TooManyDiskDevices
directly from the libvirt driver because InternalError is ambiguous and
can be raised for different error reasons within the same method call.
Reviewed: https:/ /review. openstack. org/632904 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=6489f2d2b44 827d133dad9a3bb 52436ee304a934
Committed: https:/
Submitter: Zuul
Branch: master
commit 6489f2d2b44827d 133dad9a3bb5243 6ee304a934
Author: melanie witt <email address hidden>
Date: Fri Jan 18 16:30:40 2019 +0000
Raise 403 instead of 500 error from attach volume API
Currently, the libvirt driver has a limit on the maximum number of
disk devices allowed to attach to a single instance of 26. If a user
attempts to attach a volume which would make the total number of
attached disk devices > 26 for the instance, the user receives a
500 error from the API.
This adds a new exception type TooManyDiskDevices and raises it for the
"No free disk devices names" condition, instead of InternalError, and
handles it in the attach volume API. We raise TooManyDiskDevices
directly from the libvirt driver because InternalError is ambiguous and
can be raised for different error reasons within the same method call.
Closes-Bug: #1770527
Change-Id: I1b08ed6826d7eb 41ecdfc7102e5e8 fcf3d1eb2e1