Coverage for nova/exception.py: 99%
1157 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-04-24 11:16 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-04-24 11:16 +0000
1# Copyright 2010 United States Government as represented by the
2# Administrator of the National Aeronautics and Space Administration.
3# All Rights Reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
17"""Nova base exception handling.
19Includes decorator for re-raising Nova-type exceptions.
21SHOULD include dedicated exception logging.
23"""
25from oslo_log import log as logging
27import webob.exc
28from webob import util as woutil
30from nova.i18n import _
32LOG = logging.getLogger(__name__)
35class ConvertedException(webob.exc.WSGIHTTPException):
36 def __init__(self, code, title="", explanation=""):
37 self.code = code
38 # There is a strict rule about constructing status line for HTTP:
39 # '...Status-Line, consisting of the protocol version followed by a
40 # numeric status code and its associated textual phrase, with each
41 # element separated by SP characters'
42 # (http://www.faqs.org/rfcs/rfc2616.html)
43 # 'code' and 'title' can not be empty because they correspond
44 # to numeric status code and its associated text
45 if title:
46 self.title = title
47 else:
48 try:
49 self.title = woutil.status_reasons[self.code]
50 except KeyError:
51 msg = "Improper or unknown HTTP status code used: %d"
52 LOG.error(msg, code)
53 self.title = woutil.status_generic_reasons[self.code // 100]
54 self.explanation = explanation
55 super(ConvertedException, self).__init__()
58class NovaException(Exception):
59 """Base Nova Exception
61 To correctly use this class, inherit from it and define
62 a 'msg_fmt' property. That msg_fmt will get printf'd
63 with the keyword arguments provided to the constructor.
65 """
66 msg_fmt = _("An unknown exception occurred.")
67 code = 500
68 headers = {}
69 safe = False
71 def __init__(self, message=None, **kwargs):
72 self.kwargs = kwargs
74 if 'code' not in self.kwargs:
75 try:
76 self.kwargs['code'] = self.code
77 except AttributeError:
78 pass
80 try:
81 if not message:
82 message = self.msg_fmt % kwargs
83 else:
84 message = str(message)
85 except Exception:
86 # NOTE(melwitt): This is done in a separate method so it can be
87 # monkey-patched during testing to make it a hard failure.
88 self._log_exception()
89 message = self.msg_fmt
91 self.message = message
92 super(NovaException, self).__init__(message)
94 def _log_exception(self):
95 # kwargs doesn't match a variable in the message
96 # log the issue and the kwargs
97 LOG.exception('Exception in string format operation')
98 for name, value in self.kwargs.items():
99 LOG.error("%s: %s" % (name, value)) # noqa
101 def format_message(self):
102 # NOTE(mrodden): use the first argument to the python Exception object
103 # which should be our full NovaException message, (see __init__)
104 return self.args[0]
106 def __repr__(self):
107 dict_repr = self.__dict__
108 dict_repr['class'] = self.__class__.__name__
109 return str(dict_repr)
112class EncryptionFailure(NovaException):
113 msg_fmt = _("Failed to encrypt text: %(reason)s")
116class VirtualInterfaceCreateException(NovaException):
117 msg_fmt = _("Virtual Interface creation failed")
120class VirtualInterfaceMacAddressException(NovaException):
121 msg_fmt = _("Creation of virtual interface with "
122 "unique mac address failed")
125class VirtualInterfacePlugException(NovaException):
126 msg_fmt = _("Virtual interface plugin failed")
129class VirtualInterfaceUnplugException(NovaException):
130 msg_fmt = _("Failed to unplug virtual interface: %(reason)s")
133class GlanceConnectionFailed(NovaException):
134 msg_fmt = _("Connection to glance host %(server)s failed: "
135 "%(reason)s")
138class KeystoneConnectionFailed(NovaException):
139 msg_fmt = _("Connection to keystone host failed: %(reason)s")
142class CinderConnectionFailed(NovaException):
143 msg_fmt = _("Connection to cinder host failed: %(reason)s")
146class ManilaConnectionFailed(NovaException):
147 msg_fmt = _("Connection to manila service failed: %(reason)s")
150class UnsupportedCinderAPIVersion(NovaException):
151 msg_fmt = _('Nova does not support Cinder API version %(version)s')
154class CinderAPIVersionNotAvailable(NovaException):
155 """Used to indicate that a requested Cinder API version, generally a
156 microversion, is not available.
157 """
158 msg_fmt = _('Cinder API version %(version)s is not available.')
161class Forbidden(NovaException):
162 msg_fmt = _("Forbidden")
163 code = 403
166class NotSupported(NovaException):
167 # This exception use return code as 400 and can be used
168 # directly or as base exception for operations which are not
169 # supported in Nova. Any feature that is not yet implemented
170 # but plan to implement in future (example: Cyborg
171 # integration operations), should use this exception as base
172 # and override the msg_fmt with feature details.
173 # Example: MultiattachNotSupportedByVirtDriver exception.
174 msg_fmt = _("Bad Request - Feature is not supported in Nova")
175 code = 400
178class ForbiddenWithAccelerators(NotSupported):
179 msg_fmt = _("Feature not supported with instances that have accelerators.")
182class ForbiddenSharesNotSupported(NotSupported):
183 msg_fmt = _("Feature not supported until computes have not been updated.")
186class ForbiddenSharesNotConfiguredCorrectly(NotSupported):
187 msg_fmt = _("Feature not supported because either compute or instance "
188 "are not configured correctly.")
191class ForbiddenWithShare(NotSupported):
192 msg_fmt = _("Feature not supported with instances that have shares.")
195class ForbiddenPortsWithAccelerator(NotSupported):
196 msg_fmt = _("Feature not supported with Ports that have accelerators.")
199class ForbiddenWithRemoteManagedPorts(NotSupported):
200 msg_fmt = _("This feature is not supported when remote-managed ports"
201 " are in use.")
204class AdminRequired(Forbidden):
205 msg_fmt = _("User does not have admin privileges")
208class PolicyNotAuthorized(Forbidden):
209 msg_fmt = _("Policy doesn't allow %(action)s to be performed.")
212class ImageNotActive(NovaException):
213 # NOTE(jruzicka): IncorrectState is used for volumes only in EC2,
214 # but it still seems like the most appropriate option.
215 msg_fmt = _("Image %(image_id)s is not active.")
218class ImageNotAuthorized(NovaException):
219 msg_fmt = _("Not authorized for image %(image_id)s.")
222class Invalid(NovaException):
223 msg_fmt = _("Bad Request - Invalid Parameters")
224 code = 400
227class InvalidVIOMMUMachineType(Invalid):
228 msg_fmt = _("vIOMMU is not supported by Current machine type %(mtype)s "
229 "(Architecture: %(arch)s).")
232class InvalidVIOMMUArchitecture(Invalid):
233 msg_fmt = _("vIOMMU required either x86 or AArch64 architecture, "
234 "but given architecture %(arch)s.")
237class InstanceQuiesceFailed(Invalid):
238 msg_fmt = _("Failed to quiesce instance: %(reason)s")
239 code = 409
242class InvalidConfiguration(Invalid):
243 msg_fmt = _("Configuration is Invalid.")
246class InvalidBDM(Invalid):
247 msg_fmt = _("Block Device Mapping is Invalid.")
250class InvalidBDMSnapshot(InvalidBDM):
251 msg_fmt = _("Block Device Mapping is Invalid: "
252 "failed to get snapshot %(id)s.")
255class InvalidBDMVolume(InvalidBDM):
256 msg_fmt = _("Block Device Mapping is Invalid: "
257 "failed to get volume %(id)s.")
260class InvalidBDMImage(InvalidBDM):
261 msg_fmt = _("Block Device Mapping is Invalid: "
262 "failed to get image %(id)s.")
265class InvalidBDMBootSequence(InvalidBDM):
266 msg_fmt = _("Block Device Mapping is Invalid: "
267 "Boot sequence for the instance "
268 "and image/block device mapping "
269 "combination is not valid.")
272class InvalidBDMLocalsLimit(InvalidBDM):
273 msg_fmt = _("Block Device Mapping is Invalid: "
274 "You specified more local devices than the "
275 "limit allows")
278class InvalidBDMEphemeralSize(InvalidBDM):
279 msg_fmt = _("Ephemeral disks requested are larger than "
280 "the instance type allows. If no size is given "
281 "in one block device mapping, flavor ephemeral "
282 "size will be used.")
285class InvalidBDMSwapSize(InvalidBDM):
286 msg_fmt = _("Swap drive requested is larger than instance type allows.")
289class InvalidBDMFormat(InvalidBDM):
290 msg_fmt = _("Block Device Mapping is Invalid: "
291 "%(details)s")
294class InvalidBDMForLegacy(InvalidBDM):
295 msg_fmt = _("Block Device Mapping cannot "
296 "be converted to legacy format. ")
299class InvalidBDMVolumeNotBootable(InvalidBDM):
300 msg_fmt = _("Block Device %(id)s is not bootable.")
303class TooManyDiskDevices(InvalidBDM):
304 msg_fmt = _('The maximum allowed number of disk devices (%(maximum)d) to '
305 'attach to a single instance has been exceeded.')
306 code = 403
309class InvalidBDMDiskBus(InvalidBDM):
310 msg_fmr = _("Block Device Mapping is invalid: The provided disk bus "
311 "%(disk_bus)s is not valid.")
314class InvalidAttribute(Invalid):
315 msg_fmt = _("Attribute not supported: %(attr)s")
318class ValidationError(Invalid):
319 msg_fmt = "%(detail)s"
322class VolumeAttachFailed(Invalid):
323 msg_fmt = _("Volume %(volume_id)s could not be attached. "
324 "Reason: %(reason)s")
327class VolumeDetachFailed(Invalid):
328 msg_fmt = _("Volume %(volume_id)s could not be detached. "
329 "Reason: %(reason)s")
332class VolumeExtendFailed(Invalid):
333 msg_fmt = _("Volume %(volume_id)s could not be extended. "
334 "Reason: %(reason)s")
337class MultiattachNotSupportedByVirtDriver(NotSupported):
338 # This exception indicates the compute hosting the instance does not
339 # support multiattach volumes. This should generally be considered a
340 # 400 HTTPBadRequest error in the API since we expect all virt drivers to
341 # eventually support multiattach volumes.
342 msg_fmt = _("Volume %(volume_id)s has 'multiattach' set, "
343 "which is not supported for this instance.")
346class MultiattachNotSupportedOldMicroversion(Invalid):
347 msg_fmt = _('Multiattach volumes are only supported starting with '
348 'compute API version 2.60.')
351class MultiattachToShelvedNotSupported(Invalid):
352 msg_fmt = _("Attaching multiattach volumes is not supported for "
353 "shelved-offloaded instances.")
356class MultiattachSwapVolumeNotSupported(Invalid):
357 msg_fmt = _('Swapping multi-attach volumes with more than one read/write '
358 'attachment is not supported.')
361class VolumeNotCreated(NovaException):
362 msg_fmt = _("Volume %(volume_id)s did not finish being created"
363 " even after we waited %(seconds)s seconds or %(attempts)s"
364 " attempts. And its status is %(volume_status)s.")
367class ExtendVolumeNotSupported(Invalid):
368 msg_fmt = _("Volume size extension is not supported by the hypervisor.")
371class VolumeEncryptionNotSupported(Invalid):
372 msg_fmt = _("Volume encryption is not supported for %(volume_type)s "
373 "volume %(volume_id)s")
376class VolumeTaggedAttachNotSupported(Invalid):
377 msg_fmt = _("Tagged volume attachment is not supported for this server "
378 "instance.")
381class VolumeTaggedAttachToShelvedNotSupported(VolumeTaggedAttachNotSupported):
382 msg_fmt = _("Tagged volume attachment is not supported for "
383 "shelved-offloaded instances.")
386class NetworkInterfaceTaggedAttachNotSupported(Invalid):
387 msg_fmt = _("Tagged network interface attachment is not supported for "
388 "this server instance.")
391class InvalidKeypair(Invalid):
392 msg_fmt = _("Keypair data is invalid: %(reason)s")
395class InvalidRequest(Invalid):
396 msg_fmt = _("The request is invalid.")
399class InvalidInput(Invalid):
400 msg_fmt = _("Invalid input received: %(reason)s")
403class InvalidVolume(Invalid):
404 msg_fmt = _("Invalid volume: %(reason)s")
407class InvalidVolumeAccessMode(Invalid):
408 msg_fmt = _("Invalid volume access mode: %(access_mode)s")
411class StaleVolumeMount(InvalidVolume):
412 msg_fmt = _("The volume mount at %(mount_path)s is unusable.")
415class InvalidMetadata(Invalid):
416 msg_fmt = _("Invalid metadata: %(reason)s")
419class InvalidMetadataSize(Invalid):
420 msg_fmt = _("Invalid metadata size: %(reason)s")
423class InvalidPortRange(Invalid):
424 msg_fmt = _("Invalid port range %(from_port)s:%(to_port)s. %(msg)s")
427class InvalidIpProtocol(Invalid):
428 msg_fmt = _("Invalid IP protocol %(protocol)s.")
431class InvalidContentType(Invalid):
432 msg_fmt = _("Invalid content type %(content_type)s.")
435class InvalidAPIVersionString(Invalid):
436 msg_fmt = _("API Version String %(version)s is of invalid format. Must "
437 "be of format MajorNum.MinorNum.")
440class VersionNotFoundForAPIMethod(Invalid):
441 msg_fmt = _("API version %(version)s is not supported on this method.")
444class InvalidGlobalAPIVersion(Invalid):
445 msg_fmt = _("Version %(req_ver)s is not supported by the API. Minimum "
446 "is %(min_ver)s and maximum is %(max_ver)s.")
449class ApiVersionsIntersect(Invalid):
450 msg_fmt = _("Version of %(name)s %(min_ver)s %(max_ver)s intersects "
451 "with another versions.")
454# Cannot be templated as the error syntax varies.
455# msg needs to be constructed when raised.
456class InvalidParameterValue(Invalid):
457 msg_fmt = "%(err)s"
460class InvalidAggregateAction(Invalid):
461 msg_fmt = _("Unacceptable parameters.")
462 code = 400
465class InvalidAggregateActionAdd(InvalidAggregateAction):
466 msg_fmt = _("Cannot add host to aggregate "
467 "%(aggregate_id)s. Reason: %(reason)s.")
470class InvalidAggregateActionDelete(InvalidAggregateAction):
471 msg_fmt = _("Cannot remove host from aggregate "
472 "%(aggregate_id)s. Reason: %(reason)s.")
475class InvalidAggregateActionUpdate(InvalidAggregateAction):
476 msg_fmt = _("Cannot update aggregate "
477 "%(aggregate_id)s. Reason: %(reason)s.")
480class InvalidAggregateActionUpdateMeta(InvalidAggregateAction):
481 msg_fmt = _("Cannot update metadata of aggregate "
482 "%(aggregate_id)s. Reason: %(reason)s.")
485class AggregateMetadataKeyExists(NovaException):
486 msg_fmt = _("Aggregate %(aggregate_id)s already contain metadata "
487 "key %(key)s.")
488 code = 400
491class InvalidSortKey(Invalid):
492 msg_fmt = _("Sort key supplied was not valid.")
495class InvalidStrTime(Invalid):
496 msg_fmt = _("Invalid datetime string: %(reason)s")
499class InvalidNUMANodesNumber(Invalid):
500 msg_fmt = _("The property 'numa_nodes' cannot be '%(nodes)s'. "
501 "It must be a number greater than 0")
504class InvalidName(Invalid):
505 msg_fmt = _("An invalid 'name' value was provided. "
506 "The name must be: %(reason)s")
509class InstanceInvalidState(Invalid):
510 msg_fmt = _("Instance %(instance_uuid)s in %(attr)s %(state)s. Cannot "
511 "%(method)s while the instance is in this state.")
514class InstanceNotRunning(Invalid):
515 msg_fmt = _("Instance %(instance_id)s is not running.")
518class InstanceNotInRescueMode(Invalid):
519 msg_fmt = _("Instance %(instance_id)s is not in rescue mode")
522class InstanceNotRescuable(Invalid):
523 msg_fmt = _("Instance %(instance_id)s cannot be rescued: %(reason)s")
526class InstanceNotReady(Invalid):
527 msg_fmt = _("Instance %(instance_id)s is not ready")
530class InstanceSuspendFailure(Invalid):
531 msg_fmt = _("Failed to suspend instance: %(reason)s")
534class InstanceResumeFailure(Invalid):
535 msg_fmt = _("Failed to resume instance: %(reason)s")
538class InstancePowerOnFailure(Invalid):
539 msg_fmt = _("Failed to power on instance: %(reason)s")
542class InstancePowerOffFailure(Invalid):
543 msg_fmt = _("Failed to power off instance: %(reason)s")
546class InstanceRebootFailure(Invalid):
547 msg_fmt = _("Failed to reboot instance: %(reason)s")
550class InstanceTerminationFailure(Invalid):
551 msg_fmt = _("Failed to terminate instance: %(reason)s")
554class InstanceDeployFailure(Invalid):
555 msg_fmt = _("Failed to deploy instance: %(reason)s")
558class MultiplePortsNotApplicable(Invalid):
559 msg_fmt = _("Failed to launch instances: %(reason)s")
562class AmbiguousHostnameForMultipleInstances(Invalid):
563 msg_fmt = _("Unable to allocate a single hostname to multiple instances")
566class InvalidFixedIpAndMaxCountRequest(Invalid):
567 msg_fmt = _("Failed to launch instances: %(reason)s")
570class ServiceUnavailable(Invalid):
571 msg_fmt = _("Service is unavailable at this time.")
574class ServiceNotUnique(Invalid):
575 msg_fmt = _("More than one possible service found.")
578class ComputeResourcesUnavailable(ServiceUnavailable):
579 msg_fmt = _("Insufficient compute resources: %(reason)s.")
582class HypervisorUnavailable(NovaException):
583 msg_fmt = _("Connection to the hypervisor is broken on host")
586class ComputeServiceUnavailable(ServiceUnavailable):
587 msg_fmt = _("Compute service of %(host)s is unavailable at this time.")
590class ComputeServiceInUse(NovaException):
591 msg_fmt = _("Compute service of %(host)s is still in use.")
594class UnableToMigrateToSelf(Invalid):
595 msg_fmt = _("Unable to migrate instance (%(instance_id)s) "
596 "to current host (%(host)s).")
599class OperationNotSupportedForSEV(NotSupported):
600 msg_fmt = _("Operation '%(operation)s' not supported for SEV-enabled "
601 "instance (%(instance_uuid)s).")
604class OperationNotSupportedForVTPM(NotSupported):
605 msg_fmt = _("Operation '%(operation)s' not supported for vTPM-enabled "
606 "instance (%(instance_uuid)s).")
609class OperationNotSupportedForVDPAInterface(NotSupported):
610 msg_fmt = _(
611 "Operation '%(operation)s' not supported for instance with "
612 "vDPA ports ((instance_uuid)s)."
613 )
616class InvalidHypervisorType(Invalid):
617 msg_fmt = _("The supplied hypervisor type of is invalid.")
620class HypervisorTooOld(Invalid):
621 msg_fmt = _("This compute node's hypervisor is older than the minimum "
622 "supported version: %(version)s.")
625class DestinationHypervisorTooOld(Invalid):
626 msg_fmt = _("The instance requires a newer hypervisor version than "
627 "has been provided.")
630class ServiceTooOld(Invalid):
631 msg_fmt = _("This service is older (v%(thisver)i) than the minimum "
632 "(v%(minver)i) version of the rest of the deployment. "
633 "Unable to continue.")
636class TooOldComputeService(Invalid):
637 msg_fmt = _("Current Nova version does not support computes older than "
638 "%(oldest_supported_version)s but the minimum compute service "
639 "level in your %(scope)s is %(min_service_level)d and the "
640 "oldest supported service level is "
641 "%(oldest_supported_service)d.")
644class DestinationDiskExists(Invalid):
645 msg_fmt = _("The supplied disk path (%(path)s) already exists, "
646 "it is expected not to exist.")
649class InvalidDevicePath(Invalid):
650 msg_fmt = _("The supplied device path (%(path)s) is invalid.")
653class DevicePathInUse(Invalid):
654 msg_fmt = _("The supplied device path (%(path)s) is in use.")
655 code = 409
658class InvalidCPUInfo(Invalid):
659 msg_fmt = _("Unacceptable CPU info: %(reason)s")
662class InvalidIpAddressError(Invalid):
663 msg_fmt = _("%(address)s is not a valid IP v4/6 address.")
666class InvalidDiskFormat(Invalid):
667 msg_fmt = _("Disk format %(disk_format)s is not acceptable")
670class InvalidDiskInfo(Invalid):
671 msg_fmt = _("Disk info file is invalid: %(reason)s")
674class DiskInfoReadWriteFail(Invalid):
675 msg_fmt = _("Failed to read or write disk info file: %(reason)s")
678class ImageUnacceptable(Invalid):
679 msg_fmt = _("Image %(image_id)s is unacceptable: %(reason)s")
682class ImageBadRequest(Invalid):
683 msg_fmt = _("Request of image %(image_id)s got BadRequest response: "
684 "%(response)s")
687class ImageImportImpossible(Invalid):
688 msg_fmt = _("Import of image %(image_id)s refused: %(reason)s")
691class ImageQuotaExceeded(NovaException):
692 msg_fmt = _("Quota exceeded or out of space for image %(image_id)s "
693 "in the image service.")
696class InstanceUnacceptable(Invalid):
697 msg_fmt = _("Instance %(instance_id)s is unacceptable: %(reason)s")
700class InvalidUUID(Invalid):
701 msg_fmt = _("Expected a uuid but received %(uuid)s.")
704class InvalidID(Invalid):
705 msg_fmt = _("Invalid ID received %(id)s.")
708class ConstraintNotMet(NovaException):
709 msg_fmt = _("Constraint not met.")
710 code = 412
713class NotFound(NovaException):
714 msg_fmt = _("Resource could not be found.")
715 code = 404
718class VolumeAttachmentNotFound(NotFound):
719 msg_fmt = _("Volume attachment %(attachment_id)s could not be found.")
722class VolumeNotFound(NotFound):
723 msg_fmt = _("Volume %(volume_id)s could not be found.")
726class ShareNotFound(NotFound):
727 msg_fmt = _("Share %(share_id)s could not be found.")
730class ShareStatusIncorect(NotFound):
731 msg_fmt = _("Share %(share_id)s is in '%(status)s' instead of "
732 "'available' status.")
735class ShareMappingAlreadyExists(NotFound):
736 msg_fmt = _("Share '%(share_id)s' or tag '%(tag)s' already associated "
737 "to this server.")
740class ShareProtocolNotSupported(NotFound):
741 msg_fmt = _("Share protocol %(share_proto)s is not supported.")
744class ShareMissingExportLocation(NotFound):
745 msg_fmt = _("Share %(share_id)s export location is missing.")
748class ShareError(NovaException):
749 msg_fmt = _("Share %(share_id)s used by instance %(instance_uuid)s "
750 "is in error state.")
753class ShareErrorUnexpectedStatus(NovaException):
754 msg_fmt = _("Share %(share_id)s used by instance %(instance_uuid)s "
755 "is in an unexpected state.")
758class ShareUmountError(NovaException):
759 msg_fmt = _("Share id %(share_id)s umount error "
760 "from server %(server_id)s.\n"
761 "Reason: %(reason)s.")
764class ShareMountError(NovaException):
765 msg_fmt = _("Share id %(share_id)s mount error "
766 "from server %(server_id)s.\n"
767 "Reason: %(reason)s.")
770class ShareAccessNotFound(NotFound):
771 msg_fmt = _("Share access from Manila could not be found for "
772 "share id %(share_id)s.")
775class ShareAccessGrantError(NovaException):
776 msg_fmt = _("Share access could not be granted to "
777 "share id %(share_id)s.\n"
778 "Reason: %(reason)s.")
781class ShareAccessRemovalError(NovaException):
782 msg_fmt = _("Share access could not be removed from "
783 "share id %(share_id)s.\n"
784 "Reason: %(reason)s.")
787class ShareLockNotFound(NovaException):
788 msg_fmt = _("Share lock can not be found for "
789 "share id %(share_id)s.\n")
792class ShareLockError(NovaException):
793 msg_fmt = _("Share lock can not be acquired from "
794 "share id %(share_id)s.\n"
795 "Reason: %(reason)s.")
798class ShareLockAlreadyExists(NovaException):
799 msg_fmt = _("Share lock can not be acquired from "
800 "share id %(share_id)s.\n"
801 "Reason: lock already exists.")
804class ShareUnlockError(NovaException):
805 msg_fmt = _("Share can not be unlocked from "
806 "share id %(share_id)s.\n"
807 "Reason: %(reason)s.")
810class VolumeTypeNotFound(NotFound):
811 msg_fmt = _("Volume type %(id_or_name)s could not be found.")
814class UndefinedRootBDM(NovaException):
815 msg_fmt = _("Undefined Block Device Mapping root: BlockDeviceMappingList "
816 "contains Block Device Mappings from multiple instances.")
819class BDMNotFound(NotFound):
820 msg_fmt = _("No Block Device Mapping with id %(id)s.")
823class VolumeBDMNotFound(NotFound):
824 msg_fmt = _("No volume Block Device Mapping with id %(volume_id)s.")
827class VolumeBDMIsMultiAttach(Invalid):
828 msg_fmt = _("Block Device Mapping %(volume_id)s is a multi-attach volume"
829 " and is not valid for this operation.")
832class VolumeBDMPathNotFound(VolumeBDMNotFound):
833 msg_fmt = _("No volume Block Device Mapping at path: %(path)s")
836class DeviceDetachFailed(NovaException):
837 msg_fmt = _("Device detach failed for %(device)s: %(reason)s")
840class DeviceNotFound(NotFound):
841 msg_fmt = _("Device '%(device)s' not found.")
844class SnapshotNotFound(NotFound):
845 msg_fmt = _("Snapshot %(snapshot_id)s could not be found.")
848class DiskNotFound(NotFound):
849 msg_fmt = _("No disk at %(location)s")
852class VolumeDriverNotFound(NotFound):
853 msg_fmt = _("Could not find a handler for %(driver_type)s volume.")
856class VolumeDriverNotSupported(VolumeDriverNotFound):
857 msg_fmt = _("The %(volume_driver)s volume driver is not supported on this "
858 "platform.")
861class InvalidImageRef(Invalid):
862 msg_fmt = _("Invalid image href %(image_href)s.")
865class InvalidImagePropertyName(Invalid):
866 msg_fmt = _("Invalid image property name %(image_property_name)s.")
869class AutoDiskConfigDisabledByImage(Invalid):
870 msg_fmt = _("Requested image %(image)s "
871 "has automatic disk resize disabled.")
874class ImageNotFound(NotFound):
875 msg_fmt = _("Image %(image_id)s could not be found.")
878class ImageDeleteConflict(NovaException):
879 msg_fmt = _("Conflict deleting image. Reason: %(reason)s.")
882class PreserveEphemeralNotSupported(Invalid):
883 msg_fmt = _("The current driver does not support "
884 "preserving ephemeral partitions.")
887class InstanceMappingNotFound(NotFound):
888 msg_fmt = _("Instance %(uuid)s has no mapping to a cell.")
891class InvalidCidr(Invalid):
892 msg_fmt = _("%(cidr)s is not a valid IP network.")
895class NetworkNotFound(NotFound):
896 msg_fmt = _("Network %(network_id)s could not be found.")
899class PortNotFound(NotFound):
900 msg_fmt = _("Port id %(port_id)s could not be found.")
903class NetworkNotFoundForBridge(NetworkNotFound):
904 msg_fmt = _("Network could not be found for bridge %(bridge)s")
907class NetworkNotFoundForInstance(NetworkNotFound):
908 msg_fmt = _("Network could not be found for instance %(instance_id)s.")
911class NetworkAmbiguous(Invalid):
912 msg_fmt = _("More than one possible network found. Specify "
913 "network ID(s) to select which one(s) to connect to.")
916class UnableToAutoAllocateNetwork(Invalid):
917 msg_fmt = _('Unable to automatically allocate a network for project '
918 '%(project_id)s')
921class NetworkRequiresSubnet(Invalid):
922 msg_fmt = _("Network %(network_uuid)s requires a subnet in order to boot"
923 " instances on.")
926class ExternalNetworkAttachForbidden(Forbidden):
927 msg_fmt = _("It is not allowed to create an interface on "
928 "external network %(network_uuid)s")
931class NetworkMissingPhysicalNetwork(NovaException):
932 msg_fmt = _("Physical network is missing for network %(network_uuid)s")
935class VifDetailsMissingVhostuserSockPath(Invalid):
936 msg_fmt = _("vhostuser_sock_path not present in vif_details"
937 " for vif %(vif_id)s")
940class VifDetailsMissingMacvtapParameters(Invalid):
941 msg_fmt = _("Parameters %(missing_params)s not present in"
942 " vif_details for vif %(vif_id)s. Check your Neutron"
943 " configuration to validate that the macvtap parameters are"
944 " correct.")
947class DatastoreNotFound(NotFound):
948 msg_fmt = _("Could not find the datastore reference(s) which the VM uses.")
951class PortInUse(Invalid):
952 msg_fmt = _("Port %(port_id)s is still in use.")
955class PortRequiresFixedIP(Invalid):
956 msg_fmt = _("Port %(port_id)s requires a FixedIP in order to be used.")
959class PortNotUsable(Invalid):
960 msg_fmt = _("Port %(port_id)s not usable for instance %(instance)s.")
963class PortNotUsableDNS(Invalid):
964 msg_fmt = _("Port %(port_id)s not usable for instance %(instance)s. "
965 "Value %(value)s assigned to dns_name attribute does not "
966 "match instance's hostname %(hostname)s")
969class PortBindingFailed(Invalid):
970 msg_fmt = _("Binding failed for port %(port_id)s, please check neutron "
971 "logs for more information.")
974class PortBindingDeletionFailed(NovaException):
975 msg_fmt = _("Failed to delete binding for port(s) %(port_id)s on host "
976 "%(host)s; please check neutron logs for more information")
979class PortBindingActivationFailed(NovaException):
980 msg_fmt = _("Failed to activate binding for port %(port_id)s on host "
981 "%(host)s; please check neutron logs for more information")
984class PortUpdateFailed(Invalid):
985 msg_fmt = _("Port update failed for port %(port_id)s: %(reason)s")
988class AttachSRIOVPortNotSupported(Invalid):
989 msg_fmt = _('Attaching SR-IOV port %(port_id)s to server '
990 '%(instance_uuid)s is not supported. SR-IOV ports must be '
991 'specified during server creation.')
994class FixedIpNotFoundForAddress(NotFound):
995 msg_fmt = _("Fixed IP not found for address %(address)s.")
998class FixedIpNotFoundForInstance(NotFound):
999 msg_fmt = _("Instance %(instance_uuid)s does not have fixed IP '%(ip)s'.")
1002class FixedIpAlreadyInUse(NovaException):
1003 msg_fmt = _("Fixed IP address %(address)s is already in use on instance "
1004 "%(instance_uuid)s.")
1007class FixedIpAssociatedWithMultipleInstances(NovaException):
1008 msg_fmt = _("More than one instance is associated with fixed IP address "
1009 "'%(address)s'.")
1012class FixedIpInvalidOnHost(Invalid):
1013 msg_fmt = _("The fixed IP associated with port %(port_id)s is not "
1014 "compatible with the host.")
1017class NoMoreFixedIps(NovaException):
1018 msg_fmt = _("No fixed IP addresses available for network: %(net)s")
1021class FloatingIpNotFound(NotFound):
1022 msg_fmt = _("Floating IP not found for ID %(id)s.")
1025class FloatingIpNotFoundForAddress(FloatingIpNotFound):
1026 msg_fmt = _("Floating IP not found for address %(address)s.")
1029class FloatingIpMultipleFoundForAddress(NovaException):
1030 msg_fmt = _("Multiple floating IPs are found for address %(address)s.")
1033class FloatingIpPoolNotFound(NotFound):
1034 msg_fmt = _("Floating IP pool not found.")
1035 safe = True
1038class NoMoreFloatingIps(FloatingIpNotFound):
1039 msg_fmt = _("Zero floating IPs available.")
1040 safe = True
1043class FloatingIpAssociated(NovaException):
1044 msg_fmt = _("Floating IP %(address)s is associated.")
1047class NoFloatingIpInterface(NotFound):
1048 msg_fmt = _("Interface %(interface)s not found.")
1051class FloatingIpAssociateFailed(NovaException):
1052 msg_fmt = _("Floating IP %(address)s association has failed.")
1055class FloatingIpBadRequest(Invalid):
1056 msg_fmt = _("The floating IP request failed with a BadRequest")
1059class KeypairNotFound(NotFound):
1060 msg_fmt = _("Keypair %(name)s not found for user %(user_id)s")
1063class ServiceNotFound(NotFound):
1064 msg_fmt = _("Service %(service_id)s could not be found.")
1067class ConfGroupForServiceTypeNotFound(ServiceNotFound):
1068 msg_fmt = _("No conf group name could be found for service type "
1069 "%(stype)s.")
1072class ServiceBinaryExists(NovaException):
1073 msg_fmt = _("Service with host %(host)s binary %(binary)s exists.")
1076class ServiceTopicExists(NovaException):
1077 msg_fmt = _("Service with host %(host)s topic %(topic)s exists.")
1080class HostNotFound(NotFound):
1081 msg_fmt = _("Host %(host)s could not be found.")
1084class ComputeHostNotFound(HostNotFound):
1085 msg_fmt = _("Compute host %(host)s could not be found.")
1088class HostBinaryNotFound(NotFound):
1089 msg_fmt = _("Could not find binary %(binary)s on host %(host)s.")
1092class InvalidQuotaValue(Invalid):
1093 msg_fmt = _("Change would make usage less than 0 for the following "
1094 "resources: %(unders)s")
1097class InvalidQuotaMethodUsage(Invalid):
1098 msg_fmt = _("Wrong quota method %(method)s used on resource %(res)s")
1101class QuotaNotFound(NotFound):
1102 msg_fmt = _("Quota could not be found")
1105class QuotaExists(NovaException):
1106 msg_fmt = _("Quota exists for project %(project_id)s, "
1107 "resource %(resource)s")
1110class QuotaResourceUnknown(QuotaNotFound):
1111 msg_fmt = _("Unknown quota resources %(unknown)s.")
1114class ProjectUserQuotaNotFound(QuotaNotFound):
1115 msg_fmt = _("Quota for user %(user_id)s in project %(project_id)s "
1116 "could not be found.")
1119class ProjectQuotaNotFound(QuotaNotFound):
1120 msg_fmt = _("Quota for project %(project_id)s could not be found.")
1123class QuotaClassNotFound(QuotaNotFound):
1124 msg_fmt = _("Quota class %(class_name)s could not be found.")
1127class QuotaClassExists(NovaException):
1128 msg_fmt = _("Quota class %(class_name)s exists for resource %(resource)s")
1131class SecurityGroupNotFound(NotFound):
1132 msg_fmt = _("Security group %(security_group_id)s not found.")
1135class SecurityGroupNotFoundForProject(SecurityGroupNotFound):
1136 msg_fmt = _("Security group %(security_group_id)s not found "
1137 "for project %(project_id)s.")
1140class SecurityGroupExists(Invalid):
1141 msg_fmt = _("Security group %(security_group_name)s already exists "
1142 "for project %(project_id)s.")
1145class SecurityGroupCannotBeApplied(Invalid):
1146 msg_fmt = _("Network requires port_security_enabled and subnet associated"
1147 " in order to apply security groups.")
1150class SecurityGroupConnectionStateConflict(Invalid):
1151 code = 409
1152 msg_fmt = _("Cannot apply both stateful and stateless security groups on "
1153 "the same port.")
1156class NoUniqueMatch(NovaException):
1157 msg_fmt = _("No Unique Match Found.")
1158 code = 409
1161class NoActiveMigrationForInstance(NotFound):
1162 msg_fmt = _("Active live migration for instance %(instance_id)s not found")
1165class MigrationNotFound(NotFound):
1166 msg_fmt = _("Migration %(migration_id)s could not be found.")
1169class MigrationNotFoundByStatus(MigrationNotFound):
1170 msg_fmt = _("Migration not found for instance %(instance_id)s "
1171 "with status %(status)s.")
1174class MigrationNotFoundForInstance(MigrationNotFound):
1175 msg_fmt = _("Migration %(migration_id)s not found for instance "
1176 "%(instance_id)s")
1179class InvalidMigrationState(Invalid):
1180 msg_fmt = _("Migration %(migration_id)s state of instance "
1181 "%(instance_uuid)s is %(state)s. Cannot %(method)s while the "
1182 "migration is in this state.")
1185class ConsoleLogOutputException(NovaException):
1186 msg_fmt = _("Console log output could not be retrieved for instance "
1187 "%(instance_id)s. Reason: %(reason)s")
1190class ConsoleNotAvailable(NotFound):
1191 msg_fmt = _("Guest does not have a console available.")
1194class ConsoleTypeInvalid(Invalid):
1195 msg_fmt = _("Invalid console type %(console_type)s")
1198class ConsoleTypeUnavailable(Invalid):
1199 msg_fmt = _("Unavailable console type %(console_type)s.")
1202class ConsolePortRangeExhausted(NovaException):
1203 msg_fmt = _("The console port range %(min_port)d-%(max_port)d is "
1204 "exhausted.")
1207class FlavorNotFound(NotFound):
1208 msg_fmt = _("Flavor %(flavor_id)s could not be found.")
1211class FlavorNotFoundByName(FlavorNotFound):
1212 msg_fmt = _("Flavor with name %(flavor_name)s could not be found.")
1215class FlavorAccessNotFound(NotFound):
1216 msg_fmt = _("Flavor access not found for %(flavor_id)s / "
1217 "%(project_id)s combination.")
1220class FlavorExtraSpecUpdateCreateFailed(NovaException):
1221 msg_fmt = _("Flavor %(id)s extra spec cannot be updated or created "
1222 "after %(retries)d retries.")
1225class CellTimeout(NotFound):
1226 msg_fmt = _("Timeout waiting for response from cell")
1229class SchedulerHostFilterNotFound(NotFound):
1230 msg_fmt = _("Scheduler Host Filter %(filter_name)s could not be found.")
1233class FlavorExtraSpecsNotFound(NotFound):
1234 msg_fmt = _("Flavor %(flavor_id)s has no extra specs with "
1235 "key %(extra_specs_key)s.")
1238class ComputeHostMetricNotFound(NotFound):
1239 msg_fmt = _("Metric %(name)s could not be found on the compute "
1240 "host node %(host)s.%(node)s.")
1243class FileNotFound(NotFound):
1244 msg_fmt = _("File %(file_path)s could not be found.")
1247class DeviceBusy(NovaException):
1248 msg_fmt = _("device %(file_path)s is busy.")
1251class ClassNotFound(NotFound):
1252 msg_fmt = _("Class %(class_name)s could not be found: %(exception)s")
1255class InstanceTagNotFound(NotFound):
1256 msg_fmt = _("Instance %(instance_id)s has no tag '%(tag)s'")
1259class KeyPairExists(NovaException):
1260 msg_fmt = _("Key pair '%(key_name)s' already exists.")
1263class InstanceExists(NovaException):
1264 msg_fmt = _("Instance %(name)s already exists.")
1267class FlavorExists(NovaException):
1268 msg_fmt = _("Flavor with name %(name)s already exists.")
1271class FlavorIdExists(NovaException):
1272 msg_fmt = _("Flavor with ID %(flavor_id)s already exists.")
1275class FlavorAccessExists(NovaException):
1276 msg_fmt = _("Flavor access already exists for flavor %(flavor_id)s "
1277 "and project %(project_id)s combination.")
1280class InvalidSharedStorage(NovaException):
1281 msg_fmt = _("%(path)s is not on shared storage: %(reason)s")
1284class InvalidLocalStorage(NovaException):
1285 msg_fmt = _("%(path)s is not on local storage: %(reason)s")
1288class StorageError(NovaException):
1289 msg_fmt = _("Storage error: %(reason)s")
1292class MigrationError(NovaException):
1293 msg_fmt = _("Migration error: %(reason)s")
1296class MigrationPreCheckError(MigrationError):
1297 msg_fmt = _("Migration pre-check error: %(reason)s")
1300class MigrationSchedulerRPCError(MigrationError):
1301 msg_fmt = _("Migration select destinations error: %(reason)s")
1304class MalformedRequestBody(NovaException):
1305 msg_fmt = _("Malformed message body: %(reason)s")
1308# NOTE(johannes): NotFound should only be used when a 404 error is
1309# appropriate to be returned
1310class ConfigNotFound(NovaException):
1311 msg_fmt = _("Could not find config at %(path)s")
1314class PasteAppNotFound(NovaException):
1315 msg_fmt = _("Could not load paste app '%(name)s' from %(path)s")
1318class CannotResizeToSameFlavor(NovaException):
1319 msg_fmt = _("When resizing, instances must change flavor!")
1322class ResizeError(NovaException):
1323 msg_fmt = _("Resize error: %(reason)s")
1326class CannotResizeDisk(NovaException):
1327 msg_fmt = _("Server disk was unable to be resized because: %(reason)s")
1330class FlavorMemoryTooSmall(NovaException):
1331 msg_fmt = _("Flavor's memory is too small for requested image.")
1334class FlavorDiskTooSmall(NovaException):
1335 msg_fmt = _("The created instance's disk would be too small.")
1338class FlavorDiskSmallerThanImage(FlavorDiskTooSmall):
1339 msg_fmt = _("Flavor's disk is too small for requested image. Flavor disk "
1340 "is %(flavor_size)i bytes, image is %(image_size)i bytes.")
1343class FlavorDiskSmallerThanMinDisk(FlavorDiskTooSmall):
1344 msg_fmt = _("Flavor's disk is smaller than the minimum size specified in "
1345 "image metadata. Flavor disk is %(flavor_size)i bytes, "
1346 "minimum size is %(image_min_disk)i bytes.")
1349class VolumeSmallerThanMinDisk(FlavorDiskTooSmall):
1350 msg_fmt = _("Volume is smaller than the minimum size specified in image "
1351 "metadata. Volume size is %(volume_size)i bytes, minimum "
1352 "size is %(image_min_disk)i bytes.")
1355class BootFromVolumeRequiredForZeroDiskFlavor(Forbidden):
1356 msg_fmt = _("Only volume-backed servers are allowed for flavors with "
1357 "zero disk.")
1360class NoValidHost(NovaException):
1361 msg_fmt = _("No valid host was found. %(reason)s")
1364class RequestFilterFailed(NovaException):
1365 msg_fmt = _("Scheduling failed: %(reason)s")
1368class InvalidRoutedNetworkConfiguration(NovaException):
1369 msg_fmt = _("Neutron routed networks configuration is invalid: "
1370 "%(reason)s.")
1373class MaxRetriesExceeded(NoValidHost):
1374 msg_fmt = _("Exceeded maximum number of retries. %(reason)s")
1377class OverQuota(NovaException):
1378 msg_fmt = _("Quota exceeded for resources: %(overs)s")
1379 code = 413
1380 safe = True
1383class TooManyInstances(OverQuota):
1384 msg_fmt = _("Quota exceeded for %(overs)s: Requested %(req)s,"
1385 " but already used %(used)s of %(allowed)s %(overs)s")
1388class FloatingIpLimitExceeded(OverQuota):
1389 msg_fmt = _("Maximum number of floating IPs exceeded")
1392class MetadataLimitExceeded(OverQuota):
1393 msg_fmt = _("Maximum number of metadata items exceeds %(allowed)d")
1396class OnsetFileLimitExceeded(OverQuota):
1397 msg_fmt = _("Personality file limit exceeded")
1400class OnsetFilePathLimitExceeded(OnsetFileLimitExceeded):
1401 msg_fmt = _("Personality file path exceeds maximum %(allowed)s")
1404class OnsetFileContentLimitExceeded(OnsetFileLimitExceeded):
1405 msg_fmt = _("Personality file content exceeds maximum %(allowed)s")
1408class KeypairLimitExceeded(OverQuota):
1409 msg_fmt = _("Quota exceeded, too many key pairs.")
1412class SecurityGroupLimitExceeded(OverQuota):
1413 msg_fmt = _("Maximum number of security groups or rules exceeded")
1416class PortLimitExceeded(OverQuota):
1417 msg_fmt = _("Maximum number of ports exceeded")
1420class ServerGroupLimitExceeded(OverQuota):
1421 msg_fmt = _("Quota exceeded, too many server groups.")
1424class GroupMemberLimitExceeded(OverQuota):
1425 msg_fmt = _("Quota exceeded, too many servers in group")
1428class AggregateNotFound(NotFound):
1429 msg_fmt = _("Aggregate %(aggregate_id)s could not be found.")
1432class AggregateNameExists(NovaException):
1433 msg_fmt = _("Aggregate %(aggregate_name)s already exists.")
1436class AggregateHostNotFound(NotFound):
1437 msg_fmt = _("Aggregate %(aggregate_id)s has no host %(host)s.")
1440class AggregateMetadataNotFound(NotFound):
1441 msg_fmt = _("Aggregate %(aggregate_id)s has no metadata with "
1442 "key %(metadata_key)s.")
1445class AggregateHostExists(NovaException):
1446 msg_fmt = _("Aggregate %(aggregate_id)s already has host %(host)s.")
1449class InstancePasswordSetFailed(NovaException):
1450 msg_fmt = _("Failed to set admin password on %(instance)s "
1451 "because %(reason)s")
1452 safe = True
1455class InstanceNotFound(NotFound):
1456 msg_fmt = _("Instance %(instance_id)s could not be found.")
1459class InstanceInfoCacheNotFound(NotFound):
1460 msg_fmt = _("Info cache for instance %(instance_uuid)s could not be "
1461 "found.")
1464class MarkerNotFound(NotFound):
1465 msg_fmt = _("Marker %(marker)s could not be found.")
1468class CouldNotFetchImage(NovaException):
1469 msg_fmt = _("Could not fetch image %(image_id)s")
1472class CouldNotUploadImage(NovaException):
1473 msg_fmt = _("Could not upload image %(image_id)s")
1476class TaskAlreadyRunning(NovaException):
1477 msg_fmt = _("Task %(task_name)s is already running on host %(host)s")
1480class TaskNotRunning(NovaException):
1481 msg_fmt = _("Task %(task_name)s is not running on host %(host)s")
1484class InstanceIsLocked(InstanceInvalidState):
1485 msg_fmt = _("Instance %(instance_uuid)s is locked")
1488class ConfigDriveInvalidValue(Invalid):
1489 msg_fmt = _("Invalid value for Config Drive option: %(option)s")
1492class ConfigDriveUnsupportedFormat(Invalid):
1493 msg_fmt = _("Config drive format '%(format)s' is not supported.")
1496class ConfigDriveMountFailed(NovaException):
1497 msg_fmt = _("Could not mount vfat config drive. %(operation)s failed. "
1498 "Error: %(error)s")
1501class ConfigDriveUnknownFormat(NovaException):
1502 msg_fmt = _("Unknown config drive format %(format)s. Select one of "
1503 "iso9660 or vfat.")
1506class ConfigDriveNotFound(NotFound):
1507 msg_fmt = _("Instance %(instance_uuid)s requires config drive, but it "
1508 "does not exist.")
1511class InterfaceAttachFailed(NovaException):
1512 msg_fmt = _("Failed to attach network adapter device to "
1513 "%(instance_uuid)s")
1516class InterfaceAttachFailedNoNetwork(Invalid):
1517 msg_fmt = _("No specific network was requested and none are available "
1518 "for project '%(project_id)s'.")
1521class InterfaceAttachPciClaimFailed(Invalid):
1522 msg_fmt = _("Failed to claim PCI device for %(instance_uuid)s during "
1523 "interface attach")
1526class InterfaceAttachResourceAllocationFailed(Invalid):
1527 msg_fmt = _("Failed to allocate additional resources to %(instance_uuid)s "
1528 "during interface attach")
1531class InterfaceDetachFailed(Invalid):
1532 msg_fmt = _("Failed to detach network adapter device from "
1533 "%(instance_uuid)s")
1536class InstanceUserDataMalformed(NovaException):
1537 msg_fmt = _("User data needs to be valid base 64.")
1540class InstanceUpdateConflict(NovaException):
1541 msg_fmt = _("Conflict updating instance %(instance_uuid)s. "
1542 "Expected: %(expected)s. Actual: %(actual)s")
1545class UnknownInstanceUpdateConflict(InstanceUpdateConflict):
1546 msg_fmt = _("Conflict updating instance %(instance_uuid)s, but we were "
1547 "unable to determine the cause")
1550class UnexpectedTaskStateError(InstanceUpdateConflict):
1551 pass
1554class UnexpectedDeletingTaskStateError(UnexpectedTaskStateError):
1555 pass
1558class InstanceActionNotFound(NovaException):
1559 msg_fmt = _("Action for request_id %(request_id)s on instance"
1560 " %(instance_uuid)s not found")
1563class InstanceActionEventNotFound(NovaException):
1564 msg_fmt = _("Event %(event)s not found for action id %(action_id)s")
1567class InstanceEvacuateNotSupported(Invalid):
1568 msg_fmt = _('Instance evacuate is not supported.')
1571class InstanceEvacuateNotSupportedTargetState(Invalid):
1572 msg_fmt = _("Target state '%(target_state)s' for instance evacuate "
1573 "is not supported.")
1576class DBNotAllowed(NovaException):
1577 msg_fmt = _('%(binary)s attempted direct database access which is '
1578 'not allowed by policy')
1581class UnsupportedVirtType(Invalid):
1582 msg_fmt = _("Virtualization type '%(virt)s' is not supported by "
1583 "this compute driver")
1586class UnsupportedHardware(Invalid):
1587 msg_fmt = _("Requested hardware '%(model)s' is not supported by "
1588 "the '%(virt)s' virt driver")
1591class UnsupportedRescueBus(Invalid):
1592 msg_fmt = _("Requested rescue bus '%(bus)s' is not supported by "
1593 "the '%(virt)s' virt driver")
1596class UnsupportedRescueDevice(Invalid):
1597 msg_fmt = _("Requested rescue device '%(device)s' is not supported")
1600class UnsupportedRescueImage(Invalid):
1601 msg_fmt = _("Requested rescue image '%(image)s' is not supported")
1604class UnsupportedRPCVersion(Invalid):
1605 msg_fmt = _("Unsupported RPC version for %(api)s. "
1606 "Required >= %(required)s")
1609class Base64Exception(NovaException):
1610 msg_fmt = _("Invalid Base 64 data for file %(path)s")
1613class BuildAbortException(NovaException):
1614 msg_fmt = _("Build of instance %(instance_uuid)s aborted: %(reason)s")
1617class RescheduledException(NovaException):
1618 msg_fmt = _("Build of instance %(instance_uuid)s was re-scheduled: "
1619 "%(reason)s")
1622class RescheduledByPolicyException(RescheduledException):
1623 msg_fmt = _("Build of instance %(instance_uuid)s was re-scheduled: "
1624 "%(reason)s")
1627class GroupAffinityViolation(NovaException):
1628 msg_fmt = _("%(policy)s instance group policy was violated")
1631class InstanceFaultRollback(NovaException):
1632 def __init__(self, inner_exception=None):
1633 message = _("Instance rollback performed due to: %s")
1634 self.inner_exception = inner_exception
1635 super(InstanceFaultRollback, self).__init__(message % inner_exception)
1638class OrphanedObjectError(NovaException):
1639 msg_fmt = _('Cannot call %(method)s on orphaned %(objtype)s object')
1642class ObjectActionError(NovaException):
1643 msg_fmt = _('Object action %(action)s failed because: %(reason)s')
1646class InstanceGroupNotFound(NotFound):
1647 msg_fmt = _("Instance group %(group_uuid)s could not be found.")
1650class InstanceGroupIdExists(NovaException):
1651 msg_fmt = _("Instance group %(group_uuid)s already exists.")
1654class InstanceGroupSaveException(NovaException):
1655 msg_fmt = _("%(field)s should not be part of the updates.")
1658class ResourceMonitorError(NovaException):
1659 msg_fmt = _("Error when creating resource monitor: %(monitor)s")
1662class PciDeviceWrongAddressFormat(NovaException):
1663 msg_fmt = _("The PCI address %(address)s has an incorrect format.")
1666class PciDeviceInvalidDeviceName(NovaException):
1667 msg_fmt = _("Invalid PCI Whitelist: "
1668 "The PCI whitelist can specify devname or address,"
1669 " but not both")
1672class PciDeviceNotFoundById(NotFound):
1673 msg_fmt = _("PCI device %(id)s not found")
1676class PciDeviceNotFound(NotFound):
1677 msg_fmt = _("PCI Device %(node_id)s:%(address)s not found.")
1680class PciDeviceInvalidStatus(Invalid):
1681 msg_fmt = _(
1682 "PCI device %(compute_node_id)s:%(address)s is %(status)s "
1683 "instead of %(hopestatus)s")
1686class PciDeviceVFInvalidStatus(Invalid):
1687 msg_fmt = _(
1688 "Not all Virtual Functions of PF %(compute_node_id)s:%(address)s "
1689 "are free.")
1692class PciDevicePFInvalidStatus(Invalid):
1693 msg_fmt = _(
1694 "Physical Function %(compute_node_id)s:%(address)s, related to VF"
1695 " %(compute_node_id)s:%(vf_address)s is %(status)s "
1696 "instead of %(hopestatus)s")
1699class PciDeviceInvalidOwner(Invalid):
1700 msg_fmt = _(
1701 "PCI device %(compute_node_id)s:%(address)s is owned by %(owner)s "
1702 "instead of %(hopeowner)s")
1705class PciDeviceRequestFailed(NovaException):
1706 msg_fmt = _(
1707 "PCI device request %(requests)s failed")
1710class PciDevicePoolEmpty(NovaException):
1711 msg_fmt = _(
1712 "Attempt to consume PCI device %(compute_node_id)s:%(address)s "
1713 "from empty pool")
1716class PciInvalidAlias(Invalid):
1717 msg_fmt = _("Invalid PCI alias definition: %(reason)s")
1720class PciRequestAliasNotDefined(NovaException):
1721 msg_fmt = _("PCI alias %(alias)s is not defined")
1724class PciConfigInvalidSpec(Invalid):
1725 msg_fmt = _("Invalid [pci]device_spec config: %(reason)s")
1728class PciRequestFromVIFNotFound(NotFound):
1729 msg_fmt = _("Failed to locate PCI request associated with the given VIF "
1730 "PCI address: %(pci_slot)s on compute node: %(node_id)s")
1733class PciDeviceRemoteManagedNotPresent(NovaException):
1734 msg_fmt = _('Invalid PCI Whitelist: A device specified as "remote_managed"'
1735 ' is not actually present on the host')
1738class PciDeviceInvalidPFRemoteManaged(NovaException):
1739 msg_fmt = _('Invalid PCI Whitelist: PFs must not have the "remote_managed"'
1740 'tag, device address: %(address)s')
1743# Cannot be templated, msg needs to be constructed when raised.
1744class InternalError(NovaException):
1745 """Generic hypervisor errors.
1747 Consider subclassing this to provide more specific exceptions.
1748 """
1749 msg_fmt = "%(err)s"
1752class PciDeviceDetachFailed(NovaException):
1753 msg_fmt = _("Failed to detach PCI device %(dev)s: %(reason)s")
1756class PciDeviceUnsupportedHypervisor(NovaException):
1757 msg_fmt = _("%(type)s hypervisor does not support PCI devices")
1760class KeyManagerError(NovaException):
1761 msg_fmt = _("Key manager error: %(reason)s")
1764class VolumesNotRemoved(Invalid):
1765 msg_fmt = _("Failed to remove volume(s): (%(reason)s)")
1768class VolumeRebaseFailed(NovaException):
1769 msg_fmt = _("Volume rebase failed: %(reason)s")
1772class InvalidVideoMode(Invalid):
1773 msg_fmt = _("Provided video model (%(model)s) is not supported.")
1776class RngDeviceNotExist(Invalid):
1777 msg_fmt = _("The provided RNG device path: (%(path)s) is not "
1778 "present on the host.")
1781class RequestedVRamTooHigh(NovaException):
1782 msg_fmt = _("The requested amount of video memory %(req_vram)d is higher "
1783 "than the maximum allowed by flavor %(max_vram)d.")
1786class SecurityProxyNegotiationFailed(NovaException):
1787 msg_fmt = _("Failed to negotiate security type with server: %(reason)s")
1790class RFBAuthHandshakeFailed(NovaException):
1791 msg_fmt = _("Failed to complete auth handshake: %(reason)s")
1794class RFBAuthNoAvailableScheme(NovaException):
1795 msg_fmt = _("No matching auth scheme: allowed types: '%(allowed_types)s', "
1796 "desired types: '%(desired_types)s'")
1799class InvalidWatchdogAction(Invalid):
1800 msg_fmt = _("Provided watchdog action (%(action)s) is not supported.")
1803class LiveMigrationNotSubmitted(NovaException):
1804 msg_fmt = _("Failed to submit live migration %(migration_uuid)s for "
1805 "instance %(instance_uuid)s for processing.")
1808class SelectionObjectsWithOldRPCVersionNotSupported(NovaException):
1809 msg_fmt = _("Requests for Selection objects with alternates are not "
1810 "supported in select_destinations() before RPC version 4.5; "
1811 "version %(version)s requested.")
1814class LiveMigrationURINotAvailable(NovaException):
1815 msg_fmt = _('No live migration URI configured and no default available '
1816 'for "%(virt_type)s" hypervisor virtualization type.')
1819class UnshelveException(NovaException):
1820 msg_fmt = _("Error during unshelve instance %(instance_id)s: %(reason)s")
1823class MismatchVolumeAZException(Invalid):
1824 msg_fmt = _("The availability zone between the server and its attached "
1825 "volumes do not match: %(reason)s.")
1826 code = 409
1829class UnshelveInstanceInvalidState(InstanceInvalidState):
1830 msg_fmt = _('Specifying an availability zone or a host when unshelving '
1831 'server "%(instance_uuid)s" with status "%(state)s" is not '
1832 'supported. The server status must be SHELVED_OFFLOADED.')
1833 code = 409
1836class UnshelveHostNotInAZ(Invalid):
1837 msg_fmt = _('Host "%(host)s" is not in the availability zone '
1838 '"%(availability_zone)s".')
1839 code = 409
1842class ImageVCPULimitsRangeExceeded(Invalid):
1843 msg_fmt = _('Image vCPU topology limits (sockets=%(image_sockets)d, '
1844 'cores=%(image_cores)d, threads=%(image_threads)d) exceeds '
1845 'the limits of the flavor (sockets=%(flavor_sockets)d, '
1846 'cores=%(flavor_cores)d, threads=%(flavor_threads)d)')
1849class ImageVCPUTopologyRangeExceeded(Invalid):
1850 msg_fmt = _('Image vCPU topology (sockets=%(image_sockets)d, '
1851 'cores=%(image_cores)d, threads=%(image_threads)d) exceeds '
1852 'the limits of the flavor or image (sockets=%(max_sockets)d, '
1853 'cores=%(max_cores)d, threads=%(max_threads)d)')
1856class ImageVCPULimitsRangeImpossible(Invalid):
1857 msg_fmt = _("Requested vCPU limits %(sockets)d:%(cores)d:%(threads)d "
1858 "are impossible to satisfy for vcpus count %(vcpus)d")
1861class InvalidArchitectureName(Invalid):
1862 msg_fmt = _("Architecture name '%(arch)s' is not recognised")
1865class ImageNUMATopologyIncomplete(Invalid):
1866 msg_fmt = _("CPU and memory allocation must be provided for all "
1867 "NUMA nodes")
1870class ImageNUMATopologyForbidden(Forbidden):
1871 msg_fmt = _("Image property '%(name)s' is not permitted to override "
1872 "NUMA configuration set against the flavor")
1875class ImageNUMATopologyRebuildConflict(Invalid):
1876 msg_fmt = _(
1877 "An instance's NUMA topology cannot be changed as part of a rebuild. "
1878 "The image provided is invalid for this instance.")
1881class ImagePCINUMAPolicyForbidden(Forbidden):
1882 msg_fmt = _("Image property 'hw_pci_numa_affinity_policy' is not "
1883 "permitted to override the 'hw:pci_numa_affinity_policy' "
1884 "flavor extra spec.")
1887class ImageNUMATopologyAsymmetric(Invalid):
1888 msg_fmt = _("Instance CPUs and/or memory cannot be evenly distributed "
1889 "across instance NUMA nodes. Explicit assignment of CPUs "
1890 "and memory to nodes is required")
1893class ImageNUMATopologyCPUOutOfRange(Invalid):
1894 msg_fmt = _("CPU number %(cpunum)d is larger than max %(cpumax)d")
1897class ImageNUMATopologyCPUDuplicates(Invalid):
1898 msg_fmt = _("CPU number %(cpunum)d is assigned to two nodes")
1901class ImageNUMATopologyCPUsUnassigned(Invalid):
1902 msg_fmt = _("CPU number %(cpuset)s is not assigned to any node")
1905class ImageNUMATopologyMemoryOutOfRange(Invalid):
1906 msg_fmt = _("%(memsize)d MB of memory assigned, but expected "
1907 "%(memtotal)d MB")
1910class InvalidHostname(Invalid):
1911 msg_fmt = _("Invalid characters in hostname '%(hostname)s'")
1914class NumaTopologyNotFound(NotFound):
1915 msg_fmt = _("Instance %(instance_uuid)s does not specify a NUMA topology")
1918class MigrationContextNotFound(NotFound):
1919 msg_fmt = _("Instance %(instance_uuid)s does not specify a migration "
1920 "context.")
1923class SocketPortRangeExhaustedException(NovaException):
1924 msg_fmt = _("Not able to acquire a free port for %(host)s")
1927class SocketPortInUseException(NovaException):
1928 msg_fmt = _("Not able to bind %(host)s:%(port)d, %(error)s")
1931class ImageSerialPortNumberInvalid(Invalid):
1932 msg_fmt = _("Number of serial ports specified in flavor is invalid: "
1933 "expected an integer, got '%(num_ports)s'")
1936class ImageSerialPortNumberExceedFlavorValue(Invalid):
1937 msg_fmt = _("Forbidden to exceed flavor value of number of serial "
1938 "ports passed in image meta.")
1941class SerialPortNumberLimitExceeded(Invalid):
1942 msg_fmt = _("Maximum number of serial port exceeds %(allowed)d "
1943 "for %(virt_type)s")
1946class InvalidImageConfigDrive(Invalid):
1947 msg_fmt = _("Image's config drive option '%(config_drive)s' is invalid")
1950class InvalidHypervisorVirtType(Invalid):
1951 msg_fmt = _("Hypervisor virtualization type '%(hv_type)s' is not "
1952 "recognised")
1955class InvalidMachineType(Invalid):
1956 msg_fmt = _("Machine type '%(mtype)s' is not compatible with image "
1957 "%(image_name)s (%(image_id)s): %(reason)s")
1960class InvalidMachineTypeUpdate(Invalid):
1961 msg_fmt = _("Cannot update machine type %(existing_machine_type)s to "
1962 "%(machine_type)s.")
1965class UnsupportedMachineType(Invalid):
1966 msg_fmt = _("Machine type %(machine_type)s is not supported.")
1969class InvalidVirtualMachineMode(Invalid):
1970 msg_fmt = _("Virtual machine mode '%(vmmode)s' is not recognised")
1973class InvalidToken(Invalid):
1974 msg_fmt = _("The token '%(token)s' is invalid or has expired")
1977class TokenInUse(Invalid):
1978 msg_fmt = _("The generated token is invalid")
1981class InvalidConnectionInfo(Invalid):
1982 msg_fmt = _("Invalid Connection Info")
1985class InstanceQuiesceNotSupported(Invalid):
1986 msg_fmt = _('Quiescing is not supported in instance %(instance_id)s')
1989class InstanceAgentNotEnabled(Invalid):
1990 msg_fmt = _('Guest agent is not enabled for the instance')
1991 safe = True
1994class QemuGuestAgentNotEnabled(InstanceAgentNotEnabled):
1995 msg_fmt = _('QEMU guest agent is not enabled')
1998class SetAdminPasswdNotSupported(Invalid):
1999 msg_fmt = _('Set admin password is not supported')
2000 safe = True
2003class MemoryPageSizeInvalid(Invalid):
2004 msg_fmt = _("Invalid memory page size '%(pagesize)s'")
2007class MemoryPageSizeForbidden(Invalid):
2008 msg_fmt = _("Page size %(pagesize)s forbidden against '%(against)s'")
2011class MemoryPageSizeNotSupported(Invalid):
2012 msg_fmt = _("Page size %(pagesize)s is not supported by the host.")
2015class LockMemoryForbidden(Forbidden):
2016 msg_fmt = _("locked_memory value in image or flavor is forbidden when "
2017 "mem_page_size is not set.")
2020class FlavorImageLockedMemoryConflict(NovaException):
2021 msg_fmt = _("locked_memory value in image (%(image)s) and flavor "
2022 "(%(flavor)s) conflict. A consistent value is expected if "
2023 "both specified.")
2026class CPUPinningInvalid(Invalid):
2027 msg_fmt = _("CPU set to pin %(requested)s must be a subset of "
2028 "free CPU set %(available)s")
2031class CPUUnpinningInvalid(Invalid):
2032 msg_fmt = _("CPU set to unpin %(requested)s must be a subset of "
2033 "pinned CPU set %(available)s")
2036class CPUPinningUnknown(Invalid):
2037 msg_fmt = _("CPU set to pin %(requested)s must be a subset of "
2038 "known CPU set %(available)s")
2041class CPUUnpinningUnknown(Invalid):
2042 msg_fmt = _("CPU set to unpin %(requested)s must be a subset of "
2043 "known CPU set %(available)s")
2046class ImageCPUPinningForbidden(Forbidden):
2047 msg_fmt = _("Image property 'hw_cpu_policy' is not permitted to override "
2048 "CPU pinning policy set against the flavor")
2051class ImageCPUThreadPolicyForbidden(Forbidden):
2052 msg_fmt = _("Image property 'hw_cpu_thread_policy' is not permitted to "
2053 "override CPU thread pinning policy set against the flavor")
2056class UnsupportedPolicyException(Invalid):
2057 msg_fmt = _("ServerGroup policy is not supported: %(reason)s")
2060class CellMappingNotFound(NotFound):
2061 msg_fmt = _("Cell %(uuid)s has no mapping.")
2064class NUMATopologyUnsupported(Invalid):
2065 msg_fmt = _("Host does not support guests with NUMA topology set")
2068class MemoryPagesUnsupported(Invalid):
2069 msg_fmt = _("Host does not support guests with custom memory page sizes")
2072class InvalidImageFormat(Invalid):
2073 msg_fmt = _("Invalid image format '%(format)s'")
2076class UnsupportedImageModel(Invalid):
2077 msg_fmt = _("Image model '%(image)s' is not supported")
2080class HostMappingNotFound(Invalid):
2081 msg_fmt = _("Host '%(name)s' is not mapped to any cell")
2084class HostMappingExists(Invalid):
2085 msg_fmt = _("Host '%(name)s' mapping already exists")
2088class RealtimeConfigurationInvalid(Invalid):
2089 msg_fmt = _("Cannot set realtime policy in a non dedicated "
2090 "cpu pinning policy")
2093class CPUThreadPolicyConfigurationInvalid(Invalid):
2094 msg_fmt = _("Cannot set cpu thread pinning policy in a non dedicated "
2095 "cpu pinning policy")
2098class RequestSpecNotFound(NotFound):
2099 msg_fmt = _("RequestSpec not found for instance %(instance_uuid)s")
2102class UEFINotSupported(Invalid):
2103 msg_fmt = _("UEFI is not supported")
2106class SecureBootNotSupported(Invalid):
2107 msg_fmt = _("Secure Boot is not supported by host")
2110class FirmwareSMMNotSupported(Invalid):
2111 msg_fmt = _("This firmware doesn't require (support) SMM")
2114class TriggerCrashDumpNotSupported(Invalid):
2115 msg_fmt = _("Triggering crash dump is not supported")
2118class UnsupportedHostCPUControlPolicy(Invalid):
2119 msg_fmt = _("Requested CPU control policy not supported by host")
2122class LibguestfsCannotReadKernel(Invalid):
2123 msg_fmt = _("Libguestfs does not have permission to read host kernel.")
2126class RealtimeMaskNotFoundOrInvalid(Invalid):
2127 msg_fmt = _("Use of realtime CPUs requires either one or more "
2128 "non-realtime CPU(s) or offloaded emulator threads.")
2131class OsInfoNotFound(NotFound):
2132 msg_fmt = _("No configuration information found for operating system "
2133 "%(os_name)s")
2136class BuildRequestNotFound(NotFound):
2137 msg_fmt = _("BuildRequest not found for instance %(uuid)s")
2140class AttachInterfaceNotSupported(Invalid):
2141 msg_fmt = _("Attaching interfaces is not supported for "
2142 "instance %(instance_uuid)s.")
2145class AttachInterfaceWithQoSPolicyNotSupported(AttachInterfaceNotSupported):
2146 msg_fmt = _("Attaching interfaces with QoS policy is not supported for "
2147 "instance %(instance_uuid)s.")
2150class AttachWithExtendedQoSPolicyNotSupported(AttachInterfaceNotSupported):
2151 msg_fmt = _(
2152 "The interface attach server operation with port having extended "
2153 "resource request, like a port with both QoS minimum bandwidth and "
2154 "packet rate policies, is not yet supported.")
2157class NetworksWithQoSPolicyNotSupported(Invalid):
2158 msg_fmt = _("Using networks with QoS policy is not supported for "
2159 "instance %(instance_uuid)s. (Network ID is %(network_id)s)")
2162class CreateWithPortResourceRequestOldVersion(Invalid):
2163 msg_fmt = _("Creating servers with ports having resource requests, like a "
2164 "port with a QoS minimum bandwidth policy, is not supported "
2165 "until microversion 2.72.")
2168class ExtendedResourceRequestOldCompute(Invalid):
2169 msg_fmt = _("The port-resource-request-groups neutron API extension is "
2170 "not supported by old nova compute service. Upgrade your "
2171 "compute services to Xena (24.0.0) or later.")
2174class InvalidReservedMemoryPagesOption(Invalid):
2175 msg_fmt = _("The format of the option 'reserved_huge_pages' is invalid. "
2176 "(found '%(conf)s') Please refer to the nova "
2177 "config-reference.")
2180# An exception with this name is used on both sides of the placement/
2181# nova interaction.
2182class ResourceProviderInUse(NovaException):
2183 msg_fmt = _("Resource provider has allocations.")
2186class ResourceProviderRetrievalFailed(NovaException):
2187 msg_fmt = _("Failed to get resource provider with UUID %(uuid)s")
2190class ResourceProviderAggregateRetrievalFailed(NovaException):
2191 msg_fmt = _("Failed to get aggregates for resource provider with UUID"
2192 " %(uuid)s")
2195class ResourceProviderTraitRetrievalFailed(NovaException):
2196 msg_fmt = _("Failed to get traits for resource provider with UUID"
2197 " %(uuid)s")
2200class ResourceProviderCreationFailed(NovaException):
2201 msg_fmt = _("Failed to create resource provider %(name)s")
2204class ResourceProviderDeletionFailed(NovaException):
2205 msg_fmt = _("Failed to delete resource provider %(uuid)s")
2208class ResourceProviderUpdateFailed(NovaException):
2209 msg_fmt = _("Failed to update resource provider via URL %(url)s: "
2210 "%(error)s")
2213class ResourceProviderNotFound(NotFound):
2214 msg_fmt = _("No such resource provider %(name_or_uuid)s.")
2217class ResourceProviderSyncFailed(NovaException):
2218 msg_fmt = _("Failed to synchronize the placement service with resource "
2219 "provider information supplied by the compute host.")
2222class PlacementAPIConnectFailure(NovaException):
2223 msg_fmt = _("Unable to communicate with the Placement API.")
2226class PlacementAPIConflict(NovaException):
2227 """Any 409 error from placement APIs should use (a subclass of) this
2228 exception.
2229 """
2230 msg_fmt = _("A conflict was encountered attempting to invoke the "
2231 "placement API at URL %(url)s: %(error)s")
2234class ResourceProviderUpdateConflict(PlacementAPIConflict):
2235 """A 409 caused by generation mismatch from attempting to update an
2236 existing provider record or its associated data (aggregates, traits, etc.).
2237 """
2238 msg_fmt = _("A conflict was encountered attempting to update resource "
2239 "provider %(uuid)s (generation %(generation)d): %(error)s")
2242class PlacementReshapeConflict(PlacementAPIConflict):
2243 """A 409 caused by generation mismatch from attempting to reshape a
2244 provider tree.
2245 """
2246 msg_fmt = _(
2247 "A conflict was encountered attempting to reshape a provider tree: "
2248 "$(error)s"
2249 )
2252class InvalidResourceClass(Invalid):
2253 msg_fmt = _("Resource class '%(resource_class)s' invalid.")
2256class InvalidInventory(Invalid):
2257 msg_fmt = _("Inventory for '%(resource_class)s' on "
2258 "resource provider '%(resource_provider)s' invalid.")
2261# An exception with this name is used on both sides of the placement/
2262# nova interaction.
2263class InventoryInUse(InvalidInventory):
2264 pass
2267class UsagesRetrievalFailed(NovaException):
2268 msg_fmt = _("Failed to retrieve usages for project '%(project_id)s' and "
2269 "user '%(user_id)s'.")
2272class NotSupportedWithOption(Invalid):
2273 msg_fmt = _("%(operation)s is not supported in conjunction with the "
2274 "current %(option)s setting. Please refer to the nova "
2275 "config-reference.")
2278class Unauthorized(NovaException):
2279 msg_fmt = _("Not authorized.")
2280 code = 401
2283class NeutronAdminCredentialConfigurationInvalid(Invalid):
2284 msg_fmt = _("Networking client is experiencing an unauthorized exception.")
2287class InvalidEmulatorThreadsPolicy(Invalid):
2288 msg_fmt = _("CPU emulator threads option requested is invalid, "
2289 "given: '%(requested)s', available: '%(available)s'.")
2292class InvalidCPUAllocationPolicy(Invalid):
2293 msg_fmt = _("CPU policy requested from '%(source)s' is invalid, "
2294 "given: '%(requested)s', available: '%(available)s'.")
2297class InvalidCPUThreadAllocationPolicy(Invalid):
2298 msg_fmt = _("CPU thread policy requested from '%(source)s' is invalid, "
2299 "given: '%(requested)s', available: '%(available)s'.")
2302class BadRequirementEmulatorThreadsPolicy(Invalid):
2303 msg_fmt = _("An isolated CPU emulator threads option requires a dedicated "
2304 "CPU policy option.")
2307class InvalidNetworkNUMAAffinity(Invalid):
2308 msg_fmt = _("Invalid NUMA network affinity configured: %(reason)s")
2311class InvalidPCINUMAAffinity(Invalid):
2312 msg_fmt = _("Invalid PCI NUMA affinity configured: %(policy)s")
2315class TraitRetrievalFailed(NovaException):
2316 msg_fmt = _("Failed to retrieve traits from the placement API: %(error)s")
2319class TraitCreationFailed(NovaException):
2320 msg_fmt = _("Failed to create trait %(name)s: %(error)s")
2323class CannotMigrateToSameHost(NovaException):
2324 msg_fmt = _("Cannot migrate to the host where the server exists.")
2327class VirtDriverNotReady(NovaException):
2328 msg_fmt = _("Virt driver is not ready.")
2331class InvalidPeerList(NovaException):
2332 msg_fmt = _("Configured nova-compute peer list for the ironic virt "
2333 "driver is invalid on host %(host)s")
2336class InstanceDiskMappingFailed(NovaException):
2337 msg_fmt = _("Failed to map boot disk of instance %(instance_name)s to "
2338 "the management partition from any Virtual I/O Server.")
2341class NewMgmtMappingNotFoundException(NovaException):
2342 msg_fmt = _("Failed to find newly-created mapping of storage element "
2343 "%(stg_name)s from Virtual I/O Server %(vios_name)s to the "
2344 "management partition.")
2347class NoDiskDiscoveryException(NovaException):
2348 msg_fmt = _("Having scanned SCSI bus %(bus)x on the management partition, "
2349 "disk with UDID %(udid)s failed to appear after %(polls)d "
2350 "polls over %(timeout)d seconds.")
2353class UniqueDiskDiscoveryException(NovaException):
2354 msg_fmt = _("Expected to find exactly one disk on the management "
2355 "partition at %(path_pattern)s; found %(count)d.")
2358class DeviceDeletionException(NovaException):
2359 msg_fmt = _("Device %(devpath)s is still present on the management "
2360 "partition after attempting to delete it. Polled %(polls)d "
2361 "times over %(timeout)d seconds.")
2364class OptRequiredIfOtherOptValue(NovaException):
2365 msg_fmt = _("The %(then_opt)s option is required if %(if_opt)s is "
2366 "specified as '%(if_value)s'.")
2369class AllocationCreateFailed(NovaException):
2370 msg_fmt = _('Failed to create allocations for instance %(instance)s '
2371 'against resource provider %(provider)s.')
2374class AllocationUpdateFailed(NovaException):
2375 msg_fmt = _('Failed to update allocations for consumer %(consumer_uuid)s. '
2376 'Error: %(error)s')
2379class AllocationMoveFailed(NovaException):
2380 msg_fmt = _('Failed to move allocations from consumer %(source_consumer)s '
2381 'to consumer %(target_consumer)s. '
2382 'Error: %(error)s')
2385class AllocationDeleteFailed(NovaException):
2386 msg_fmt = _('Failed to delete allocations for consumer %(consumer_uuid)s. '
2387 'Error: %(error)s')
2390class TooManyComputesForHost(NovaException):
2391 msg_fmt = _('Unexpected number of compute node records '
2392 '(%(num_computes)d) found for host %(host)s. There should '
2393 'only be a one-to-one mapping.')
2396class CertificateValidationFailed(NovaException):
2397 msg_fmt = _("Image signature certificate validation failed for "
2398 "certificate: %(cert_uuid)s. %(reason)s")
2401class InstanceRescueFailure(NovaException):
2402 msg_fmt = _("Failed to move instance to rescue mode: %(reason)s")
2405class InstanceUnRescueFailure(NovaException):
2406 msg_fmt = _("Failed to unrescue instance: %(reason)s")
2409class IronicAPIVersionNotAvailable(NovaException):
2410 msg_fmt = _('Ironic API version %(version)s is not available.')
2413class ZVMDriverException(NovaException):
2414 msg_fmt = _("ZVM Driver has error: %(error)s")
2417class ZVMConnectorError(ZVMDriverException):
2418 msg_fmt = _("zVM Cloud Connector request failed: %(results)s")
2420 def __init__(self, message=None, **kwargs):
2421 """Exception for zVM ConnectorClient calls.
2423 :param results: The object returned from ZVMConnector.send_request.
2424 """
2425 super(ZVMConnectorError, self).__init__(message=message, **kwargs)
2427 results = kwargs.get('results', {})
2428 self.overallRC = results.get('overallRC')
2429 self.rc = results.get('rc')
2430 self.rs = results.get('rs')
2431 self.errmsg = results.get('errmsg')
2434class NoResourceClass(NovaException):
2435 msg_fmt = _("Resource class not found for Ironic node %(node)s.")
2438class ResourceProviderAllocationRetrievalFailed(NovaException):
2439 msg_fmt = _("Failed to retrieve allocations for resource provider "
2440 "%(rp_uuid)s: %(error)s")
2443class ConsumerAllocationRetrievalFailed(NovaException):
2444 msg_fmt = _("Failed to retrieve allocations for consumer "
2445 "%(consumer_uuid)s: %(error)s")
2448class ReshapeFailed(NovaException):
2449 msg_fmt = _("Resource provider inventory and allocation data migration "
2450 "failed: %(error)s")
2453class ReshapeNeeded(NovaException):
2454 msg_fmt = _("Virt driver indicates that provider inventories need to be "
2455 "moved.")
2458class FlavorImageConflict(NovaException):
2459 msg_fmt = _("Conflicting values for %(setting)s found in the flavor "
2460 "(%(flavor_val)s) and the image (%(image_val)s).")
2463class MissingDomainCapabilityFeatureException(NovaException):
2464 msg_fmt = _("Guest config could not be built without domain capabilities "
2465 "including <%(feature)s> feature.")
2468class HealAllocationException(NovaException):
2469 msg_fmt = _("Healing instance allocation failed.")
2472class HealvGPUAllocationNotSupported(HealAllocationException):
2473 msg_fmt = _(
2474 "Healing allocation for instance %(instance_uuid)s with vGPU resource "
2475 "request is not supported."
2476 )
2479class HealDeviceProfileAllocationNotSupported(HealAllocationException):
2480 msg_fmt = _(
2481 "Healing allocation for instance %(instance_uuid)s with Cyborg device "
2482 "profile request is not supported."
2483 )
2486class HealPortAllocationException(NovaException):
2487 msg_fmt = _("Healing port allocation failed.")
2490class UnableToQueryPorts(HealPortAllocationException):
2491 msg_fmt = _("Unable to query ports for instance %(instance_uuid)s: "
2492 "%(error)s")
2495class UnableToUpdatePorts(HealPortAllocationException):
2496 msg_fmt = _("Unable to update ports with allocations that are about to be "
2497 "created in placement: %(error)s. The healing of the "
2498 "instance is aborted. It is safe to try to heal the instance "
2499 "again.")
2502class UnableToRollbackPortUpdates(HealPortAllocationException):
2503 msg_fmt = _("Failed to update neutron ports with allocation keys and the "
2504 "automatic rollback of the previously successful port updates "
2505 "also failed: %(error)s. Make sure that the "
2506 "binding:profile.allocation key of the affected ports "
2507 "%(port_uuids)s are manually cleaned in neutron according to "
2508 "document https://docs.openstack.org/nova/latest/cli/"
2509 "nova-manage.html#placement. If you re-run the script without "
2510 "the manual fix then the missing allocation for these ports "
2511 "will not be healed in placement.")
2514class AssignedResourceNotFound(NovaException):
2515 msg_fmt = _("Assigned resources not found: %(reason)s")
2518class PMEMNamespaceConfigInvalid(NovaException):
2519 msg_fmt = _("The pmem_namespaces configuration is invalid: %(reason)s, "
2520 "please check your conf file. ")
2523class GetPMEMNamespacesFailed(NovaException):
2524 msg_fmt = _("Get PMEM namespaces on host failed: %(reason)s.")
2527class VPMEMCleanupFailed(NovaException):
2528 msg_fmt = _("Failed to clean up the vpmem backend device %(dev)s: "
2529 "%(error)s")
2532class RequestGroupSuffixConflict(NovaException):
2533 msg_fmt = _("Duplicate request group suffix %(suffix)s.")
2536class AmbiguousResourceProviderForPCIRequest(NovaException):
2537 msg_fmt = _("Allocating resources from multiple resource providers "
2538 "%(providers)s for a single pci request %(requester)s is not "
2539 "supported.")
2542class UnexpectedResourceProviderNameForPCIRequest(NovaException):
2543 msg_fmt = _("Resource provider %(provider)s used to allocate resources "
2544 "for the pci request %(requester)s does not have a properly "
2545 "formatted name. Expected name format is "
2546 "<hostname>:<agentname>:<interfacename>, but got "
2547 "%(provider_name)s")
2550class DeviceProfileError(NovaException):
2551 msg_fmt = _("Device profile name %(name)s: %(msg)s")
2554class AcceleratorRequestOpFailed(NovaException):
2555 msg_fmt = _("Failed to %(op)s accelerator requests: %(msg)s")
2558class AcceleratorRequestBindingFailed(NovaException):
2559 msg_fmt = _("Failed to bind accelerator requests: %(msg)s")
2561 def __init__(self, message=None, arqs=None, **kwargs):
2562 super(AcceleratorRequestBindingFailed, self).__init__(
2563 message=message, **kwargs)
2564 self.arqs = arqs or []
2567class InvalidLibvirtMdevConfig(NovaException):
2568 msg_fmt = _('Invalid configuration for mdev-capable devices: %(reason)s')
2571class RequiredMixedInstancePolicy(Invalid):
2572 msg_fmt = _("Cannot specify 'hw:cpu_dedicated_mask' without the "
2573 "'mixed' policy.")
2576class RequiredMixedOrRealtimeCPUMask(Invalid):
2577 msg_fmt = _("Dedicated CPU set can be specified from either "
2578 "'hw:cpu_dedicated_mask' or 'hw:cpu_realtime_mask' when "
2579 "using 'mixed' CPU policy. 'hw:cpu_dedicated_mask' and "
2580 "'hw:cpu_realtime_mask' can not be specified at the same "
2581 "time, or be specified with none of them.")
2584class MixedInstanceNotSupportByComputeService(NovaException):
2585 msg_fmt = _("To support 'mixed' policy instance 'nova-compute' service "
2586 "must be upgraded to 'Victoria' or later.")
2589class InvalidMixedInstanceDedicatedMask(Invalid):
2590 msg_fmt = _("Mixed instance must have at least 1 pinned vCPU and 1 "
2591 "unpinned vCPU. See 'hw:cpu_dedicated_mask'.")
2594class ProviderConfigException(NovaException):
2595 """Exception indicating an error occurred processing provider config files.
2597 This class is used to avoid a raised exception inadvertently being caught
2598 and mishandled by the resource tracker.
2599 """
2600 msg_fmt = _("An error occurred while processing "
2601 "a provider config file: %(error)s")
2604class PlacementPciException(NovaException):
2605 msg_fmt = _(
2606 "Failed to gather or report PCI resources to Placement: %(error)s")
2609class PlacementPciDependentDeviceException(PlacementPciException):
2610 msg_fmt = _(
2611 "Configuring both %(parent_dev)s and %(children_devs)s in "
2612 "[pci]device_spec is not supported. Either the parent PF or its "
2613 "children VFs can be configured."
2614 )
2617class PlacementPciMixedResourceClassException(PlacementPciException):
2618 msg_fmt = _(
2619 "VFs from the same PF cannot be configured with different "
2620 "'resource_class' values in [pci]device_spec. We got %(new_rc)s "
2621 "for %(new_dev)s and %(current_rc)s for %(current_devs)s."
2622 )
2625class PlacementPciMixedTraitsException(PlacementPciException):
2626 msg_fmt = _(
2627 "VFs from the same PF cannot be configured with different set "
2628 "of 'traits' in [pci]device_spec. We got %(new_traits)s for "
2629 "%(new_dev)s and %(current_traits)s for %(current_devs)s."
2630 )
2633class ReimageException(NovaException):
2634 msg_fmt = _("Reimaging volume failed.")
2637class InvalidNodeConfiguration(NovaException):
2638 msg_fmt = _('Invalid node identity configuration: %(reason)s')
2641class DuplicateRecord(NovaException):
2642 msg_fmt = _('Unable to create duplicate record for %(target)s')
2645class NotSupportedComputeForEvacuateV295(NotSupported):
2646 msg_fmt = _("Starting with microversion 2.95, evacuate API will stop "
2647 "instance on destination. To evacuate before upgrades are "
2648 "complete please use an older microversion. Required version "
2649 "for compute %(expected), current version %(currently)s")
2652class EphemeralEncryptionSecretNotFound(Invalid):
2653 msg_fmt = _(
2654 'Encryption secret %(secret_uuid)s was not found in the key manager')
2657class EphemeralEncryptionCleanupFailed(NovaException):
2658 msg_fmt = _("Failed to clean up ephemeral encryption secrets: "
2659 "%(error)s")
2662class HostConflict(Exception):
2663 pass