Coverage for nova/exception.py: 99%

1157 statements  

« 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. 

16 

17"""Nova base exception handling. 

18 

19Includes decorator for re-raising Nova-type exceptions. 

20 

21SHOULD include dedicated exception logging. 

22 

23""" 

24 

25from oslo_log import log as logging 

26 

27import webob.exc 

28from webob import util as woutil 

29 

30from nova.i18n import _ 

31 

32LOG = logging.getLogger(__name__) 

33 

34 

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__() 

56 

57 

58class NovaException(Exception): 

59 """Base Nova Exception 

60 

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. 

64 

65 """ 

66 msg_fmt = _("An unknown exception occurred.") 

67 code = 500 

68 headers = {} 

69 safe = False 

70 

71 def __init__(self, message=None, **kwargs): 

72 self.kwargs = kwargs 

73 

74 if 'code' not in self.kwargs: 

75 try: 

76 self.kwargs['code'] = self.code 

77 except AttributeError: 

78 pass 

79 

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 

90 

91 self.message = message 

92 super(NovaException, self).__init__(message) 

93 

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 

100 

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] 

105 

106 def __repr__(self): 

107 dict_repr = self.__dict__ 

108 dict_repr['class'] = self.__class__.__name__ 

109 return str(dict_repr) 

110 

111 

112class EncryptionFailure(NovaException): 

113 msg_fmt = _("Failed to encrypt text: %(reason)s") 

114 

115 

116class VirtualInterfaceCreateException(NovaException): 

117 msg_fmt = _("Virtual Interface creation failed") 

118 

119 

120class VirtualInterfaceMacAddressException(NovaException): 

121 msg_fmt = _("Creation of virtual interface with " 

122 "unique mac address failed") 

123 

124 

125class VirtualInterfacePlugException(NovaException): 

126 msg_fmt = _("Virtual interface plugin failed") 

127 

128 

129class VirtualInterfaceUnplugException(NovaException): 

130 msg_fmt = _("Failed to unplug virtual interface: %(reason)s") 

131 

132 

133class GlanceConnectionFailed(NovaException): 

134 msg_fmt = _("Connection to glance host %(server)s failed: " 

135 "%(reason)s") 

136 

137 

138class KeystoneConnectionFailed(NovaException): 

139 msg_fmt = _("Connection to keystone host failed: %(reason)s") 

140 

141 

142class CinderConnectionFailed(NovaException): 

143 msg_fmt = _("Connection to cinder host failed: %(reason)s") 

144 

145 

146class ManilaConnectionFailed(NovaException): 

147 msg_fmt = _("Connection to manila service failed: %(reason)s") 

148 

149 

150class UnsupportedCinderAPIVersion(NovaException): 

151 msg_fmt = _('Nova does not support Cinder API version %(version)s') 

152 

153 

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.') 

159 

160 

161class Forbidden(NovaException): 

162 msg_fmt = _("Forbidden") 

163 code = 403 

164 

165 

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 

176 

177 

178class ForbiddenWithAccelerators(NotSupported): 

179 msg_fmt = _("Feature not supported with instances that have accelerators.") 

180 

181 

182class ForbiddenSharesNotSupported(NotSupported): 

183 msg_fmt = _("Feature not supported until computes have not been updated.") 

184 

185 

186class ForbiddenSharesNotConfiguredCorrectly(NotSupported): 

187 msg_fmt = _("Feature not supported because either compute or instance " 

188 "are not configured correctly.") 

189 

190 

191class ForbiddenWithShare(NotSupported): 

192 msg_fmt = _("Feature not supported with instances that have shares.") 

193 

194 

195class ForbiddenPortsWithAccelerator(NotSupported): 

196 msg_fmt = _("Feature not supported with Ports that have accelerators.") 

197 

198 

199class ForbiddenWithRemoteManagedPorts(NotSupported): 

200 msg_fmt = _("This feature is not supported when remote-managed ports" 

201 " are in use.") 

202 

203 

204class AdminRequired(Forbidden): 

205 msg_fmt = _("User does not have admin privileges") 

206 

207 

208class PolicyNotAuthorized(Forbidden): 

209 msg_fmt = _("Policy doesn't allow %(action)s to be performed.") 

210 

211 

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.") 

216 

217 

218class ImageNotAuthorized(NovaException): 

219 msg_fmt = _("Not authorized for image %(image_id)s.") 

220 

221 

222class Invalid(NovaException): 

223 msg_fmt = _("Bad Request - Invalid Parameters") 

224 code = 400 

225 

226 

227class InvalidVIOMMUMachineType(Invalid): 

228 msg_fmt = _("vIOMMU is not supported by Current machine type %(mtype)s " 

229 "(Architecture: %(arch)s).") 

230 

231 

232class InvalidVIOMMUArchitecture(Invalid): 

233 msg_fmt = _("vIOMMU required either x86 or AArch64 architecture, " 

234 "but given architecture %(arch)s.") 

235 

236 

237class InstanceQuiesceFailed(Invalid): 

238 msg_fmt = _("Failed to quiesce instance: %(reason)s") 

239 code = 409 

240 

241 

242class InvalidConfiguration(Invalid): 

243 msg_fmt = _("Configuration is Invalid.") 

244 

245 

246class InvalidBDM(Invalid): 

247 msg_fmt = _("Block Device Mapping is Invalid.") 

248 

249 

250class InvalidBDMSnapshot(InvalidBDM): 

251 msg_fmt = _("Block Device Mapping is Invalid: " 

252 "failed to get snapshot %(id)s.") 

253 

254 

255class InvalidBDMVolume(InvalidBDM): 

256 msg_fmt = _("Block Device Mapping is Invalid: " 

257 "failed to get volume %(id)s.") 

258 

259 

260class InvalidBDMImage(InvalidBDM): 

261 msg_fmt = _("Block Device Mapping is Invalid: " 

262 "failed to get image %(id)s.") 

263 

264 

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.") 

270 

271 

272class InvalidBDMLocalsLimit(InvalidBDM): 

273 msg_fmt = _("Block Device Mapping is Invalid: " 

274 "You specified more local devices than the " 

275 "limit allows") 

276 

277 

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.") 

283 

284 

285class InvalidBDMSwapSize(InvalidBDM): 

286 msg_fmt = _("Swap drive requested is larger than instance type allows.") 

287 

288 

289class InvalidBDMFormat(InvalidBDM): 

290 msg_fmt = _("Block Device Mapping is Invalid: " 

291 "%(details)s") 

292 

293 

294class InvalidBDMForLegacy(InvalidBDM): 

295 msg_fmt = _("Block Device Mapping cannot " 

296 "be converted to legacy format. ") 

297 

298 

299class InvalidBDMVolumeNotBootable(InvalidBDM): 

300 msg_fmt = _("Block Device %(id)s is not bootable.") 

301 

302 

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 

307 

308 

309class InvalidBDMDiskBus(InvalidBDM): 

310 msg_fmr = _("Block Device Mapping is invalid: The provided disk bus " 

311 "%(disk_bus)s is not valid.") 

312 

313 

314class InvalidAttribute(Invalid): 

315 msg_fmt = _("Attribute not supported: %(attr)s") 

316 

317 

318class ValidationError(Invalid): 

319 msg_fmt = "%(detail)s" 

320 

321 

322class VolumeAttachFailed(Invalid): 

323 msg_fmt = _("Volume %(volume_id)s could not be attached. " 

324 "Reason: %(reason)s") 

325 

326 

327class VolumeDetachFailed(Invalid): 

328 msg_fmt = _("Volume %(volume_id)s could not be detached. " 

329 "Reason: %(reason)s") 

330 

331 

332class VolumeExtendFailed(Invalid): 

333 msg_fmt = _("Volume %(volume_id)s could not be extended. " 

334 "Reason: %(reason)s") 

335 

336 

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.") 

344 

345 

346class MultiattachNotSupportedOldMicroversion(Invalid): 

347 msg_fmt = _('Multiattach volumes are only supported starting with ' 

348 'compute API version 2.60.') 

349 

350 

351class MultiattachToShelvedNotSupported(Invalid): 

352 msg_fmt = _("Attaching multiattach volumes is not supported for " 

353 "shelved-offloaded instances.") 

354 

355 

356class MultiattachSwapVolumeNotSupported(Invalid): 

357 msg_fmt = _('Swapping multi-attach volumes with more than one read/write ' 

358 'attachment is not supported.') 

359 

360 

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.") 

365 

366 

367class ExtendVolumeNotSupported(Invalid): 

368 msg_fmt = _("Volume size extension is not supported by the hypervisor.") 

369 

370 

371class VolumeEncryptionNotSupported(Invalid): 

372 msg_fmt = _("Volume encryption is not supported for %(volume_type)s " 

373 "volume %(volume_id)s") 

374 

375 

376class VolumeTaggedAttachNotSupported(Invalid): 

377 msg_fmt = _("Tagged volume attachment is not supported for this server " 

378 "instance.") 

379 

380 

381class VolumeTaggedAttachToShelvedNotSupported(VolumeTaggedAttachNotSupported): 

382 msg_fmt = _("Tagged volume attachment is not supported for " 

383 "shelved-offloaded instances.") 

384 

385 

386class NetworkInterfaceTaggedAttachNotSupported(Invalid): 

387 msg_fmt = _("Tagged network interface attachment is not supported for " 

388 "this server instance.") 

389 

390 

391class InvalidKeypair(Invalid): 

392 msg_fmt = _("Keypair data is invalid: %(reason)s") 

393 

394 

395class InvalidRequest(Invalid): 

396 msg_fmt = _("The request is invalid.") 

397 

398 

399class InvalidInput(Invalid): 

400 msg_fmt = _("Invalid input received: %(reason)s") 

401 

402 

403class InvalidVolume(Invalid): 

404 msg_fmt = _("Invalid volume: %(reason)s") 

405 

406 

407class InvalidVolumeAccessMode(Invalid): 

408 msg_fmt = _("Invalid volume access mode: %(access_mode)s") 

409 

410 

411class StaleVolumeMount(InvalidVolume): 

412 msg_fmt = _("The volume mount at %(mount_path)s is unusable.") 

413 

414 

415class InvalidMetadata(Invalid): 

416 msg_fmt = _("Invalid metadata: %(reason)s") 

417 

418 

419class InvalidMetadataSize(Invalid): 

420 msg_fmt = _("Invalid metadata size: %(reason)s") 

421 

422 

423class InvalidPortRange(Invalid): 

424 msg_fmt = _("Invalid port range %(from_port)s:%(to_port)s. %(msg)s") 

425 

426 

427class InvalidIpProtocol(Invalid): 

428 msg_fmt = _("Invalid IP protocol %(protocol)s.") 

429 

430 

431class InvalidContentType(Invalid): 

432 msg_fmt = _("Invalid content type %(content_type)s.") 

433 

434 

435class InvalidAPIVersionString(Invalid): 

436 msg_fmt = _("API Version String %(version)s is of invalid format. Must " 

437 "be of format MajorNum.MinorNum.") 

438 

439 

440class VersionNotFoundForAPIMethod(Invalid): 

441 msg_fmt = _("API version %(version)s is not supported on this method.") 

442 

443 

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.") 

447 

448 

449class ApiVersionsIntersect(Invalid): 

450 msg_fmt = _("Version of %(name)s %(min_ver)s %(max_ver)s intersects " 

451 "with another versions.") 

452 

453 

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" 

458 

459 

460class InvalidAggregateAction(Invalid): 

461 msg_fmt = _("Unacceptable parameters.") 

462 code = 400 

463 

464 

465class InvalidAggregateActionAdd(InvalidAggregateAction): 

466 msg_fmt = _("Cannot add host to aggregate " 

467 "%(aggregate_id)s. Reason: %(reason)s.") 

468 

469 

470class InvalidAggregateActionDelete(InvalidAggregateAction): 

471 msg_fmt = _("Cannot remove host from aggregate " 

472 "%(aggregate_id)s. Reason: %(reason)s.") 

473 

474 

475class InvalidAggregateActionUpdate(InvalidAggregateAction): 

476 msg_fmt = _("Cannot update aggregate " 

477 "%(aggregate_id)s. Reason: %(reason)s.") 

478 

479 

480class InvalidAggregateActionUpdateMeta(InvalidAggregateAction): 

481 msg_fmt = _("Cannot update metadata of aggregate " 

482 "%(aggregate_id)s. Reason: %(reason)s.") 

483 

484 

485class AggregateMetadataKeyExists(NovaException): 

486 msg_fmt = _("Aggregate %(aggregate_id)s already contain metadata " 

487 "key %(key)s.") 

488 code = 400 

489 

490 

491class InvalidSortKey(Invalid): 

492 msg_fmt = _("Sort key supplied was not valid.") 

493 

494 

495class InvalidStrTime(Invalid): 

496 msg_fmt = _("Invalid datetime string: %(reason)s") 

497 

498 

499class InvalidNUMANodesNumber(Invalid): 

500 msg_fmt = _("The property 'numa_nodes' cannot be '%(nodes)s'. " 

501 "It must be a number greater than 0") 

502 

503 

504class InvalidName(Invalid): 

505 msg_fmt = _("An invalid 'name' value was provided. " 

506 "The name must be: %(reason)s") 

507 

508 

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.") 

512 

513 

514class InstanceNotRunning(Invalid): 

515 msg_fmt = _("Instance %(instance_id)s is not running.") 

516 

517 

518class InstanceNotInRescueMode(Invalid): 

519 msg_fmt = _("Instance %(instance_id)s is not in rescue mode") 

520 

521 

522class InstanceNotRescuable(Invalid): 

523 msg_fmt = _("Instance %(instance_id)s cannot be rescued: %(reason)s") 

524 

525 

526class InstanceNotReady(Invalid): 

527 msg_fmt = _("Instance %(instance_id)s is not ready") 

528 

529 

530class InstanceSuspendFailure(Invalid): 

531 msg_fmt = _("Failed to suspend instance: %(reason)s") 

532 

533 

534class InstanceResumeFailure(Invalid): 

535 msg_fmt = _("Failed to resume instance: %(reason)s") 

536 

537 

538class InstancePowerOnFailure(Invalid): 

539 msg_fmt = _("Failed to power on instance: %(reason)s") 

540 

541 

542class InstancePowerOffFailure(Invalid): 

543 msg_fmt = _("Failed to power off instance: %(reason)s") 

544 

545 

546class InstanceRebootFailure(Invalid): 

547 msg_fmt = _("Failed to reboot instance: %(reason)s") 

548 

549 

550class InstanceTerminationFailure(Invalid): 

551 msg_fmt = _("Failed to terminate instance: %(reason)s") 

552 

553 

554class InstanceDeployFailure(Invalid): 

555 msg_fmt = _("Failed to deploy instance: %(reason)s") 

556 

557 

558class MultiplePortsNotApplicable(Invalid): 

559 msg_fmt = _("Failed to launch instances: %(reason)s") 

560 

561 

562class AmbiguousHostnameForMultipleInstances(Invalid): 

563 msg_fmt = _("Unable to allocate a single hostname to multiple instances") 

564 

565 

566class InvalidFixedIpAndMaxCountRequest(Invalid): 

567 msg_fmt = _("Failed to launch instances: %(reason)s") 

568 

569 

570class ServiceUnavailable(Invalid): 

571 msg_fmt = _("Service is unavailable at this time.") 

572 

573 

574class ServiceNotUnique(Invalid): 

575 msg_fmt = _("More than one possible service found.") 

576 

577 

578class ComputeResourcesUnavailable(ServiceUnavailable): 

579 msg_fmt = _("Insufficient compute resources: %(reason)s.") 

580 

581 

582class HypervisorUnavailable(NovaException): 

583 msg_fmt = _("Connection to the hypervisor is broken on host") 

584 

585 

586class ComputeServiceUnavailable(ServiceUnavailable): 

587 msg_fmt = _("Compute service of %(host)s is unavailable at this time.") 

588 

589 

590class ComputeServiceInUse(NovaException): 

591 msg_fmt = _("Compute service of %(host)s is still in use.") 

592 

593 

594class UnableToMigrateToSelf(Invalid): 

595 msg_fmt = _("Unable to migrate instance (%(instance_id)s) " 

596 "to current host (%(host)s).") 

597 

598 

599class OperationNotSupportedForSEV(NotSupported): 

600 msg_fmt = _("Operation '%(operation)s' not supported for SEV-enabled " 

601 "instance (%(instance_uuid)s).") 

602 

603 

604class OperationNotSupportedForVTPM(NotSupported): 

605 msg_fmt = _("Operation '%(operation)s' not supported for vTPM-enabled " 

606 "instance (%(instance_uuid)s).") 

607 

608 

609class OperationNotSupportedForVDPAInterface(NotSupported): 

610 msg_fmt = _( 

611 "Operation '%(operation)s' not supported for instance with " 

612 "vDPA ports ((instance_uuid)s)." 

613 ) 

614 

615 

616class InvalidHypervisorType(Invalid): 

617 msg_fmt = _("The supplied hypervisor type of is invalid.") 

618 

619 

620class HypervisorTooOld(Invalid): 

621 msg_fmt = _("This compute node's hypervisor is older than the minimum " 

622 "supported version: %(version)s.") 

623 

624 

625class DestinationHypervisorTooOld(Invalid): 

626 msg_fmt = _("The instance requires a newer hypervisor version than " 

627 "has been provided.") 

628 

629 

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.") 

634 

635 

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.") 

642 

643 

644class DestinationDiskExists(Invalid): 

645 msg_fmt = _("The supplied disk path (%(path)s) already exists, " 

646 "it is expected not to exist.") 

647 

648 

649class InvalidDevicePath(Invalid): 

650 msg_fmt = _("The supplied device path (%(path)s) is invalid.") 

651 

652 

653class DevicePathInUse(Invalid): 

654 msg_fmt = _("The supplied device path (%(path)s) is in use.") 

655 code = 409 

656 

657 

658class InvalidCPUInfo(Invalid): 

659 msg_fmt = _("Unacceptable CPU info: %(reason)s") 

660 

661 

662class InvalidIpAddressError(Invalid): 

663 msg_fmt = _("%(address)s is not a valid IP v4/6 address.") 

664 

665 

666class InvalidDiskFormat(Invalid): 

667 msg_fmt = _("Disk format %(disk_format)s is not acceptable") 

668 

669 

670class InvalidDiskInfo(Invalid): 

671 msg_fmt = _("Disk info file is invalid: %(reason)s") 

672 

673 

674class DiskInfoReadWriteFail(Invalid): 

675 msg_fmt = _("Failed to read or write disk info file: %(reason)s") 

676 

677 

678class ImageUnacceptable(Invalid): 

679 msg_fmt = _("Image %(image_id)s is unacceptable: %(reason)s") 

680 

681 

682class ImageBadRequest(Invalid): 

683 msg_fmt = _("Request of image %(image_id)s got BadRequest response: " 

684 "%(response)s") 

685 

686 

687class ImageImportImpossible(Invalid): 

688 msg_fmt = _("Import of image %(image_id)s refused: %(reason)s") 

689 

690 

691class ImageQuotaExceeded(NovaException): 

692 msg_fmt = _("Quota exceeded or out of space for image %(image_id)s " 

693 "in the image service.") 

694 

695 

696class InstanceUnacceptable(Invalid): 

697 msg_fmt = _("Instance %(instance_id)s is unacceptable: %(reason)s") 

698 

699 

700class InvalidUUID(Invalid): 

701 msg_fmt = _("Expected a uuid but received %(uuid)s.") 

702 

703 

704class InvalidID(Invalid): 

705 msg_fmt = _("Invalid ID received %(id)s.") 

706 

707 

708class ConstraintNotMet(NovaException): 

709 msg_fmt = _("Constraint not met.") 

710 code = 412 

711 

712 

713class NotFound(NovaException): 

714 msg_fmt = _("Resource could not be found.") 

715 code = 404 

716 

717 

718class VolumeAttachmentNotFound(NotFound): 

719 msg_fmt = _("Volume attachment %(attachment_id)s could not be found.") 

720 

721 

722class VolumeNotFound(NotFound): 

723 msg_fmt = _("Volume %(volume_id)s could not be found.") 

724 

725 

726class ShareNotFound(NotFound): 

727 msg_fmt = _("Share %(share_id)s could not be found.") 

728 

729 

730class ShareStatusIncorect(NotFound): 

731 msg_fmt = _("Share %(share_id)s is in '%(status)s' instead of " 

732 "'available' status.") 

733 

734 

735class ShareMappingAlreadyExists(NotFound): 

736 msg_fmt = _("Share '%(share_id)s' or tag '%(tag)s' already associated " 

737 "to this server.") 

738 

739 

740class ShareProtocolNotSupported(NotFound): 

741 msg_fmt = _("Share protocol %(share_proto)s is not supported.") 

742 

743 

744class ShareMissingExportLocation(NotFound): 

745 msg_fmt = _("Share %(share_id)s export location is missing.") 

746 

747 

748class ShareError(NovaException): 

749 msg_fmt = _("Share %(share_id)s used by instance %(instance_uuid)s " 

750 "is in error state.") 

751 

752 

753class ShareErrorUnexpectedStatus(NovaException): 

754 msg_fmt = _("Share %(share_id)s used by instance %(instance_uuid)s " 

755 "is in an unexpected state.") 

756 

757 

758class ShareUmountError(NovaException): 

759 msg_fmt = _("Share id %(share_id)s umount error " 

760 "from server %(server_id)s.\n" 

761 "Reason: %(reason)s.") 

762 

763 

764class ShareMountError(NovaException): 

765 msg_fmt = _("Share id %(share_id)s mount error " 

766 "from server %(server_id)s.\n" 

767 "Reason: %(reason)s.") 

768 

769 

770class ShareAccessNotFound(NotFound): 

771 msg_fmt = _("Share access from Manila could not be found for " 

772 "share id %(share_id)s.") 

773 

774 

775class ShareAccessGrantError(NovaException): 

776 msg_fmt = _("Share access could not be granted to " 

777 "share id %(share_id)s.\n" 

778 "Reason: %(reason)s.") 

779 

780 

781class ShareAccessRemovalError(NovaException): 

782 msg_fmt = _("Share access could not be removed from " 

783 "share id %(share_id)s.\n" 

784 "Reason: %(reason)s.") 

785 

786 

787class ShareLockNotFound(NovaException): 

788 msg_fmt = _("Share lock can not be found for " 

789 "share id %(share_id)s.\n") 

790 

791 

792class ShareLockError(NovaException): 

793 msg_fmt = _("Share lock can not be acquired from " 

794 "share id %(share_id)s.\n" 

795 "Reason: %(reason)s.") 

796 

797 

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.") 

802 

803 

804class ShareUnlockError(NovaException): 

805 msg_fmt = _("Share can not be unlocked from " 

806 "share id %(share_id)s.\n" 

807 "Reason: %(reason)s.") 

808 

809 

810class VolumeTypeNotFound(NotFound): 

811 msg_fmt = _("Volume type %(id_or_name)s could not be found.") 

812 

813 

814class UndefinedRootBDM(NovaException): 

815 msg_fmt = _("Undefined Block Device Mapping root: BlockDeviceMappingList " 

816 "contains Block Device Mappings from multiple instances.") 

817 

818 

819class BDMNotFound(NotFound): 

820 msg_fmt = _("No Block Device Mapping with id %(id)s.") 

821 

822 

823class VolumeBDMNotFound(NotFound): 

824 msg_fmt = _("No volume Block Device Mapping with id %(volume_id)s.") 

825 

826 

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.") 

830 

831 

832class VolumeBDMPathNotFound(VolumeBDMNotFound): 

833 msg_fmt = _("No volume Block Device Mapping at path: %(path)s") 

834 

835 

836class DeviceDetachFailed(NovaException): 

837 msg_fmt = _("Device detach failed for %(device)s: %(reason)s") 

838 

839 

840class DeviceNotFound(NotFound): 

841 msg_fmt = _("Device '%(device)s' not found.") 

842 

843 

844class SnapshotNotFound(NotFound): 

845 msg_fmt = _("Snapshot %(snapshot_id)s could not be found.") 

846 

847 

848class DiskNotFound(NotFound): 

849 msg_fmt = _("No disk at %(location)s") 

850 

851 

852class VolumeDriverNotFound(NotFound): 

853 msg_fmt = _("Could not find a handler for %(driver_type)s volume.") 

854 

855 

856class VolumeDriverNotSupported(VolumeDriverNotFound): 

857 msg_fmt = _("The %(volume_driver)s volume driver is not supported on this " 

858 "platform.") 

859 

860 

861class InvalidImageRef(Invalid): 

862 msg_fmt = _("Invalid image href %(image_href)s.") 

863 

864 

865class InvalidImagePropertyName(Invalid): 

866 msg_fmt = _("Invalid image property name %(image_property_name)s.") 

867 

868 

869class AutoDiskConfigDisabledByImage(Invalid): 

870 msg_fmt = _("Requested image %(image)s " 

871 "has automatic disk resize disabled.") 

872 

873 

874class ImageNotFound(NotFound): 

875 msg_fmt = _("Image %(image_id)s could not be found.") 

876 

877 

878class ImageDeleteConflict(NovaException): 

879 msg_fmt = _("Conflict deleting image. Reason: %(reason)s.") 

880 

881 

882class PreserveEphemeralNotSupported(Invalid): 

883 msg_fmt = _("The current driver does not support " 

884 "preserving ephemeral partitions.") 

885 

886 

887class InstanceMappingNotFound(NotFound): 

888 msg_fmt = _("Instance %(uuid)s has no mapping to a cell.") 

889 

890 

891class InvalidCidr(Invalid): 

892 msg_fmt = _("%(cidr)s is not a valid IP network.") 

893 

894 

895class NetworkNotFound(NotFound): 

896 msg_fmt = _("Network %(network_id)s could not be found.") 

897 

898 

899class PortNotFound(NotFound): 

900 msg_fmt = _("Port id %(port_id)s could not be found.") 

901 

902 

903class NetworkNotFoundForBridge(NetworkNotFound): 

904 msg_fmt = _("Network could not be found for bridge %(bridge)s") 

905 

906 

907class NetworkNotFoundForInstance(NetworkNotFound): 

908 msg_fmt = _("Network could not be found for instance %(instance_id)s.") 

909 

910 

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.") 

914 

915 

916class UnableToAutoAllocateNetwork(Invalid): 

917 msg_fmt = _('Unable to automatically allocate a network for project ' 

918 '%(project_id)s') 

919 

920 

921class NetworkRequiresSubnet(Invalid): 

922 msg_fmt = _("Network %(network_uuid)s requires a subnet in order to boot" 

923 " instances on.") 

924 

925 

926class ExternalNetworkAttachForbidden(Forbidden): 

927 msg_fmt = _("It is not allowed to create an interface on " 

928 "external network %(network_uuid)s") 

929 

930 

931class NetworkMissingPhysicalNetwork(NovaException): 

932 msg_fmt = _("Physical network is missing for network %(network_uuid)s") 

933 

934 

935class VifDetailsMissingVhostuserSockPath(Invalid): 

936 msg_fmt = _("vhostuser_sock_path not present in vif_details" 

937 " for vif %(vif_id)s") 

938 

939 

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.") 

945 

946 

947class DatastoreNotFound(NotFound): 

948 msg_fmt = _("Could not find the datastore reference(s) which the VM uses.") 

949 

950 

951class PortInUse(Invalid): 

952 msg_fmt = _("Port %(port_id)s is still in use.") 

953 

954 

955class PortRequiresFixedIP(Invalid): 

956 msg_fmt = _("Port %(port_id)s requires a FixedIP in order to be used.") 

957 

958 

959class PortNotUsable(Invalid): 

960 msg_fmt = _("Port %(port_id)s not usable for instance %(instance)s.") 

961 

962 

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") 

967 

968 

969class PortBindingFailed(Invalid): 

970 msg_fmt = _("Binding failed for port %(port_id)s, please check neutron " 

971 "logs for more information.") 

972 

973 

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") 

977 

978 

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") 

982 

983 

984class PortUpdateFailed(Invalid): 

985 msg_fmt = _("Port update failed for port %(port_id)s: %(reason)s") 

986 

987 

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.') 

992 

993 

994class FixedIpNotFoundForAddress(NotFound): 

995 msg_fmt = _("Fixed IP not found for address %(address)s.") 

996 

997 

998class FixedIpNotFoundForInstance(NotFound): 

999 msg_fmt = _("Instance %(instance_uuid)s does not have fixed IP '%(ip)s'.") 

1000 

1001 

1002class FixedIpAlreadyInUse(NovaException): 

1003 msg_fmt = _("Fixed IP address %(address)s is already in use on instance " 

1004 "%(instance_uuid)s.") 

1005 

1006 

1007class FixedIpAssociatedWithMultipleInstances(NovaException): 

1008 msg_fmt = _("More than one instance is associated with fixed IP address " 

1009 "'%(address)s'.") 

1010 

1011 

1012class FixedIpInvalidOnHost(Invalid): 

1013 msg_fmt = _("The fixed IP associated with port %(port_id)s is not " 

1014 "compatible with the host.") 

1015 

1016 

1017class NoMoreFixedIps(NovaException): 

1018 msg_fmt = _("No fixed IP addresses available for network: %(net)s") 

1019 

1020 

1021class FloatingIpNotFound(NotFound): 

1022 msg_fmt = _("Floating IP not found for ID %(id)s.") 

1023 

1024 

1025class FloatingIpNotFoundForAddress(FloatingIpNotFound): 

1026 msg_fmt = _("Floating IP not found for address %(address)s.") 

1027 

1028 

1029class FloatingIpMultipleFoundForAddress(NovaException): 

1030 msg_fmt = _("Multiple floating IPs are found for address %(address)s.") 

1031 

1032 

1033class FloatingIpPoolNotFound(NotFound): 

1034 msg_fmt = _("Floating IP pool not found.") 

1035 safe = True 

1036 

1037 

1038class NoMoreFloatingIps(FloatingIpNotFound): 

1039 msg_fmt = _("Zero floating IPs available.") 

1040 safe = True 

1041 

1042 

1043class FloatingIpAssociated(NovaException): 

1044 msg_fmt = _("Floating IP %(address)s is associated.") 

1045 

1046 

1047class NoFloatingIpInterface(NotFound): 

1048 msg_fmt = _("Interface %(interface)s not found.") 

1049 

1050 

1051class FloatingIpAssociateFailed(NovaException): 

1052 msg_fmt = _("Floating IP %(address)s association has failed.") 

1053 

1054 

1055class FloatingIpBadRequest(Invalid): 

1056 msg_fmt = _("The floating IP request failed with a BadRequest") 

1057 

1058 

1059class KeypairNotFound(NotFound): 

1060 msg_fmt = _("Keypair %(name)s not found for user %(user_id)s") 

1061 

1062 

1063class ServiceNotFound(NotFound): 

1064 msg_fmt = _("Service %(service_id)s could not be found.") 

1065 

1066 

1067class ConfGroupForServiceTypeNotFound(ServiceNotFound): 

1068 msg_fmt = _("No conf group name could be found for service type " 

1069 "%(stype)s.") 

1070 

1071 

1072class ServiceBinaryExists(NovaException): 

1073 msg_fmt = _("Service with host %(host)s binary %(binary)s exists.") 

1074 

1075 

1076class ServiceTopicExists(NovaException): 

1077 msg_fmt = _("Service with host %(host)s topic %(topic)s exists.") 

1078 

1079 

1080class HostNotFound(NotFound): 

1081 msg_fmt = _("Host %(host)s could not be found.") 

1082 

1083 

1084class ComputeHostNotFound(HostNotFound): 

1085 msg_fmt = _("Compute host %(host)s could not be found.") 

1086 

1087 

1088class HostBinaryNotFound(NotFound): 

1089 msg_fmt = _("Could not find binary %(binary)s on host %(host)s.") 

1090 

1091 

1092class InvalidQuotaValue(Invalid): 

1093 msg_fmt = _("Change would make usage less than 0 for the following " 

1094 "resources: %(unders)s") 

1095 

1096 

1097class InvalidQuotaMethodUsage(Invalid): 

1098 msg_fmt = _("Wrong quota method %(method)s used on resource %(res)s") 

1099 

1100 

1101class QuotaNotFound(NotFound): 

1102 msg_fmt = _("Quota could not be found") 

1103 

1104 

1105class QuotaExists(NovaException): 

1106 msg_fmt = _("Quota exists for project %(project_id)s, " 

1107 "resource %(resource)s") 

1108 

1109 

1110class QuotaResourceUnknown(QuotaNotFound): 

1111 msg_fmt = _("Unknown quota resources %(unknown)s.") 

1112 

1113 

1114class ProjectUserQuotaNotFound(QuotaNotFound): 

1115 msg_fmt = _("Quota for user %(user_id)s in project %(project_id)s " 

1116 "could not be found.") 

1117 

1118 

1119class ProjectQuotaNotFound(QuotaNotFound): 

1120 msg_fmt = _("Quota for project %(project_id)s could not be found.") 

1121 

1122 

1123class QuotaClassNotFound(QuotaNotFound): 

1124 msg_fmt = _("Quota class %(class_name)s could not be found.") 

1125 

1126 

1127class QuotaClassExists(NovaException): 

1128 msg_fmt = _("Quota class %(class_name)s exists for resource %(resource)s") 

1129 

1130 

1131class SecurityGroupNotFound(NotFound): 

1132 msg_fmt = _("Security group %(security_group_id)s not found.") 

1133 

1134 

1135class SecurityGroupNotFoundForProject(SecurityGroupNotFound): 

1136 msg_fmt = _("Security group %(security_group_id)s not found " 

1137 "for project %(project_id)s.") 

1138 

1139 

1140class SecurityGroupExists(Invalid): 

1141 msg_fmt = _("Security group %(security_group_name)s already exists " 

1142 "for project %(project_id)s.") 

1143 

1144 

1145class SecurityGroupCannotBeApplied(Invalid): 

1146 msg_fmt = _("Network requires port_security_enabled and subnet associated" 

1147 " in order to apply security groups.") 

1148 

1149 

1150class SecurityGroupConnectionStateConflict(Invalid): 

1151 code = 409 

1152 msg_fmt = _("Cannot apply both stateful and stateless security groups on " 

1153 "the same port.") 

1154 

1155 

1156class NoUniqueMatch(NovaException): 

1157 msg_fmt = _("No Unique Match Found.") 

1158 code = 409 

1159 

1160 

1161class NoActiveMigrationForInstance(NotFound): 

1162 msg_fmt = _("Active live migration for instance %(instance_id)s not found") 

1163 

1164 

1165class MigrationNotFound(NotFound): 

1166 msg_fmt = _("Migration %(migration_id)s could not be found.") 

1167 

1168 

1169class MigrationNotFoundByStatus(MigrationNotFound): 

1170 msg_fmt = _("Migration not found for instance %(instance_id)s " 

1171 "with status %(status)s.") 

1172 

1173 

1174class MigrationNotFoundForInstance(MigrationNotFound): 

1175 msg_fmt = _("Migration %(migration_id)s not found for instance " 

1176 "%(instance_id)s") 

1177 

1178 

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.") 

1183 

1184 

1185class ConsoleLogOutputException(NovaException): 

1186 msg_fmt = _("Console log output could not be retrieved for instance " 

1187 "%(instance_id)s. Reason: %(reason)s") 

1188 

1189 

1190class ConsoleNotAvailable(NotFound): 

1191 msg_fmt = _("Guest does not have a console available.") 

1192 

1193 

1194class ConsoleTypeInvalid(Invalid): 

1195 msg_fmt = _("Invalid console type %(console_type)s") 

1196 

1197 

1198class ConsoleTypeUnavailable(Invalid): 

1199 msg_fmt = _("Unavailable console type %(console_type)s.") 

1200 

1201 

1202class ConsolePortRangeExhausted(NovaException): 

1203 msg_fmt = _("The console port range %(min_port)d-%(max_port)d is " 

1204 "exhausted.") 

1205 

1206 

1207class FlavorNotFound(NotFound): 

1208 msg_fmt = _("Flavor %(flavor_id)s could not be found.") 

1209 

1210 

1211class FlavorNotFoundByName(FlavorNotFound): 

1212 msg_fmt = _("Flavor with name %(flavor_name)s could not be found.") 

1213 

1214 

1215class FlavorAccessNotFound(NotFound): 

1216 msg_fmt = _("Flavor access not found for %(flavor_id)s / " 

1217 "%(project_id)s combination.") 

1218 

1219 

1220class FlavorExtraSpecUpdateCreateFailed(NovaException): 

1221 msg_fmt = _("Flavor %(id)s extra spec cannot be updated or created " 

1222 "after %(retries)d retries.") 

1223 

1224 

1225class CellTimeout(NotFound): 

1226 msg_fmt = _("Timeout waiting for response from cell") 

1227 

1228 

1229class SchedulerHostFilterNotFound(NotFound): 

1230 msg_fmt = _("Scheduler Host Filter %(filter_name)s could not be found.") 

1231 

1232 

1233class FlavorExtraSpecsNotFound(NotFound): 

1234 msg_fmt = _("Flavor %(flavor_id)s has no extra specs with " 

1235 "key %(extra_specs_key)s.") 

1236 

1237 

1238class ComputeHostMetricNotFound(NotFound): 

1239 msg_fmt = _("Metric %(name)s could not be found on the compute " 

1240 "host node %(host)s.%(node)s.") 

1241 

1242 

1243class FileNotFound(NotFound): 

1244 msg_fmt = _("File %(file_path)s could not be found.") 

1245 

1246 

1247class DeviceBusy(NovaException): 

1248 msg_fmt = _("device %(file_path)s is busy.") 

1249 

1250 

1251class ClassNotFound(NotFound): 

1252 msg_fmt = _("Class %(class_name)s could not be found: %(exception)s") 

1253 

1254 

1255class InstanceTagNotFound(NotFound): 

1256 msg_fmt = _("Instance %(instance_id)s has no tag '%(tag)s'") 

1257 

1258 

1259class KeyPairExists(NovaException): 

1260 msg_fmt = _("Key pair '%(key_name)s' already exists.") 

1261 

1262 

1263class InstanceExists(NovaException): 

1264 msg_fmt = _("Instance %(name)s already exists.") 

1265 

1266 

1267class FlavorExists(NovaException): 

1268 msg_fmt = _("Flavor with name %(name)s already exists.") 

1269 

1270 

1271class FlavorIdExists(NovaException): 

1272 msg_fmt = _("Flavor with ID %(flavor_id)s already exists.") 

1273 

1274 

1275class FlavorAccessExists(NovaException): 

1276 msg_fmt = _("Flavor access already exists for flavor %(flavor_id)s " 

1277 "and project %(project_id)s combination.") 

1278 

1279 

1280class InvalidSharedStorage(NovaException): 

1281 msg_fmt = _("%(path)s is not on shared storage: %(reason)s") 

1282 

1283 

1284class InvalidLocalStorage(NovaException): 

1285 msg_fmt = _("%(path)s is not on local storage: %(reason)s") 

1286 

1287 

1288class StorageError(NovaException): 

1289 msg_fmt = _("Storage error: %(reason)s") 

1290 

1291 

1292class MigrationError(NovaException): 

1293 msg_fmt = _("Migration error: %(reason)s") 

1294 

1295 

1296class MigrationPreCheckError(MigrationError): 

1297 msg_fmt = _("Migration pre-check error: %(reason)s") 

1298 

1299 

1300class MigrationSchedulerRPCError(MigrationError): 

1301 msg_fmt = _("Migration select destinations error: %(reason)s") 

1302 

1303 

1304class MalformedRequestBody(NovaException): 

1305 msg_fmt = _("Malformed message body: %(reason)s") 

1306 

1307 

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") 

1312 

1313 

1314class PasteAppNotFound(NovaException): 

1315 msg_fmt = _("Could not load paste app '%(name)s' from %(path)s") 

1316 

1317 

1318class CannotResizeToSameFlavor(NovaException): 

1319 msg_fmt = _("When resizing, instances must change flavor!") 

1320 

1321 

1322class ResizeError(NovaException): 

1323 msg_fmt = _("Resize error: %(reason)s") 

1324 

1325 

1326class CannotResizeDisk(NovaException): 

1327 msg_fmt = _("Server disk was unable to be resized because: %(reason)s") 

1328 

1329 

1330class FlavorMemoryTooSmall(NovaException): 

1331 msg_fmt = _("Flavor's memory is too small for requested image.") 

1332 

1333 

1334class FlavorDiskTooSmall(NovaException): 

1335 msg_fmt = _("The created instance's disk would be too small.") 

1336 

1337 

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.") 

1341 

1342 

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.") 

1347 

1348 

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.") 

1353 

1354 

1355class BootFromVolumeRequiredForZeroDiskFlavor(Forbidden): 

1356 msg_fmt = _("Only volume-backed servers are allowed for flavors with " 

1357 "zero disk.") 

1358 

1359 

1360class NoValidHost(NovaException): 

1361 msg_fmt = _("No valid host was found. %(reason)s") 

1362 

1363 

1364class RequestFilterFailed(NovaException): 

1365 msg_fmt = _("Scheduling failed: %(reason)s") 

1366 

1367 

1368class InvalidRoutedNetworkConfiguration(NovaException): 

1369 msg_fmt = _("Neutron routed networks configuration is invalid: " 

1370 "%(reason)s.") 

1371 

1372 

1373class MaxRetriesExceeded(NoValidHost): 

1374 msg_fmt = _("Exceeded maximum number of retries. %(reason)s") 

1375 

1376 

1377class OverQuota(NovaException): 

1378 msg_fmt = _("Quota exceeded for resources: %(overs)s") 

1379 code = 413 

1380 safe = True 

1381 

1382 

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") 

1386 

1387 

1388class FloatingIpLimitExceeded(OverQuota): 

1389 msg_fmt = _("Maximum number of floating IPs exceeded") 

1390 

1391 

1392class MetadataLimitExceeded(OverQuota): 

1393 msg_fmt = _("Maximum number of metadata items exceeds %(allowed)d") 

1394 

1395 

1396class OnsetFileLimitExceeded(OverQuota): 

1397 msg_fmt = _("Personality file limit exceeded") 

1398 

1399 

1400class OnsetFilePathLimitExceeded(OnsetFileLimitExceeded): 

1401 msg_fmt = _("Personality file path exceeds maximum %(allowed)s") 

1402 

1403 

1404class OnsetFileContentLimitExceeded(OnsetFileLimitExceeded): 

1405 msg_fmt = _("Personality file content exceeds maximum %(allowed)s") 

1406 

1407 

1408class KeypairLimitExceeded(OverQuota): 

1409 msg_fmt = _("Quota exceeded, too many key pairs.") 

1410 

1411 

1412class SecurityGroupLimitExceeded(OverQuota): 

1413 msg_fmt = _("Maximum number of security groups or rules exceeded") 

1414 

1415 

1416class PortLimitExceeded(OverQuota): 

1417 msg_fmt = _("Maximum number of ports exceeded") 

1418 

1419 

1420class ServerGroupLimitExceeded(OverQuota): 

1421 msg_fmt = _("Quota exceeded, too many server groups.") 

1422 

1423 

1424class GroupMemberLimitExceeded(OverQuota): 

1425 msg_fmt = _("Quota exceeded, too many servers in group") 

1426 

1427 

1428class AggregateNotFound(NotFound): 

1429 msg_fmt = _("Aggregate %(aggregate_id)s could not be found.") 

1430 

1431 

1432class AggregateNameExists(NovaException): 

1433 msg_fmt = _("Aggregate %(aggregate_name)s already exists.") 

1434 

1435 

1436class AggregateHostNotFound(NotFound): 

1437 msg_fmt = _("Aggregate %(aggregate_id)s has no host %(host)s.") 

1438 

1439 

1440class AggregateMetadataNotFound(NotFound): 

1441 msg_fmt = _("Aggregate %(aggregate_id)s has no metadata with " 

1442 "key %(metadata_key)s.") 

1443 

1444 

1445class AggregateHostExists(NovaException): 

1446 msg_fmt = _("Aggregate %(aggregate_id)s already has host %(host)s.") 

1447 

1448 

1449class InstancePasswordSetFailed(NovaException): 

1450 msg_fmt = _("Failed to set admin password on %(instance)s " 

1451 "because %(reason)s") 

1452 safe = True 

1453 

1454 

1455class InstanceNotFound(NotFound): 

1456 msg_fmt = _("Instance %(instance_id)s could not be found.") 

1457 

1458 

1459class InstanceInfoCacheNotFound(NotFound): 

1460 msg_fmt = _("Info cache for instance %(instance_uuid)s could not be " 

1461 "found.") 

1462 

1463 

1464class MarkerNotFound(NotFound): 

1465 msg_fmt = _("Marker %(marker)s could not be found.") 

1466 

1467 

1468class CouldNotFetchImage(NovaException): 

1469 msg_fmt = _("Could not fetch image %(image_id)s") 

1470 

1471 

1472class CouldNotUploadImage(NovaException): 

1473 msg_fmt = _("Could not upload image %(image_id)s") 

1474 

1475 

1476class TaskAlreadyRunning(NovaException): 

1477 msg_fmt = _("Task %(task_name)s is already running on host %(host)s") 

1478 

1479 

1480class TaskNotRunning(NovaException): 

1481 msg_fmt = _("Task %(task_name)s is not running on host %(host)s") 

1482 

1483 

1484class InstanceIsLocked(InstanceInvalidState): 

1485 msg_fmt = _("Instance %(instance_uuid)s is locked") 

1486 

1487 

1488class ConfigDriveInvalidValue(Invalid): 

1489 msg_fmt = _("Invalid value for Config Drive option: %(option)s") 

1490 

1491 

1492class ConfigDriveUnsupportedFormat(Invalid): 

1493 msg_fmt = _("Config drive format '%(format)s' is not supported.") 

1494 

1495 

1496class ConfigDriveMountFailed(NovaException): 

1497 msg_fmt = _("Could not mount vfat config drive. %(operation)s failed. " 

1498 "Error: %(error)s") 

1499 

1500 

1501class ConfigDriveUnknownFormat(NovaException): 

1502 msg_fmt = _("Unknown config drive format %(format)s. Select one of " 

1503 "iso9660 or vfat.") 

1504 

1505 

1506class ConfigDriveNotFound(NotFound): 

1507 msg_fmt = _("Instance %(instance_uuid)s requires config drive, but it " 

1508 "does not exist.") 

1509 

1510 

1511class InterfaceAttachFailed(NovaException): 

1512 msg_fmt = _("Failed to attach network adapter device to " 

1513 "%(instance_uuid)s") 

1514 

1515 

1516class InterfaceAttachFailedNoNetwork(Invalid): 

1517 msg_fmt = _("No specific network was requested and none are available " 

1518 "for project '%(project_id)s'.") 

1519 

1520 

1521class InterfaceAttachPciClaimFailed(Invalid): 

1522 msg_fmt = _("Failed to claim PCI device for %(instance_uuid)s during " 

1523 "interface attach") 

1524 

1525 

1526class InterfaceAttachResourceAllocationFailed(Invalid): 

1527 msg_fmt = _("Failed to allocate additional resources to %(instance_uuid)s " 

1528 "during interface attach") 

1529 

1530 

1531class InterfaceDetachFailed(Invalid): 

1532 msg_fmt = _("Failed to detach network adapter device from " 

1533 "%(instance_uuid)s") 

1534 

1535 

1536class InstanceUserDataMalformed(NovaException): 

1537 msg_fmt = _("User data needs to be valid base 64.") 

1538 

1539 

1540class InstanceUpdateConflict(NovaException): 

1541 msg_fmt = _("Conflict updating instance %(instance_uuid)s. " 

1542 "Expected: %(expected)s. Actual: %(actual)s") 

1543 

1544 

1545class UnknownInstanceUpdateConflict(InstanceUpdateConflict): 

1546 msg_fmt = _("Conflict updating instance %(instance_uuid)s, but we were " 

1547 "unable to determine the cause") 

1548 

1549 

1550class UnexpectedTaskStateError(InstanceUpdateConflict): 

1551 pass 

1552 

1553 

1554class UnexpectedDeletingTaskStateError(UnexpectedTaskStateError): 

1555 pass 

1556 

1557 

1558class InstanceActionNotFound(NovaException): 

1559 msg_fmt = _("Action for request_id %(request_id)s on instance" 

1560 " %(instance_uuid)s not found") 

1561 

1562 

1563class InstanceActionEventNotFound(NovaException): 

1564 msg_fmt = _("Event %(event)s not found for action id %(action_id)s") 

1565 

1566 

1567class InstanceEvacuateNotSupported(Invalid): 

1568 msg_fmt = _('Instance evacuate is not supported.') 

1569 

1570 

1571class InstanceEvacuateNotSupportedTargetState(Invalid): 

1572 msg_fmt = _("Target state '%(target_state)s' for instance evacuate " 

1573 "is not supported.") 

1574 

1575 

1576class DBNotAllowed(NovaException): 

1577 msg_fmt = _('%(binary)s attempted direct database access which is ' 

1578 'not allowed by policy') 

1579 

1580 

1581class UnsupportedVirtType(Invalid): 

1582 msg_fmt = _("Virtualization type '%(virt)s' is not supported by " 

1583 "this compute driver") 

1584 

1585 

1586class UnsupportedHardware(Invalid): 

1587 msg_fmt = _("Requested hardware '%(model)s' is not supported by " 

1588 "the '%(virt)s' virt driver") 

1589 

1590 

1591class UnsupportedRescueBus(Invalid): 

1592 msg_fmt = _("Requested rescue bus '%(bus)s' is not supported by " 

1593 "the '%(virt)s' virt driver") 

1594 

1595 

1596class UnsupportedRescueDevice(Invalid): 

1597 msg_fmt = _("Requested rescue device '%(device)s' is not supported") 

1598 

1599 

1600class UnsupportedRescueImage(Invalid): 

1601 msg_fmt = _("Requested rescue image '%(image)s' is not supported") 

1602 

1603 

1604class UnsupportedRPCVersion(Invalid): 

1605 msg_fmt = _("Unsupported RPC version for %(api)s. " 

1606 "Required >= %(required)s") 

1607 

1608 

1609class Base64Exception(NovaException): 

1610 msg_fmt = _("Invalid Base 64 data for file %(path)s") 

1611 

1612 

1613class BuildAbortException(NovaException): 

1614 msg_fmt = _("Build of instance %(instance_uuid)s aborted: %(reason)s") 

1615 

1616 

1617class RescheduledException(NovaException): 

1618 msg_fmt = _("Build of instance %(instance_uuid)s was re-scheduled: " 

1619 "%(reason)s") 

1620 

1621 

1622class RescheduledByPolicyException(RescheduledException): 

1623 msg_fmt = _("Build of instance %(instance_uuid)s was re-scheduled: " 

1624 "%(reason)s") 

1625 

1626 

1627class GroupAffinityViolation(NovaException): 

1628 msg_fmt = _("%(policy)s instance group policy was violated") 

1629 

1630 

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) 

1636 

1637 

1638class OrphanedObjectError(NovaException): 

1639 msg_fmt = _('Cannot call %(method)s on orphaned %(objtype)s object') 

1640 

1641 

1642class ObjectActionError(NovaException): 

1643 msg_fmt = _('Object action %(action)s failed because: %(reason)s') 

1644 

1645 

1646class InstanceGroupNotFound(NotFound): 

1647 msg_fmt = _("Instance group %(group_uuid)s could not be found.") 

1648 

1649 

1650class InstanceGroupIdExists(NovaException): 

1651 msg_fmt = _("Instance group %(group_uuid)s already exists.") 

1652 

1653 

1654class InstanceGroupSaveException(NovaException): 

1655 msg_fmt = _("%(field)s should not be part of the updates.") 

1656 

1657 

1658class ResourceMonitorError(NovaException): 

1659 msg_fmt = _("Error when creating resource monitor: %(monitor)s") 

1660 

1661 

1662class PciDeviceWrongAddressFormat(NovaException): 

1663 msg_fmt = _("The PCI address %(address)s has an incorrect format.") 

1664 

1665 

1666class PciDeviceInvalidDeviceName(NovaException): 

1667 msg_fmt = _("Invalid PCI Whitelist: " 

1668 "The PCI whitelist can specify devname or address," 

1669 " but not both") 

1670 

1671 

1672class PciDeviceNotFoundById(NotFound): 

1673 msg_fmt = _("PCI device %(id)s not found") 

1674 

1675 

1676class PciDeviceNotFound(NotFound): 

1677 msg_fmt = _("PCI Device %(node_id)s:%(address)s not found.") 

1678 

1679 

1680class PciDeviceInvalidStatus(Invalid): 

1681 msg_fmt = _( 

1682 "PCI device %(compute_node_id)s:%(address)s is %(status)s " 

1683 "instead of %(hopestatus)s") 

1684 

1685 

1686class PciDeviceVFInvalidStatus(Invalid): 

1687 msg_fmt = _( 

1688 "Not all Virtual Functions of PF %(compute_node_id)s:%(address)s " 

1689 "are free.") 

1690 

1691 

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") 

1697 

1698 

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") 

1703 

1704 

1705class PciDeviceRequestFailed(NovaException): 

1706 msg_fmt = _( 

1707 "PCI device request %(requests)s failed") 

1708 

1709 

1710class PciDevicePoolEmpty(NovaException): 

1711 msg_fmt = _( 

1712 "Attempt to consume PCI device %(compute_node_id)s:%(address)s " 

1713 "from empty pool") 

1714 

1715 

1716class PciInvalidAlias(Invalid): 

1717 msg_fmt = _("Invalid PCI alias definition: %(reason)s") 

1718 

1719 

1720class PciRequestAliasNotDefined(NovaException): 

1721 msg_fmt = _("PCI alias %(alias)s is not defined") 

1722 

1723 

1724class PciConfigInvalidSpec(Invalid): 

1725 msg_fmt = _("Invalid [pci]device_spec config: %(reason)s") 

1726 

1727 

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") 

1731 

1732 

1733class PciDeviceRemoteManagedNotPresent(NovaException): 

1734 msg_fmt = _('Invalid PCI Whitelist: A device specified as "remote_managed"' 

1735 ' is not actually present on the host') 

1736 

1737 

1738class PciDeviceInvalidPFRemoteManaged(NovaException): 

1739 msg_fmt = _('Invalid PCI Whitelist: PFs must not have the "remote_managed"' 

1740 'tag, device address: %(address)s') 

1741 

1742 

1743# Cannot be templated, msg needs to be constructed when raised. 

1744class InternalError(NovaException): 

1745 """Generic hypervisor errors. 

1746 

1747 Consider subclassing this to provide more specific exceptions. 

1748 """ 

1749 msg_fmt = "%(err)s" 

1750 

1751 

1752class PciDeviceDetachFailed(NovaException): 

1753 msg_fmt = _("Failed to detach PCI device %(dev)s: %(reason)s") 

1754 

1755 

1756class PciDeviceUnsupportedHypervisor(NovaException): 

1757 msg_fmt = _("%(type)s hypervisor does not support PCI devices") 

1758 

1759 

1760class KeyManagerError(NovaException): 

1761 msg_fmt = _("Key manager error: %(reason)s") 

1762 

1763 

1764class VolumesNotRemoved(Invalid): 

1765 msg_fmt = _("Failed to remove volume(s): (%(reason)s)") 

1766 

1767 

1768class VolumeRebaseFailed(NovaException): 

1769 msg_fmt = _("Volume rebase failed: %(reason)s") 

1770 

1771 

1772class InvalidVideoMode(Invalid): 

1773 msg_fmt = _("Provided video model (%(model)s) is not supported.") 

1774 

1775 

1776class RngDeviceNotExist(Invalid): 

1777 msg_fmt = _("The provided RNG device path: (%(path)s) is not " 

1778 "present on the host.") 

1779 

1780 

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.") 

1784 

1785 

1786class SecurityProxyNegotiationFailed(NovaException): 

1787 msg_fmt = _("Failed to negotiate security type with server: %(reason)s") 

1788 

1789 

1790class RFBAuthHandshakeFailed(NovaException): 

1791 msg_fmt = _("Failed to complete auth handshake: %(reason)s") 

1792 

1793 

1794class RFBAuthNoAvailableScheme(NovaException): 

1795 msg_fmt = _("No matching auth scheme: allowed types: '%(allowed_types)s', " 

1796 "desired types: '%(desired_types)s'") 

1797 

1798 

1799class InvalidWatchdogAction(Invalid): 

1800 msg_fmt = _("Provided watchdog action (%(action)s) is not supported.") 

1801 

1802 

1803class LiveMigrationNotSubmitted(NovaException): 

1804 msg_fmt = _("Failed to submit live migration %(migration_uuid)s for " 

1805 "instance %(instance_uuid)s for processing.") 

1806 

1807 

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.") 

1812 

1813 

1814class LiveMigrationURINotAvailable(NovaException): 

1815 msg_fmt = _('No live migration URI configured and no default available ' 

1816 'for "%(virt_type)s" hypervisor virtualization type.') 

1817 

1818 

1819class UnshelveException(NovaException): 

1820 msg_fmt = _("Error during unshelve instance %(instance_id)s: %(reason)s") 

1821 

1822 

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 

1827 

1828 

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 

1834 

1835 

1836class UnshelveHostNotInAZ(Invalid): 

1837 msg_fmt = _('Host "%(host)s" is not in the availability zone ' 

1838 '"%(availability_zone)s".') 

1839 code = 409 

1840 

1841 

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)') 

1847 

1848 

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)') 

1854 

1855 

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") 

1859 

1860 

1861class InvalidArchitectureName(Invalid): 

1862 msg_fmt = _("Architecture name '%(arch)s' is not recognised") 

1863 

1864 

1865class ImageNUMATopologyIncomplete(Invalid): 

1866 msg_fmt = _("CPU and memory allocation must be provided for all " 

1867 "NUMA nodes") 

1868 

1869 

1870class ImageNUMATopologyForbidden(Forbidden): 

1871 msg_fmt = _("Image property '%(name)s' is not permitted to override " 

1872 "NUMA configuration set against the flavor") 

1873 

1874 

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.") 

1879 

1880 

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.") 

1885 

1886 

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") 

1891 

1892 

1893class ImageNUMATopologyCPUOutOfRange(Invalid): 

1894 msg_fmt = _("CPU number %(cpunum)d is larger than max %(cpumax)d") 

1895 

1896 

1897class ImageNUMATopologyCPUDuplicates(Invalid): 

1898 msg_fmt = _("CPU number %(cpunum)d is assigned to two nodes") 

1899 

1900 

1901class ImageNUMATopologyCPUsUnassigned(Invalid): 

1902 msg_fmt = _("CPU number %(cpuset)s is not assigned to any node") 

1903 

1904 

1905class ImageNUMATopologyMemoryOutOfRange(Invalid): 

1906 msg_fmt = _("%(memsize)d MB of memory assigned, but expected " 

1907 "%(memtotal)d MB") 

1908 

1909 

1910class InvalidHostname(Invalid): 

1911 msg_fmt = _("Invalid characters in hostname '%(hostname)s'") 

1912 

1913 

1914class NumaTopologyNotFound(NotFound): 

1915 msg_fmt = _("Instance %(instance_uuid)s does not specify a NUMA topology") 

1916 

1917 

1918class MigrationContextNotFound(NotFound): 

1919 msg_fmt = _("Instance %(instance_uuid)s does not specify a migration " 

1920 "context.") 

1921 

1922 

1923class SocketPortRangeExhaustedException(NovaException): 

1924 msg_fmt = _("Not able to acquire a free port for %(host)s") 

1925 

1926 

1927class SocketPortInUseException(NovaException): 

1928 msg_fmt = _("Not able to bind %(host)s:%(port)d, %(error)s") 

1929 

1930 

1931class ImageSerialPortNumberInvalid(Invalid): 

1932 msg_fmt = _("Number of serial ports specified in flavor is invalid: " 

1933 "expected an integer, got '%(num_ports)s'") 

1934 

1935 

1936class ImageSerialPortNumberExceedFlavorValue(Invalid): 

1937 msg_fmt = _("Forbidden to exceed flavor value of number of serial " 

1938 "ports passed in image meta.") 

1939 

1940 

1941class SerialPortNumberLimitExceeded(Invalid): 

1942 msg_fmt = _("Maximum number of serial port exceeds %(allowed)d " 

1943 "for %(virt_type)s") 

1944 

1945 

1946class InvalidImageConfigDrive(Invalid): 

1947 msg_fmt = _("Image's config drive option '%(config_drive)s' is invalid") 

1948 

1949 

1950class InvalidHypervisorVirtType(Invalid): 

1951 msg_fmt = _("Hypervisor virtualization type '%(hv_type)s' is not " 

1952 "recognised") 

1953 

1954 

1955class InvalidMachineType(Invalid): 

1956 msg_fmt = _("Machine type '%(mtype)s' is not compatible with image " 

1957 "%(image_name)s (%(image_id)s): %(reason)s") 

1958 

1959 

1960class InvalidMachineTypeUpdate(Invalid): 

1961 msg_fmt = _("Cannot update machine type %(existing_machine_type)s to " 

1962 "%(machine_type)s.") 

1963 

1964 

1965class UnsupportedMachineType(Invalid): 

1966 msg_fmt = _("Machine type %(machine_type)s is not supported.") 

1967 

1968 

1969class InvalidVirtualMachineMode(Invalid): 

1970 msg_fmt = _("Virtual machine mode '%(vmmode)s' is not recognised") 

1971 

1972 

1973class InvalidToken(Invalid): 

1974 msg_fmt = _("The token '%(token)s' is invalid or has expired") 

1975 

1976 

1977class TokenInUse(Invalid): 

1978 msg_fmt = _("The generated token is invalid") 

1979 

1980 

1981class InvalidConnectionInfo(Invalid): 

1982 msg_fmt = _("Invalid Connection Info") 

1983 

1984 

1985class InstanceQuiesceNotSupported(Invalid): 

1986 msg_fmt = _('Quiescing is not supported in instance %(instance_id)s') 

1987 

1988 

1989class InstanceAgentNotEnabled(Invalid): 

1990 msg_fmt = _('Guest agent is not enabled for the instance') 

1991 safe = True 

1992 

1993 

1994class QemuGuestAgentNotEnabled(InstanceAgentNotEnabled): 

1995 msg_fmt = _('QEMU guest agent is not enabled') 

1996 

1997 

1998class SetAdminPasswdNotSupported(Invalid): 

1999 msg_fmt = _('Set admin password is not supported') 

2000 safe = True 

2001 

2002 

2003class MemoryPageSizeInvalid(Invalid): 

2004 msg_fmt = _("Invalid memory page size '%(pagesize)s'") 

2005 

2006 

2007class MemoryPageSizeForbidden(Invalid): 

2008 msg_fmt = _("Page size %(pagesize)s forbidden against '%(against)s'") 

2009 

2010 

2011class MemoryPageSizeNotSupported(Invalid): 

2012 msg_fmt = _("Page size %(pagesize)s is not supported by the host.") 

2013 

2014 

2015class LockMemoryForbidden(Forbidden): 

2016 msg_fmt = _("locked_memory value in image or flavor is forbidden when " 

2017 "mem_page_size is not set.") 

2018 

2019 

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.") 

2024 

2025 

2026class CPUPinningInvalid(Invalid): 

2027 msg_fmt = _("CPU set to pin %(requested)s must be a subset of " 

2028 "free CPU set %(available)s") 

2029 

2030 

2031class CPUUnpinningInvalid(Invalid): 

2032 msg_fmt = _("CPU set to unpin %(requested)s must be a subset of " 

2033 "pinned CPU set %(available)s") 

2034 

2035 

2036class CPUPinningUnknown(Invalid): 

2037 msg_fmt = _("CPU set to pin %(requested)s must be a subset of " 

2038 "known CPU set %(available)s") 

2039 

2040 

2041class CPUUnpinningUnknown(Invalid): 

2042 msg_fmt = _("CPU set to unpin %(requested)s must be a subset of " 

2043 "known CPU set %(available)s") 

2044 

2045 

2046class ImageCPUPinningForbidden(Forbidden): 

2047 msg_fmt = _("Image property 'hw_cpu_policy' is not permitted to override " 

2048 "CPU pinning policy set against the flavor") 

2049 

2050 

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") 

2054 

2055 

2056class UnsupportedPolicyException(Invalid): 

2057 msg_fmt = _("ServerGroup policy is not supported: %(reason)s") 

2058 

2059 

2060class CellMappingNotFound(NotFound): 

2061 msg_fmt = _("Cell %(uuid)s has no mapping.") 

2062 

2063 

2064class NUMATopologyUnsupported(Invalid): 

2065 msg_fmt = _("Host does not support guests with NUMA topology set") 

2066 

2067 

2068class MemoryPagesUnsupported(Invalid): 

2069 msg_fmt = _("Host does not support guests with custom memory page sizes") 

2070 

2071 

2072class InvalidImageFormat(Invalid): 

2073 msg_fmt = _("Invalid image format '%(format)s'") 

2074 

2075 

2076class UnsupportedImageModel(Invalid): 

2077 msg_fmt = _("Image model '%(image)s' is not supported") 

2078 

2079 

2080class HostMappingNotFound(Invalid): 

2081 msg_fmt = _("Host '%(name)s' is not mapped to any cell") 

2082 

2083 

2084class HostMappingExists(Invalid): 

2085 msg_fmt = _("Host '%(name)s' mapping already exists") 

2086 

2087 

2088class RealtimeConfigurationInvalid(Invalid): 

2089 msg_fmt = _("Cannot set realtime policy in a non dedicated " 

2090 "cpu pinning policy") 

2091 

2092 

2093class CPUThreadPolicyConfigurationInvalid(Invalid): 

2094 msg_fmt = _("Cannot set cpu thread pinning policy in a non dedicated " 

2095 "cpu pinning policy") 

2096 

2097 

2098class RequestSpecNotFound(NotFound): 

2099 msg_fmt = _("RequestSpec not found for instance %(instance_uuid)s") 

2100 

2101 

2102class UEFINotSupported(Invalid): 

2103 msg_fmt = _("UEFI is not supported") 

2104 

2105 

2106class SecureBootNotSupported(Invalid): 

2107 msg_fmt = _("Secure Boot is not supported by host") 

2108 

2109 

2110class FirmwareSMMNotSupported(Invalid): 

2111 msg_fmt = _("This firmware doesn't require (support) SMM") 

2112 

2113 

2114class TriggerCrashDumpNotSupported(Invalid): 

2115 msg_fmt = _("Triggering crash dump is not supported") 

2116 

2117 

2118class UnsupportedHostCPUControlPolicy(Invalid): 

2119 msg_fmt = _("Requested CPU control policy not supported by host") 

2120 

2121 

2122class LibguestfsCannotReadKernel(Invalid): 

2123 msg_fmt = _("Libguestfs does not have permission to read host kernel.") 

2124 

2125 

2126class RealtimeMaskNotFoundOrInvalid(Invalid): 

2127 msg_fmt = _("Use of realtime CPUs requires either one or more " 

2128 "non-realtime CPU(s) or offloaded emulator threads.") 

2129 

2130 

2131class OsInfoNotFound(NotFound): 

2132 msg_fmt = _("No configuration information found for operating system " 

2133 "%(os_name)s") 

2134 

2135 

2136class BuildRequestNotFound(NotFound): 

2137 msg_fmt = _("BuildRequest not found for instance %(uuid)s") 

2138 

2139 

2140class AttachInterfaceNotSupported(Invalid): 

2141 msg_fmt = _("Attaching interfaces is not supported for " 

2142 "instance %(instance_uuid)s.") 

2143 

2144 

2145class AttachInterfaceWithQoSPolicyNotSupported(AttachInterfaceNotSupported): 

2146 msg_fmt = _("Attaching interfaces with QoS policy is not supported for " 

2147 "instance %(instance_uuid)s.") 

2148 

2149 

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.") 

2155 

2156 

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)") 

2160 

2161 

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.") 

2166 

2167 

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.") 

2172 

2173 

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.") 

2178 

2179 

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.") 

2184 

2185 

2186class ResourceProviderRetrievalFailed(NovaException): 

2187 msg_fmt = _("Failed to get resource provider with UUID %(uuid)s") 

2188 

2189 

2190class ResourceProviderAggregateRetrievalFailed(NovaException): 

2191 msg_fmt = _("Failed to get aggregates for resource provider with UUID" 

2192 " %(uuid)s") 

2193 

2194 

2195class ResourceProviderTraitRetrievalFailed(NovaException): 

2196 msg_fmt = _("Failed to get traits for resource provider with UUID" 

2197 " %(uuid)s") 

2198 

2199 

2200class ResourceProviderCreationFailed(NovaException): 

2201 msg_fmt = _("Failed to create resource provider %(name)s") 

2202 

2203 

2204class ResourceProviderDeletionFailed(NovaException): 

2205 msg_fmt = _("Failed to delete resource provider %(uuid)s") 

2206 

2207 

2208class ResourceProviderUpdateFailed(NovaException): 

2209 msg_fmt = _("Failed to update resource provider via URL %(url)s: " 

2210 "%(error)s") 

2211 

2212 

2213class ResourceProviderNotFound(NotFound): 

2214 msg_fmt = _("No such resource provider %(name_or_uuid)s.") 

2215 

2216 

2217class ResourceProviderSyncFailed(NovaException): 

2218 msg_fmt = _("Failed to synchronize the placement service with resource " 

2219 "provider information supplied by the compute host.") 

2220 

2221 

2222class PlacementAPIConnectFailure(NovaException): 

2223 msg_fmt = _("Unable to communicate with the Placement API.") 

2224 

2225 

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") 

2232 

2233 

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") 

2240 

2241 

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 ) 

2250 

2251 

2252class InvalidResourceClass(Invalid): 

2253 msg_fmt = _("Resource class '%(resource_class)s' invalid.") 

2254 

2255 

2256class InvalidInventory(Invalid): 

2257 msg_fmt = _("Inventory for '%(resource_class)s' on " 

2258 "resource provider '%(resource_provider)s' invalid.") 

2259 

2260 

2261# An exception with this name is used on both sides of the placement/ 

2262# nova interaction. 

2263class InventoryInUse(InvalidInventory): 

2264 pass 

2265 

2266 

2267class UsagesRetrievalFailed(NovaException): 

2268 msg_fmt = _("Failed to retrieve usages for project '%(project_id)s' and " 

2269 "user '%(user_id)s'.") 

2270 

2271 

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.") 

2276 

2277 

2278class Unauthorized(NovaException): 

2279 msg_fmt = _("Not authorized.") 

2280 code = 401 

2281 

2282 

2283class NeutronAdminCredentialConfigurationInvalid(Invalid): 

2284 msg_fmt = _("Networking client is experiencing an unauthorized exception.") 

2285 

2286 

2287class InvalidEmulatorThreadsPolicy(Invalid): 

2288 msg_fmt = _("CPU emulator threads option requested is invalid, " 

2289 "given: '%(requested)s', available: '%(available)s'.") 

2290 

2291 

2292class InvalidCPUAllocationPolicy(Invalid): 

2293 msg_fmt = _("CPU policy requested from '%(source)s' is invalid, " 

2294 "given: '%(requested)s', available: '%(available)s'.") 

2295 

2296 

2297class InvalidCPUThreadAllocationPolicy(Invalid): 

2298 msg_fmt = _("CPU thread policy requested from '%(source)s' is invalid, " 

2299 "given: '%(requested)s', available: '%(available)s'.") 

2300 

2301 

2302class BadRequirementEmulatorThreadsPolicy(Invalid): 

2303 msg_fmt = _("An isolated CPU emulator threads option requires a dedicated " 

2304 "CPU policy option.") 

2305 

2306 

2307class InvalidNetworkNUMAAffinity(Invalid): 

2308 msg_fmt = _("Invalid NUMA network affinity configured: %(reason)s") 

2309 

2310 

2311class InvalidPCINUMAAffinity(Invalid): 

2312 msg_fmt = _("Invalid PCI NUMA affinity configured: %(policy)s") 

2313 

2314 

2315class TraitRetrievalFailed(NovaException): 

2316 msg_fmt = _("Failed to retrieve traits from the placement API: %(error)s") 

2317 

2318 

2319class TraitCreationFailed(NovaException): 

2320 msg_fmt = _("Failed to create trait %(name)s: %(error)s") 

2321 

2322 

2323class CannotMigrateToSameHost(NovaException): 

2324 msg_fmt = _("Cannot migrate to the host where the server exists.") 

2325 

2326 

2327class VirtDriverNotReady(NovaException): 

2328 msg_fmt = _("Virt driver is not ready.") 

2329 

2330 

2331class InvalidPeerList(NovaException): 

2332 msg_fmt = _("Configured nova-compute peer list for the ironic virt " 

2333 "driver is invalid on host %(host)s") 

2334 

2335 

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.") 

2339 

2340 

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.") 

2345 

2346 

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.") 

2351 

2352 

2353class UniqueDiskDiscoveryException(NovaException): 

2354 msg_fmt = _("Expected to find exactly one disk on the management " 

2355 "partition at %(path_pattern)s; found %(count)d.") 

2356 

2357 

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.") 

2362 

2363 

2364class OptRequiredIfOtherOptValue(NovaException): 

2365 msg_fmt = _("The %(then_opt)s option is required if %(if_opt)s is " 

2366 "specified as '%(if_value)s'.") 

2367 

2368 

2369class AllocationCreateFailed(NovaException): 

2370 msg_fmt = _('Failed to create allocations for instance %(instance)s ' 

2371 'against resource provider %(provider)s.') 

2372 

2373 

2374class AllocationUpdateFailed(NovaException): 

2375 msg_fmt = _('Failed to update allocations for consumer %(consumer_uuid)s. ' 

2376 'Error: %(error)s') 

2377 

2378 

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') 

2383 

2384 

2385class AllocationDeleteFailed(NovaException): 

2386 msg_fmt = _('Failed to delete allocations for consumer %(consumer_uuid)s. ' 

2387 'Error: %(error)s') 

2388 

2389 

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.') 

2394 

2395 

2396class CertificateValidationFailed(NovaException): 

2397 msg_fmt = _("Image signature certificate validation failed for " 

2398 "certificate: %(cert_uuid)s. %(reason)s") 

2399 

2400 

2401class InstanceRescueFailure(NovaException): 

2402 msg_fmt = _("Failed to move instance to rescue mode: %(reason)s") 

2403 

2404 

2405class InstanceUnRescueFailure(NovaException): 

2406 msg_fmt = _("Failed to unrescue instance: %(reason)s") 

2407 

2408 

2409class IronicAPIVersionNotAvailable(NovaException): 

2410 msg_fmt = _('Ironic API version %(version)s is not available.') 

2411 

2412 

2413class ZVMDriverException(NovaException): 

2414 msg_fmt = _("ZVM Driver has error: %(error)s") 

2415 

2416 

2417class ZVMConnectorError(ZVMDriverException): 

2418 msg_fmt = _("zVM Cloud Connector request failed: %(results)s") 

2419 

2420 def __init__(self, message=None, **kwargs): 

2421 """Exception for zVM ConnectorClient calls. 

2422 

2423 :param results: The object returned from ZVMConnector.send_request. 

2424 """ 

2425 super(ZVMConnectorError, self).__init__(message=message, **kwargs) 

2426 

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') 

2432 

2433 

2434class NoResourceClass(NovaException): 

2435 msg_fmt = _("Resource class not found for Ironic node %(node)s.") 

2436 

2437 

2438class ResourceProviderAllocationRetrievalFailed(NovaException): 

2439 msg_fmt = _("Failed to retrieve allocations for resource provider " 

2440 "%(rp_uuid)s: %(error)s") 

2441 

2442 

2443class ConsumerAllocationRetrievalFailed(NovaException): 

2444 msg_fmt = _("Failed to retrieve allocations for consumer " 

2445 "%(consumer_uuid)s: %(error)s") 

2446 

2447 

2448class ReshapeFailed(NovaException): 

2449 msg_fmt = _("Resource provider inventory and allocation data migration " 

2450 "failed: %(error)s") 

2451 

2452 

2453class ReshapeNeeded(NovaException): 

2454 msg_fmt = _("Virt driver indicates that provider inventories need to be " 

2455 "moved.") 

2456 

2457 

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).") 

2461 

2462 

2463class MissingDomainCapabilityFeatureException(NovaException): 

2464 msg_fmt = _("Guest config could not be built without domain capabilities " 

2465 "including <%(feature)s> feature.") 

2466 

2467 

2468class HealAllocationException(NovaException): 

2469 msg_fmt = _("Healing instance allocation failed.") 

2470 

2471 

2472class HealvGPUAllocationNotSupported(HealAllocationException): 

2473 msg_fmt = _( 

2474 "Healing allocation for instance %(instance_uuid)s with vGPU resource " 

2475 "request is not supported." 

2476 ) 

2477 

2478 

2479class HealDeviceProfileAllocationNotSupported(HealAllocationException): 

2480 msg_fmt = _( 

2481 "Healing allocation for instance %(instance_uuid)s with Cyborg device " 

2482 "profile request is not supported." 

2483 ) 

2484 

2485 

2486class HealPortAllocationException(NovaException): 

2487 msg_fmt = _("Healing port allocation failed.") 

2488 

2489 

2490class UnableToQueryPorts(HealPortAllocationException): 

2491 msg_fmt = _("Unable to query ports for instance %(instance_uuid)s: " 

2492 "%(error)s") 

2493 

2494 

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.") 

2500 

2501 

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.") 

2512 

2513 

2514class AssignedResourceNotFound(NovaException): 

2515 msg_fmt = _("Assigned resources not found: %(reason)s") 

2516 

2517 

2518class PMEMNamespaceConfigInvalid(NovaException): 

2519 msg_fmt = _("The pmem_namespaces configuration is invalid: %(reason)s, " 

2520 "please check your conf file. ") 

2521 

2522 

2523class GetPMEMNamespacesFailed(NovaException): 

2524 msg_fmt = _("Get PMEM namespaces on host failed: %(reason)s.") 

2525 

2526 

2527class VPMEMCleanupFailed(NovaException): 

2528 msg_fmt = _("Failed to clean up the vpmem backend device %(dev)s: " 

2529 "%(error)s") 

2530 

2531 

2532class RequestGroupSuffixConflict(NovaException): 

2533 msg_fmt = _("Duplicate request group suffix %(suffix)s.") 

2534 

2535 

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.") 

2540 

2541 

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") 

2548 

2549 

2550class DeviceProfileError(NovaException): 

2551 msg_fmt = _("Device profile name %(name)s: %(msg)s") 

2552 

2553 

2554class AcceleratorRequestOpFailed(NovaException): 

2555 msg_fmt = _("Failed to %(op)s accelerator requests: %(msg)s") 

2556 

2557 

2558class AcceleratorRequestBindingFailed(NovaException): 

2559 msg_fmt = _("Failed to bind accelerator requests: %(msg)s") 

2560 

2561 def __init__(self, message=None, arqs=None, **kwargs): 

2562 super(AcceleratorRequestBindingFailed, self).__init__( 

2563 message=message, **kwargs) 

2564 self.arqs = arqs or [] 

2565 

2566 

2567class InvalidLibvirtMdevConfig(NovaException): 

2568 msg_fmt = _('Invalid configuration for mdev-capable devices: %(reason)s') 

2569 

2570 

2571class RequiredMixedInstancePolicy(Invalid): 

2572 msg_fmt = _("Cannot specify 'hw:cpu_dedicated_mask' without the " 

2573 "'mixed' policy.") 

2574 

2575 

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.") 

2582 

2583 

2584class MixedInstanceNotSupportByComputeService(NovaException): 

2585 msg_fmt = _("To support 'mixed' policy instance 'nova-compute' service " 

2586 "must be upgraded to 'Victoria' or later.") 

2587 

2588 

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'.") 

2592 

2593 

2594class ProviderConfigException(NovaException): 

2595 """Exception indicating an error occurred processing provider config files. 

2596 

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") 

2602 

2603 

2604class PlacementPciException(NovaException): 

2605 msg_fmt = _( 

2606 "Failed to gather or report PCI resources to Placement: %(error)s") 

2607 

2608 

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 ) 

2615 

2616 

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 ) 

2623 

2624 

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 ) 

2631 

2632 

2633class ReimageException(NovaException): 

2634 msg_fmt = _("Reimaging volume failed.") 

2635 

2636 

2637class InvalidNodeConfiguration(NovaException): 

2638 msg_fmt = _('Invalid node identity configuration: %(reason)s') 

2639 

2640 

2641class DuplicateRecord(NovaException): 

2642 msg_fmt = _('Unable to create duplicate record for %(target)s') 

2643 

2644 

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") 

2650 

2651 

2652class EphemeralEncryptionSecretNotFound(Invalid): 

2653 msg_fmt = _( 

2654 'Encryption secret %(secret_uuid)s was not found in the key manager') 

2655 

2656 

2657class EphemeralEncryptionCleanupFailed(NovaException): 

2658 msg_fmt = _("Failed to clean up ephemeral encryption secrets: " 

2659 "%(error)s") 

2660 

2661 

2662class HostConflict(Exception): 

2663 pass