)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Validate the combination of the flavor extra-specs and image properties"},{"line_number":12,"context_line":"as early as possible once they\u0027re both known (since you can specify"},{"line_number":13,"context_line":"mutually-incompatible changes in the two places). If validation failed"},{"line_number":14,"context_line":"then synchronously return error to user. We\u0027d need to do this anywhere"},{"line_number":15,"context_line":"the flavor or image changes, so basically instance creation, rebuild,"},{"line_number":16,"context_line":"and resize."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_2bcfca55","line":14,"range":{"start_line":14,"start_character":43,"end_line":14,"end_character":45},"updated":"2018-12-05 15:57:29.000000000","message":"we\u0027re actually doing it now, so can remove the \"\u0027d\".","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Validate the combination of the flavor extra-specs and image properties"},{"line_number":12,"context_line":"as early as possible once they\u0027re both known (since you can specify"},{"line_number":13,"context_line":"mutually-incompatible changes in the two places). If validation failed"},{"line_number":14,"context_line":"then synchronously return error to user. We\u0027d need to do this anywhere"},{"line_number":15,"context_line":"the flavor or image changes, so basically instance creation, rebuild,"},{"line_number":16,"context_line":"and resize."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_c4aba36d","line":14,"range":{"start_line":14,"start_character":43,"end_line":14,"end_character":45},"in_reply_to":"3f79a3b5_2bcfca55","updated":"2018-12-10 19:48:11.000000000","message":"Done","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4f135443e9d39ec1a5adf279fc0449714af2efc5","unresolved":false,"context_lines":[{"line_number":21,"context_line":"- Added the following validations to _validate_flavor_image():"},{"line_number":22,"context_line":"  cpu_policy and cpu_thread_policy values, serial ports, realtime"},{"line_number":23,"context_line":"  mask, cpu topology."},{"line_number":24,"context_line":"- Added new 400 exceptions in Server API correspondent to added"},{"line_number":25,"context_line":"  validations."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"blueprint: flavor-extra-spec-image-property-validation"},{"line_number":28,"context_line":"Change-Id: I06fad233006c7bab14749a51ffa226c3801f951b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9fdfeff1_2711295e","line":25,"range":{"start_line":24,"start_character":2,"end_line":25,"end_character":14},"updated":"2019-01-29 15:59:14.000000000","message":"We should at least have an upgrade release note since this is a change in behavior. These APIs could already return 400, but now they will return 400 for new reasons which they didn\u0027t before, in ways that they might not on other clouds with flavors/images using the same properties/values. I know we\u0027re not adding a new microversion for this since we\u0027re making the API more robust, but it\u0027s something people should be aware of. It would also be nice to document what gets validated for flavor extra specs and image properties somewhere, but I\u0027m not entirely sure where, maybe some new doc in the user docs:\n\nhttps://docs.openstack.org/nova/latest/user/\n\nWe already have https://docs.openstack.org/nova/latest/user/flavors.html but that seems like an odd fit to put something that says \"this spec is validated in the API but these others aren\u0027t\". But idk, I\u0027m open on how best to document this.","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"02a4ade237a955af3702b17a8e1a7c51a50b71d9","unresolved":false,"context_lines":[{"line_number":21,"context_line":"- Added the following validations to _validate_flavor_image():"},{"line_number":22,"context_line":"  cpu_policy and cpu_thread_policy values, serial ports, realtime"},{"line_number":23,"context_line":"  mask, cpu topology."},{"line_number":24,"context_line":"- Added new 400 exceptions in Server API correspondent to added"},{"line_number":25,"context_line":"  validations."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"blueprint: flavor-extra-spec-image-property-validation"},{"line_number":28,"context_line":"Change-Id: I06fad233006c7bab14749a51ffa226c3801f951b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9fdfeff1_2c4faf93","line":25,"range":{"start_line":24,"start_character":2,"end_line":25,"end_character":14},"in_reply_to":"9fdfeff1_2711295e","updated":"2019-01-31 02:22:35.000000000","message":"added upgrade release note.","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":23,"context_line":"- Added new 400 exceptions in Server API correspondent to added"},{"line_number":24,"context_line":"  validations."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"PciInvalidAlias wasn\u0027t currently being handled, so I\u0027ve added it to"},{"line_number":27,"context_line":"the list of handled exceptions. (Thanks to mriedem for catching this.)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"blueprint: flavor-extra-spec-image-property-validation"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9fdfeff1_65ea4ed9","line":26,"updated":"2019-03-04 21:30:46.000000000","message":"Arguably we should fix this separately so we can backport it...","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3eccbdefcdaa78e4d4f8f72e782905b538f8ba78","unresolved":false,"context_lines":[{"line_number":23,"context_line":"- Added new 400 exceptions in Server API correspondent to added"},{"line_number":24,"context_line":"  validations."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"PciInvalidAlias wasn\u0027t currently being handled, so I\u0027ve added it to"},{"line_number":27,"context_line":"the list of handled exceptions. (Thanks to mriedem for catching this.)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"blueprint: flavor-extra-spec-image-property-validation"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9fdfeff1_9c9f7650","line":26,"in_reply_to":"9fdfeff1_65ea4ed9","updated":"2019-03-05 16:15:51.000000000","message":"Actually as noted in earlier review and as discussed in IRC I think PciInvalidAlias, which extends Invalid, would be handled here:\n\nhttps://github.com/openstack/nova/blob/c43c1d3fb9da5dd0a13e1f15623a696212f095ff/nova/api/openstack/wsgi.py#L367\n\nWhich should result in a 400. We don\u0027t have any unit tests for it, but I think it\u0027s handled generically in the stack. Adding it to INVALID_FLAVOR_IMAGE_EXCEPTIONS in this change to be explicit is I think good enough and we wouldn\u0027t need a separate backportable change unless someone can prove it\u0027s not handled and results in a 500.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":23,"context_line":"- Added new 400 exceptions in Server API correspondent to added"},{"line_number":24,"context_line":"  validations."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"PciInvalidAlias wasn\u0027t currently being handled, so I\u0027ve added it to"},{"line_number":27,"context_line":"the list of handled exceptions. (Thanks to mriedem for catching this.)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"blueprint: flavor-extra-spec-image-property-validation"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"5fc1f717_6d0a558b","line":26,"in_reply_to":"9fdfeff1_9c9f7650","updated":"2019-03-05 18:05:50.000000000","message":"As discussed on IRC, it turns out that this results in a 500 error.  A separate fix has been provided by https://review.openstack.org/#/c/641082/","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"}],"nova/api/openstack/compute/flavors_extraspecs.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"2332f4bf79d454184020f303fe9f66dbf1b090ea","unresolved":false,"context_lines":[{"line_number":35,"context_line":"class FlavorExtraSpecsController(wsgi.Controller):"},{"line_number":36,"context_line":"    \"\"\"The flavor extra specs API controller for the OpenStack API.\"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def _check_flavor_in_use(self, flavor):"},{"line_number":39,"context_line":"        if flavor.is_in_use():"},{"line_number":40,"context_line":"            msg \u003d _(\u0027Updating extra specs not permitted when flavor is \u0027"},{"line_number":41,"context_line":"                    \u0027associated to one or more valid instances\u0027)"},{"line_number":42,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    @staticmethod"},{"line_number":45,"context_line":"    def _validate_numa_node(flavor):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ee824002","line":42,"range":{"start_line":38,"start_character":0,"end_line":42,"end_character":59},"updated":"2018-12-05 16:00:54.000000000","message":"this is allowed upstream","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":35,"context_line":"class FlavorExtraSpecsController(wsgi.Controller):"},{"line_number":36,"context_line":"    \"\"\"The flavor extra specs API controller for the OpenStack API.\"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def _check_flavor_in_use(self, flavor):"},{"line_number":39,"context_line":"        if flavor.is_in_use():"},{"line_number":40,"context_line":"            msg \u003d _(\u0027Updating extra specs not permitted when flavor is \u0027"},{"line_number":41,"context_line":"                    \u0027associated to one or more valid instances\u0027)"},{"line_number":42,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    @staticmethod"},{"line_number":45,"context_line":"    def _validate_numa_node(flavor):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_04dbdb1f","line":42,"range":{"start_line":38,"start_character":0,"end_line":42,"end_character":59},"in_reply_to":"3f79a3b5_ee824002","updated":"2018-12-10 19:48:11.000000000","message":"removed","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"2332f4bf79d454184020f303fe9f66dbf1b090ea","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                           \u0027D\u0027: fields.CPUAllocationPolicy.DEDICATED}"},{"line_number":116,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _validate_extra_specs(self, flavor):"},{"line_number":119,"context_line":"        self._validate_cpu_policy(flavor)"},{"line_number":120,"context_line":"        self._validate_cpu_thread_policy(flavor)"},{"line_number":121,"context_line":"        self._validate_numa_node(flavor)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_extra_specs(self, context, flavor_id):"},{"line_number":124,"context_line":"        flavor \u003d common.get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_2e93585c","line":121,"range":{"start_line":118,"start_character":0,"end_line":121,"end_character":40},"updated":"2018-12-05 16:00:54.000000000","message":"Each of these things can be set in both the flavor and the image, so it doesn\u0027t make sense to validate the flavor by itself.  (You could have a flavor that doesn\u0027t make sense by itself, but when combined with a particular image it does make sense.)  So we need to test these things somewhere we have access to both the flavor and image, like in _validate_flavor_image().\n\nIf there are things that can only be set in the flavor then it would make sense to validate them here.","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"641d0a7ea69c0c9eaca9bde106466cb5795ac609","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                           \u0027D\u0027: fields.CPUAllocationPolicy.DEDICATED}"},{"line_number":116,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _validate_extra_specs(self, flavor):"},{"line_number":119,"context_line":"        self._validate_cpu_policy(flavor)"},{"line_number":120,"context_line":"        self._validate_cpu_thread_policy(flavor)"},{"line_number":121,"context_line":"        self._validate_numa_node(flavor)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_extra_specs(self, context, flavor_id):"},{"line_number":124,"context_line":"        flavor \u003d common.get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_65c4b061","line":121,"range":{"start_line":118,"start_character":0,"end_line":121,"end_character":40},"in_reply_to":"3f79a3b5_2e93585c","updated":"2018-12-10 22:00:45.000000000","message":"In starling, _create_instance()-\u003e_validate_and_build_base_options()-\u003ehardware.numa_get_constraints(instance_type, image_meta) where numa_get_constraints() checks for both instance_type and image_meta. It would be hard to consolidate numa_get_constraints() and _validate_flavor_image()","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d75b56599b6b53852b88eb9c2aa09df29a12b419","unresolved":false,"context_lines":[{"line_number":594,"context_line":"        except UnicodeDecodeError as error:"},{"line_number":595,"context_line":"            msg \u003d \"UnicodeError: %s\" % error"},{"line_number":596,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":597,"context_line":"        except (exception.AutoDiskConfigDisabledByImage,"},{"line_number":598,"context_line":"                exception.BadRequirementEmulatorThreadsPolicy,"},{"line_number":599,"context_line":"                exception.CertificateValidationFailed,"},{"line_number":600,"context_line":"                exception.CPUThreadPolicyConfigurationInvalid,"},{"line_number":601,"context_line":"                exception.FixedIpAlreadyInUse,"},{"line_number":602,"context_line":"                exception.FixedIpNotFoundForAddress,"},{"line_number":603,"context_line":"                exception.FlavorDiskTooSmall,"},{"line_number":604,"context_line":"                exception.FlavorMemoryTooSmall,"},{"line_number":605,"context_line":"                exception.FlavorNotFound,"},{"line_number":606,"context_line":"                exception.ImageBadRequest,"},{"line_number":607,"context_line":"                exception.ImageCPUPinningForbidden,"},{"line_number":608,"context_line":"                exception.ImageCPUThreadPolicyForbidden,"},{"line_number":609,"context_line":"                exception.ImageNotActive,"},{"line_number":610,"context_line":"                exception.ImageNotAuthorized,"},{"line_number":611,"context_line":"                exception.ImageNUMATopologyAsymmetric,"},{"line_number":612,"context_line":"                exception.ImageNUMATopologyCPUOutOfRange,"},{"line_number":613,"context_line":"                exception.ImageNUMATopologyCPUDuplicates,"},{"line_number":614,"context_line":"                exception.ImageNUMATopologyCPUsUnassigned,"},{"line_number":615,"context_line":"                exception.ImageNUMATopologyForbidden,"},{"line_number":616,"context_line":"                exception.ImageNUMATopologyIncomplete,"},{"line_number":617,"context_line":"                exception.ImageNUMATopologyMemoryOutOfRange,"},{"line_number":618,"context_line":"                exception.ImageSerialPortNumberExceedFlavorValue,"},{"line_number":619,"context_line":"                exception.ImageSerialPortNumberInvalid,"},{"line_number":620,"context_line":"                exception.ImageVCPULimitsRangeExceeded,"},{"line_number":621,"context_line":"                exception.ImageVCPUTopologyRangeExceeded,"},{"line_number":622,"context_line":"                exception.InstanceGroupNotFound,"},{"line_number":623,"context_line":"                exception.InstanceUserDataMalformed,"},{"line_number":624,"context_line":"                exception.InvalidBDM,"},{"line_number":625,"context_line":"                exception.InvalidBDMBootSequence,"},{"line_number":626,"context_line":"                exception.InvalidBDMEphemeralSize,"},{"line_number":627,"context_line":"                exception.InvalidBDMFormat,"},{"line_number":628,"context_line":"                exception.InvalidBDMImage,"},{"line_number":629,"context_line":"                exception.InvalidBDMLocalsLimit,"},{"line_number":630,"context_line":"                exception.InvalidBDMSnapshot,"},{"line_number":631,"context_line":"                exception.InvalidBDMSwapSize,"},{"line_number":632,"context_line":"                exception.InvalidBDMVolume,"},{"line_number":633,"context_line":"                exception.InvalidBDMVolumeNotBootable,"},{"line_number":634,"context_line":"                exception.InvalidCPUAllocationPolicy,"},{"line_number":635,"context_line":"                exception.InvalidCPUThreadAllocationPolicy,"},{"line_number":636,"context_line":"                exception.InvalidEmulatorThreadsPolicy,"},{"line_number":637,"context_line":"                exception.InvalidFixedIpAndMaxCountRequest,"},{"line_number":638,"context_line":"                exception.InvalidMetadata,"},{"line_number":639,"context_line":"                exception.InvalidNUMANodesNumber,"},{"line_number":640,"context_line":"                exception.InvalidRequest,"},{"line_number":641,"context_line":"                exception.InvalidVolume,"},{"line_number":642,"context_line":"                exception.MemoryPageSizeForbidden,"},{"line_number":643,"context_line":"                exception.MemoryPageSizeInvalid,"},{"line_number":644,"context_line":"                exception.MultiattachNotSupportedOldMicroversion,"},{"line_number":645,"context_line":"                exception.MultiplePortsNotApplicable,"},{"line_number":646,"context_line":"                exception.NetworkNotFound,"},{"line_number":647,"context_line":"                exception.NetworkRequiresSubnet,"},{"line_number":648,"context_line":"                exception.PciRequestAliasNotDefined,"},{"line_number":649,"context_line":"                exception.PortNotFound,"},{"line_number":650,"context_line":"                exception.PortRequiresFixedIP,"},{"line_number":651,"context_line":"                exception.RealtimeConfigurationInvalid,"},{"line_number":652,"context_line":"                exception.RealtimeMaskNotFoundOrInvalid,"},{"line_number":653,"context_line":"                exception.SecurityGroupNotFound,"},{"line_number":654,"context_line":"                exception.SnapshotNotFound,"},{"line_number":655,"context_line":"                exception.VolumeTypeNotFound,"},{"line_number":656,"context_line":"                exception.UnableToAutoAllocateNetwork,"},{"line_number":657,"context_line":"                ) as error:"},{"line_number":658,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.format_message())"},{"line_number":659,"context_line":"        except (exception.PortInUse,"},{"line_number":660,"context_line":"                exception.InstanceExists,"},{"line_number":661,"context_line":"                exception.NetworkAmbiguous,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_f18e0426","line":658,"range":{"start_line":597,"start_character":7,"end_line":658,"end_character":48},"updated":"2019-01-22 19:39:18.000000000","message":"I can see the organizational benefit from alphabetizing the exceptions, but mixing formatting changes with functional changes in the same commit makes it difficult to determine what the functional changes are.","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"9b2809a6cf118cf8270320aa21fad824037ecec6","unresolved":false,"context_lines":[{"line_number":594,"context_line":"        except UnicodeDecodeError as error:"},{"line_number":595,"context_line":"            msg \u003d \"UnicodeError: %s\" % error"},{"line_number":596,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":597,"context_line":"        except (exception.AutoDiskConfigDisabledByImage,"},{"line_number":598,"context_line":"                exception.BadRequirementEmulatorThreadsPolicy,"},{"line_number":599,"context_line":"                exception.CertificateValidationFailed,"},{"line_number":600,"context_line":"                exception.CPUThreadPolicyConfigurationInvalid,"},{"line_number":601,"context_line":"                exception.FixedIpAlreadyInUse,"},{"line_number":602,"context_line":"                exception.FixedIpNotFoundForAddress,"},{"line_number":603,"context_line":"                exception.FlavorDiskTooSmall,"},{"line_number":604,"context_line":"                exception.FlavorMemoryTooSmall,"},{"line_number":605,"context_line":"                exception.FlavorNotFound,"},{"line_number":606,"context_line":"                exception.ImageBadRequest,"},{"line_number":607,"context_line":"                exception.ImageCPUPinningForbidden,"},{"line_number":608,"context_line":"                exception.ImageCPUThreadPolicyForbidden,"},{"line_number":609,"context_line":"                exception.ImageNotActive,"},{"line_number":610,"context_line":"                exception.ImageNotAuthorized,"},{"line_number":611,"context_line":"                exception.ImageNUMATopologyAsymmetric,"},{"line_number":612,"context_line":"                exception.ImageNUMATopologyCPUOutOfRange,"},{"line_number":613,"context_line":"                exception.ImageNUMATopologyCPUDuplicates,"},{"line_number":614,"context_line":"                exception.ImageNUMATopologyCPUsUnassigned,"},{"line_number":615,"context_line":"                exception.ImageNUMATopologyForbidden,"},{"line_number":616,"context_line":"                exception.ImageNUMATopologyIncomplete,"},{"line_number":617,"context_line":"                exception.ImageNUMATopologyMemoryOutOfRange,"},{"line_number":618,"context_line":"                exception.ImageSerialPortNumberExceedFlavorValue,"},{"line_number":619,"context_line":"                exception.ImageSerialPortNumberInvalid,"},{"line_number":620,"context_line":"                exception.ImageVCPULimitsRangeExceeded,"},{"line_number":621,"context_line":"                exception.ImageVCPUTopologyRangeExceeded,"},{"line_number":622,"context_line":"                exception.InstanceGroupNotFound,"},{"line_number":623,"context_line":"                exception.InstanceUserDataMalformed,"},{"line_number":624,"context_line":"                exception.InvalidBDM,"},{"line_number":625,"context_line":"                exception.InvalidBDMBootSequence,"},{"line_number":626,"context_line":"                exception.InvalidBDMEphemeralSize,"},{"line_number":627,"context_line":"                exception.InvalidBDMFormat,"},{"line_number":628,"context_line":"                exception.InvalidBDMImage,"},{"line_number":629,"context_line":"                exception.InvalidBDMLocalsLimit,"},{"line_number":630,"context_line":"                exception.InvalidBDMSnapshot,"},{"line_number":631,"context_line":"                exception.InvalidBDMSwapSize,"},{"line_number":632,"context_line":"                exception.InvalidBDMVolume,"},{"line_number":633,"context_line":"                exception.InvalidBDMVolumeNotBootable,"},{"line_number":634,"context_line":"                exception.InvalidCPUAllocationPolicy,"},{"line_number":635,"context_line":"                exception.InvalidCPUThreadAllocationPolicy,"},{"line_number":636,"context_line":"                exception.InvalidEmulatorThreadsPolicy,"},{"line_number":637,"context_line":"                exception.InvalidFixedIpAndMaxCountRequest,"},{"line_number":638,"context_line":"                exception.InvalidMetadata,"},{"line_number":639,"context_line":"                exception.InvalidNUMANodesNumber,"},{"line_number":640,"context_line":"                exception.InvalidRequest,"},{"line_number":641,"context_line":"                exception.InvalidVolume,"},{"line_number":642,"context_line":"                exception.MemoryPageSizeForbidden,"},{"line_number":643,"context_line":"                exception.MemoryPageSizeInvalid,"},{"line_number":644,"context_line":"                exception.MultiattachNotSupportedOldMicroversion,"},{"line_number":645,"context_line":"                exception.MultiplePortsNotApplicable,"},{"line_number":646,"context_line":"                exception.NetworkNotFound,"},{"line_number":647,"context_line":"                exception.NetworkRequiresSubnet,"},{"line_number":648,"context_line":"                exception.PciRequestAliasNotDefined,"},{"line_number":649,"context_line":"                exception.PortNotFound,"},{"line_number":650,"context_line":"                exception.PortRequiresFixedIP,"},{"line_number":651,"context_line":"                exception.RealtimeConfigurationInvalid,"},{"line_number":652,"context_line":"                exception.RealtimeMaskNotFoundOrInvalid,"},{"line_number":653,"context_line":"                exception.SecurityGroupNotFound,"},{"line_number":654,"context_line":"                exception.SnapshotNotFound,"},{"line_number":655,"context_line":"                exception.VolumeTypeNotFound,"},{"line_number":656,"context_line":"                exception.UnableToAutoAllocateNetwork,"},{"line_number":657,"context_line":"                ) as error:"},{"line_number":658,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.format_message())"},{"line_number":659,"context_line":"        except (exception.PortInUse,"},{"line_number":660,"context_line":"                exception.InstanceExists,"},{"line_number":661,"context_line":"                exception.NetworkAmbiguous,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_293f1c26","line":658,"range":{"start_line":597,"start_character":7,"end_line":658,"end_character":48},"in_reply_to":"9fdfeff1_f18e0426","updated":"2019-01-23 17:21:20.000000000","message":"restored the original order.","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4f135443e9d39ec1a5adf279fc0449714af2efc5","unresolved":false,"context_lines":[{"line_number":837,"context_line":"                exception.CannotResizeToSameFlavor,"},{"line_number":838,"context_line":"                exception.CPUThreadPolicyConfigurationInvalid,"},{"line_number":839,"context_line":"                exception.FlavorNotFound,"},{"line_number":840,"context_line":"                exception.ImageCPUPinningForbidden,"},{"line_number":841,"context_line":"                exception.ImageCPUThreadPolicyForbidden,"},{"line_number":842,"context_line":"                exception.ImageNUMATopologyAsymmetric,"},{"line_number":843,"context_line":"                exception.ImageNUMATopologyCPUDuplicates,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_a7e1999d","line":840,"updated":"2019-01-29 15:59:14.000000000","message":"Good lord would it be possible to throw the new set of exceptions in a common list or something so we don\u0027t have to try and manage them all as a giant block like this in three different places?","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"02a4ade237a955af3702b17a8e1a7c51a50b71d9","unresolved":false,"context_lines":[{"line_number":837,"context_line":"                exception.CannotResizeToSameFlavor,"},{"line_number":838,"context_line":"                exception.CPUThreadPolicyConfigurationInvalid,"},{"line_number":839,"context_line":"                exception.FlavorNotFound,"},{"line_number":840,"context_line":"                exception.ImageCPUPinningForbidden,"},{"line_number":841,"context_line":"                exception.ImageCPUThreadPolicyForbidden,"},{"line_number":842,"context_line":"                exception.ImageNUMATopologyAsymmetric,"},{"line_number":843,"context_line":"                exception.ImageNUMATopologyCPUDuplicates,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_4b7f7ddf","line":840,"in_reply_to":"9fdfeff1_a7e1999d","updated":"2019-01-31 02:22:35.000000000","message":"\u003e Good lord would it be possible to throw the new set of exceptions\n \u003e in a common list or something so we don\u0027t have to try and manage\n \u003e them all as a giant block like this in three different places?\n\nIt\u0027s good idea but might be cleaner to do it as a separate commit.","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5879c81dae420f6cba5b3d2e57f0986a732ba815","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"                exception.MemoryPageSizeForbidden,"},{"line_number":1069,"context_line":"                exception.MemoryPageSizeInvalid,"},{"line_number":1070,"context_line":"                exception.RealtimeConfigurationInvalid,"},{"line_number":1071,"context_line":"                exception.RealtimeMaskNotFoundOrInvalid,"},{"line_number":1072,"context_line":"                ) as error:"},{"line_number":1073,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.format_message())"},{"line_number":1074,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_adebe675","line":1071,"updated":"2019-02-25 07:31:14.000000000","message":"oh...my god..can we put them into a common list for create and rebuild and resize method?","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"49330f40dd7565ea4afa53bca5e0bf073cc3fdcf","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"                exception.MemoryPageSizeForbidden,"},{"line_number":1069,"context_line":"                exception.MemoryPageSizeInvalid,"},{"line_number":1070,"context_line":"                exception.RealtimeConfigurationInvalid,"},{"line_number":1071,"context_line":"                exception.RealtimeMaskNotFoundOrInvalid,"},{"line_number":1072,"context_line":"                ) as error:"},{"line_number":1073,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.format_message())"},{"line_number":1074,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_b7aebee4","line":1071,"in_reply_to":"9fdfeff1_adebe675","updated":"2019-02-25 23:03:04.000000000","message":"can do","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":854,"context_line":"                exception.CannotResizeToSameFlavor,"},{"line_number":855,"context_line":"                exception.FlavorNotFound,"},{"line_number":856,"context_line":"                exception.NoValidHost,"},{"line_number":857,"context_line":"                exception.PciRequestAliasNotDefined) as e:"},{"line_number":858,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":859,"context_line":"        except exception.Invalid:"},{"line_number":860,"context_line":"            msg \u003d _(\"Invalid instance image.\")"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_09213dfd","side":"PARENT","line":857,"range":{"start_line":857,"start_character":26,"end_line":857,"end_character":51},"updated":"2019-03-02 03:05:24.000000000","message":"Hmm, where would we hit this from resize? It looks like this is raised from get_pci_requests_from_flavor but I only see that called in the API from _validate_and_build_base_options which is only called from server create. Should we be calling that from the resize flow to validate pci requests in the new flavor?\n\nAlso, it looks like get_pci_requests_from_flavor can raise PciInvalidAlias but we don\u0027t handle that in the API anywhere, unless we handle the base class (Invalid)? Also, does that mean the pci alias configuration in the API service has to be the same across all of the compute services? Because that seems wrong.","commit_id":"ee57c92e8b675adf3f35de29f7cea9c9d042d44b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48e96793dfa2c120976f52e6d5e3952a94a6f76d","unresolved":false,"context_lines":[{"line_number":854,"context_line":"                exception.CannotResizeToSameFlavor,"},{"line_number":855,"context_line":"                exception.FlavorNotFound,"},{"line_number":856,"context_line":"                exception.NoValidHost,"},{"line_number":857,"context_line":"                exception.PciRequestAliasNotDefined) as e:"},{"line_number":858,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":859,"context_line":"        except exception.Invalid:"},{"line_number":860,"context_line":"            msg \u003d _(\"Invalid instance image.\")"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cfd47e22","side":"PARENT","line":857,"range":{"start_line":857,"start_character":26,"end_line":857,"end_character":51},"in_reply_to":"9fdfeff1_09213dfd","updated":"2019-03-04 16:17:33.000000000","message":"\u003e Hmm, where would we hit this from resize? It looks like this is\n \u003e raised from get_pci_requests_from_flavor but I only see that called\n \u003e in the API from _validate_and_build_base_options which is only\n \u003e called from server create. Should we be calling that from the\n \u003e resize flow to validate pci requests in the new flavor?\n\nResize is a synchronous from API to conductor to scheduler so is there something in the scheduler filters that could hit this and return an error?\n\n \u003e Also, it looks like get_pci_requests_from_flavor can raise\n \u003e PciInvalidAlias but we don\u0027t handle that in the API anywhere,\n \u003e unless we handle the base class (Invalid)? Also, does that mean the\n \u003e pci alias configuration in the API service has to be the same\n \u003e across all of the compute services? Because that seems wrong.\n\nI guess the Invalid would be handled here:\n\nhttps://github.com/openstack/nova/blob/c7db20d140eb0d3ccf0fd107eda7e80275bdd7d4/nova/api/openstack/wsgi.py#L367\n\nI guess the PCI alias is also supposed to be configured in the API:\n\nhttps://docs.openstack.org/nova/latest/admin/pci-passthrough.html#configure-nova-api-controller","commit_id":"ee57c92e8b675adf3f35de29f7cea9c9d042d44b"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":854,"context_line":"                exception.CannotResizeToSameFlavor,"},{"line_number":855,"context_line":"                exception.FlavorNotFound,"},{"line_number":856,"context_line":"                exception.NoValidHost,"},{"line_number":857,"context_line":"                exception.PciRequestAliasNotDefined) as e:"},{"line_number":858,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":859,"context_line":"        except exception.Invalid:"},{"line_number":860,"context_line":"            msg \u003d _(\"Invalid instance image.\")"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_b99148fa","side":"PARENT","line":857,"range":{"start_line":857,"start_character":26,"end_line":857,"end_character":51},"in_reply_to":"9fdfeff1_09213dfd","updated":"2019-03-04 17:32:29.000000000","message":"I think we could normally hit this from ResourceTracker._move_claim() during a resize, but that\u0027s after an RPC cast.  I think that probably does mean that we need to call get_pci_requests_from_flavor in the API resize code path to trigger the exception if the PCI stuff is badly formatted.\n\nI think you found a legitimate issue with PciInvalidAlias. The base class exception is handled in some code paths but not all, and in one case it\u0027s assumed to be an image problem.\n\nPer sean-k-mooney, it is expected that the PCI aliases are configured the same on the API service and all compute services.","commit_id":"ee57c92e8b675adf3f35de29f7cea9c9d042d44b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                exception.FlavorDiskTooSmall,"},{"line_number":644,"context_line":"                exception.FlavorMemoryTooSmall,"},{"line_number":645,"context_line":"                exception.InvalidMetadata,"},{"line_number":646,"context_line":"                exception.InvalidRequest,"},{"line_number":647,"context_line":"                exception.InvalidVolume,"},{"line_number":648,"context_line":"                exception.MultiplePortsNotApplicable,"},{"line_number":649,"context_line":"                exception.InvalidFixedIpAndMaxCountRequest,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_892c4d02","line":646,"range":{"start_line":646,"start_character":16,"end_line":646,"end_character":41},"updated":"2019-03-02 03:05:24.000000000","message":"nit: you could remove this from this list since it\u0027s in the one below","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                exception.FlavorDiskTooSmall,"},{"line_number":644,"context_line":"                exception.FlavorMemoryTooSmall,"},{"line_number":645,"context_line":"                exception.InvalidMetadata,"},{"line_number":646,"context_line":"                exception.InvalidRequest,"},{"line_number":647,"context_line":"                exception.InvalidVolume,"},{"line_number":648,"context_line":"                exception.MultiplePortsNotApplicable,"},{"line_number":649,"context_line":"                exception.InvalidFixedIpAndMaxCountRequest,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_39aeb82f","line":646,"range":{"start_line":646,"start_character":16,"end_line":646,"end_character":41},"in_reply_to":"9fdfeff1_892c4d02","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"}],"nova/compute/api.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":736,"context_line":"        image \u003d self.image_api.get(context, image_href)"},{"line_number":737,"context_line":"        return image[\u0027id\u0027], image"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def _checks_for_create_and_rebuild(self, context, image_id, image,"},{"line_number":740,"context_line":"                                       instance_type, metadata,"},{"line_number":741,"context_line":"                                       files_to_inject, root_bdm):"},{"line_number":742,"context_line":"        self._check_metadata_properties_quota(context, metadata)"},{"line_number":743,"context_line":"        self._check_injected_file_quota(context, files_to_inject)"},{"line_number":744,"context_line":"        self._check_requested_image(context, image_id, image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ce50a40b","side":"PARENT","line":741,"range":{"start_line":739,"start_character":7,"end_line":741,"end_character":66},"updated":"2018-12-05 15:57:29.000000000","message":"these changes not needed","commit_id":"3b2e42f37152a539472782ad1d71c1f951c0343b"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":736,"context_line":"        image \u003d self.image_api.get(context, image_href)"},{"line_number":737,"context_line":"        return image[\u0027id\u0027], image"},{"line_number":738,"context_line":""},{"line_number":739,"context_line":"    def _checks_for_create_and_rebuild(self, context, image_id, image,"},{"line_number":740,"context_line":"                                       instance_type, metadata,"},{"line_number":741,"context_line":"                                       files_to_inject, root_bdm):"},{"line_number":742,"context_line":"        self._check_metadata_properties_quota(context, metadata)"},{"line_number":743,"context_line":"        self._check_injected_file_quota(context, files_to_inject)"},{"line_number":744,"context_line":"        self._check_requested_image(context, image_id, image,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_84031264","side":"PARENT","line":741,"range":{"start_line":739,"start_character":7,"end_line":741,"end_character":66},"in_reply_to":"3f79a3b5_ce50a40b","updated":"2018-12-10 19:48:11.000000000","message":"Done","commit_id":"3b2e42f37152a539472782ad1d71c1f951c0343b"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":741,"context_line":"                                       files_to_inject, root_bdm):"},{"line_number":742,"context_line":"        self._check_metadata_properties_quota(context, metadata)"},{"line_number":743,"context_line":"        self._check_injected_file_quota(context, files_to_inject)"},{"line_number":744,"context_line":"        self._check_requested_image(context, image_id, image,"},{"line_number":745,"context_line":"                                    instance_type, root_bdm)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _validate_and_build_base_options(self, context, instance_type,"},{"line_number":748,"context_line":"                                         boot_meta, image_href, image_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4e3c94bc","side":"PARENT","line":745,"range":{"start_line":744,"start_character":8,"end_line":745,"end_character":60},"updated":"2018-12-05 15:57:29.000000000","message":"leave this here, just adjust the name appropriately","commit_id":"3b2e42f37152a539472782ad1d71c1f951c0343b"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":741,"context_line":"                                       files_to_inject, root_bdm):"},{"line_number":742,"context_line":"        self._check_metadata_properties_quota(context, metadata)"},{"line_number":743,"context_line":"        self._check_injected_file_quota(context, files_to_inject)"},{"line_number":744,"context_line":"        self._check_requested_image(context, image_id, image,"},{"line_number":745,"context_line":"                                    instance_type, root_bdm)"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _validate_and_build_base_options(self, context, instance_type,"},{"line_number":748,"context_line":"                                         boot_meta, image_href, image_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_a4064e72","side":"PARENT","line":745,"range":{"start_line":744,"start_character":8,"end_line":745,"end_character":60},"in_reply_to":"3f79a3b5_4e3c94bc","updated":"2018-12-10 19:48:11.000000000","message":"Done","commit_id":"3b2e42f37152a539472782ad1d71c1f951c0343b"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        # We can\u0027t do this check earlier because we need bdms from all sources"},{"line_number":1177,"context_line":"        # to have been merged in order to get the root bdm."},{"line_number":1178,"context_line":"        self._checks_for_create_and_rebuild(context, metadata, injected_files)"},{"line_number":1179,"context_line":"        self._validate_flavor_image(context, image_id, boot_meta,"},{"line_number":1180,"context_line":"                                    instance_type,"},{"line_number":1181,"context_line":"                                    block_device_mapping.root_bdm())"},{"line_number":1182,"context_line":""},{"line_number":1183,"context_line":"        instance_group \u003d self._get_requested_instance_group(context,"},{"line_number":1184,"context_line":"                                   filter_properties)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8e5f0c0f","line":1181,"range":{"start_line":1178,"start_character":7,"end_line":1181,"end_character":68},"updated":"2018-12-05 15:57:29.000000000","message":"change not needed if you have _checks_for_create_and_rebuild() call _validate_flavor_image()","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        # We can\u0027t do this check earlier because we need bdms from all sources"},{"line_number":1177,"context_line":"        # to have been merged in order to get the root bdm."},{"line_number":1178,"context_line":"        self._checks_for_create_and_rebuild(context, metadata, injected_files)"},{"line_number":1179,"context_line":"        self._validate_flavor_image(context, image_id, boot_meta,"},{"line_number":1180,"context_line":"                                    instance_type,"},{"line_number":1181,"context_line":"                                    block_device_mapping.root_bdm())"},{"line_number":1182,"context_line":""},{"line_number":1183,"context_line":"        instance_group \u003d self._get_requested_instance_group(context,"},{"line_number":1184,"context_line":"                                   filter_properties)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_24123eae","line":1181,"range":{"start_line":1178,"start_character":7,"end_line":1181,"end_character":68},"in_reply_to":"3f79a3b5_8e5f0c0f","updated":"2018-12-10 19:48:11.000000000","message":"Done","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":3318,"context_line":"        else:"},{"line_number":3319,"context_line":"            orig_image_ref \u003d instance.image_ref"},{"line_number":3320,"context_line":""},{"line_number":3321,"context_line":"        self._checks_for_create_and_rebuild(context, metadata, files_to_inject)"},{"line_number":3322,"context_line":"        self._validate_flavor_image(context, image_id, image, flavor, root_bdm)"},{"line_number":3323,"context_line":""},{"line_number":3324,"context_line":"        kernel_id, ramdisk_id \u003d self._handle_kernel_and_ramdisk("},{"line_number":3325,"context_line":"                context, None, None, image)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4e5574ec","line":3322,"range":{"start_line":3321,"start_character":7,"end_line":3322,"end_character":79},"updated":"2018-12-05 15:57:29.000000000","message":"change not needed if you have _checks_for_create_and_rebuild() call _validate_flavor_image()","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":3318,"context_line":"        else:"},{"line_number":3319,"context_line":"            orig_image_ref \u003d instance.image_ref"},{"line_number":3320,"context_line":""},{"line_number":3321,"context_line":"        self._checks_for_create_and_rebuild(context, metadata, files_to_inject)"},{"line_number":3322,"context_line":"        self._validate_flavor_image(context, image_id, image, flavor, root_bdm)"},{"line_number":3323,"context_line":""},{"line_number":3324,"context_line":"        kernel_id, ramdisk_id \u003d self._handle_kernel_and_ramdisk("},{"line_number":3325,"context_line":"                context, None, None, image)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_44665a58","line":3322,"range":{"start_line":3321,"start_character":7,"end_line":3322,"end_character":79},"in_reply_to":"3f79a3b5_4e5574ec","updated":"2018-12-10 19:48:11.000000000","message":"Done","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":3615,"context_line":"                                         current_instance_type,"},{"line_number":3616,"context_line":"                                         new_instance_type)"},{"line_number":3617,"context_line":""},{"line_number":3618,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3619,"context_line":"            context, instance.uuid)"},{"line_number":3620,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"},{"line_number":3621,"context_line":""},{"line_number":3622,"context_line":"        # Check to see if the image is changing and we have a volume-backed"},{"line_number":3623,"context_line":"        # server. The compute doesn\u0027t support changing the image in the"},{"line_number":3624,"context_line":"        # root disk of a volume-backed server, so we need to just fail fast."},{"line_number":3625,"context_line":"        is_volume_backed \u003d compute_utils.is_volume_backed_instance("},{"line_number":3626,"context_line":"            context, instance, bdms)"},{"line_number":3627,"context_line":"        if is_volume_backed:"},{"line_number":3628,"context_line":"            volume \u003d self.volume_api.get(context, root_bdm.volume_id)"},{"line_number":3629,"context_line":"            volume_image_metadata \u003d volume.get(\u0027volume_image_metadata\u0027, {})"},{"line_number":3630,"context_line":"            image_ref \u003d volume_image_metadata.get(\u0027image_id\u0027)"},{"line_number":3631,"context_line":"        else:"},{"line_number":3632,"context_line":"            image_ref \u003d instance.image_ref"},{"line_number":3633,"context_line":"        image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self._validate_flavor_image(context, image_id, image,"},{"line_number":3636,"context_line":"                                    new_instance_type, root_bdm)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ceec2429","line":3633,"range":{"start_line":3618,"start_character":6,"end_line":3633,"end_character":61},"updated":"2018-12-05 15:57:29.000000000","message":"all this code is related to changing the image, which can\u0027t happen in this code path, so it can all be removed.","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"24223014d816278c8d2ca9c8d3dd9988c5c17d56","unresolved":false,"context_lines":[{"line_number":3615,"context_line":"                                         current_instance_type,"},{"line_number":3616,"context_line":"                                         new_instance_type)"},{"line_number":3617,"context_line":""},{"line_number":3618,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3619,"context_line":"            context, instance.uuid)"},{"line_number":3620,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"},{"line_number":3621,"context_line":""},{"line_number":3622,"context_line":"        # Check to see if the image is changing and we have a volume-backed"},{"line_number":3623,"context_line":"        # server. The compute doesn\u0027t support changing the image in the"},{"line_number":3624,"context_line":"        # root disk of a volume-backed server, so we need to just fail fast."},{"line_number":3625,"context_line":"        is_volume_backed \u003d compute_utils.is_volume_backed_instance("},{"line_number":3626,"context_line":"            context, instance, bdms)"},{"line_number":3627,"context_line":"        if is_volume_backed:"},{"line_number":3628,"context_line":"            volume \u003d self.volume_api.get(context, root_bdm.volume_id)"},{"line_number":3629,"context_line":"            volume_image_metadata \u003d volume.get(\u0027volume_image_metadata\u0027, {})"},{"line_number":3630,"context_line":"            image_ref \u003d volume_image_metadata.get(\u0027image_id\u0027)"},{"line_number":3631,"context_line":"        else:"},{"line_number":3632,"context_line":"            image_ref \u003d instance.image_ref"},{"line_number":3633,"context_line":"        image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self._validate_flavor_image(context, image_id, image,"},{"line_number":3636,"context_line":"                                    new_instance_type, root_bdm)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_647d96c1","line":3633,"range":{"start_line":3618,"start_character":6,"end_line":3633,"end_character":61},"in_reply_to":"3f79a3b5_ceec2429","updated":"2018-12-10 19:48:11.000000000","message":"\u003e all this code is related to changing the image, which can\u0027t happen\n \u003e in this code path, so it can all be removed.\n\nimage_id and image need to be passed in _validate_flavor_image() in order to check any image-flavor inconsistency.","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d2cf6c82b905eb8997eff8ca284855d6793baa5c","unresolved":false,"context_lines":[{"line_number":3632,"context_line":"            image_ref \u003d instance.image_ref"},{"line_number":3633,"context_line":"        image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self._validate_flavor_image(context, image_id, image,"},{"line_number":3636,"context_line":"                                    new_instance_type, root_bdm)"},{"line_number":3637,"context_line":""},{"line_number":3638,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3639,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_6edf1039","line":3636,"range":{"start_line":3635,"start_character":8,"end_line":3636,"end_character":64},"updated":"2018-12-05 15:57:29.000000000","message":"this is either a cold migration (if flavor_id is not set) or a resize (if it is).  The flavor only changes on a resize, so you should be able to just move this check up to line 3589 so that it\u0027s part of the \"else\" at 3580.","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"ea651b38f9ea99854db6290f8f34ab30883da939","unresolved":false,"context_lines":[{"line_number":3632,"context_line":"            image_ref \u003d instance.image_ref"},{"line_number":3633,"context_line":"        image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self._validate_flavor_image(context, image_id, image,"},{"line_number":3636,"context_line":"                                    new_instance_type, root_bdm)"},{"line_number":3637,"context_line":""},{"line_number":3638,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3639,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"dfd5e7cf_87740337","line":3636,"range":{"start_line":3635,"start_character":8,"end_line":3636,"end_character":64},"in_reply_to":"3f79a3b5_6edf1039","updated":"2019-01-09 01:07:58.000000000","message":"\u003e this is either a cold migration (if flavor_id is not set) or a\n \u003e resize (if it is).  The flavor only changes on a resize, so you\n \u003e should be able to just move this check up to line 3589 so that it\u0027s\n \u003e part of the \"else\" at 3580.\n\ndone.","commit_id":"b5f5da43032f1d7c4e57c2aa6ab3da526d03bf51"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"fbf10eadff2980a0701769a4cc7e874bd2313f2e","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":628,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        if CONF.serial_console.enabled:"},{"line_number":631,"context_line":"            hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"        if hardware.is_realtime_enabled(instance_type):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_3f5f7e42","line":630,"range":{"start_line":630,"start_character":11,"end_line":630,"end_character":38},"updated":"2019-01-11 20:04:06.000000000","message":"I think this config option might only be used on the compute node currently.  If we want to start using it on a controller node we might need to update the release notes.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"fc957294012961f75a59cb4b3351341cc72218f7","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":628,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"        if CONF.serial_console.enabled:"},{"line_number":631,"context_line":"            hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"        if hardware.is_realtime_enabled(instance_type):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_fdbedefd","line":630,"range":{"start_line":630,"start_character":11,"end_line":630,"end_character":38},"in_reply_to":"bfdaf3ff_3f5f7e42","updated":"2019-01-14 21:42:48.000000000","message":"removed the if condition. get_number_of_serial_ports() only checks the value of serial_port_count if it is set, so no need for the if statement.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"fbf10eadff2980a0701769a4cc7e874bd2313f2e","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        if CONF.serial_console.enabled:"},{"line_number":631,"context_line":"            hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":634,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":635,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_4212a95a","line":635,"range":{"start_line":633,"start_character":7,"end_line":635,"end_character":73},"updated":"2019-01-11 20:04:06.000000000","message":"maybe add a comment here indicating that we don\u0027t actually care about the results if no exception is raised, we\u0027re just checking that the image/flavor are reasonable and compatible.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"fc957294012961f75a59cb4b3351341cc72218f7","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        if CONF.serial_console.enabled:"},{"line_number":631,"context_line":"            hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":634,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":635,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_7d598efc","line":635,"range":{"start_line":633,"start_character":7,"end_line":635,"end_character":73},"in_reply_to":"bfdaf3ff_4212a95a","updated":"2019-01-14 21:42:48.000000000","message":"Done","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"fbf10eadff2980a0701769a4cc7e874bd2313f2e","unresolved":false,"context_lines":[{"line_number":3315,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3316,"context_line":"            context, instance.uuid)"},{"line_number":3317,"context_line":""},{"line_number":3318,"context_line":"        self._validate_numa_topology(flavor, image)"},{"line_number":3319,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, image,"},{"line_number":3320,"context_line":"                flavor, metadata, files_to_inject, root_bdm)"},{"line_number":3321,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_62d9ed81","line":3318,"range":{"start_line":3318,"start_character":7,"end_line":3318,"end_character":51},"updated":"2019-01-11 20:04:06.000000000","message":"I\u0027m not a huge fan of validating numa topology separate from everything else.\n\nI wonder if it\u0027d be nicer if we added a \"validate_numa\" argument to _checks_for_create_and_rebuild() which would default to \"True\".  Then in _create_instance() we could call _checks_for_create_and_rebuild(validate_numa\u003dFalse) since it\u0027s already been done.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"21dedcc12c3fdd93b567f95d7679d4308f1ebc07","unresolved":false,"context_lines":[{"line_number":3315,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3316,"context_line":"            context, instance.uuid)"},{"line_number":3317,"context_line":""},{"line_number":3318,"context_line":"        self._validate_numa_topology(flavor, image)"},{"line_number":3319,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, image,"},{"line_number":3320,"context_line":"                flavor, metadata, files_to_inject, root_bdm)"},{"line_number":3321,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_c81bf718","line":3318,"range":{"start_line":3318,"start_character":7,"end_line":3318,"end_character":51},"in_reply_to":"bfdaf3ff_62d9ed81","updated":"2019-01-14 22:07:00.000000000","message":"Done","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"fbf10eadff2980a0701769a4cc7e874bd2313f2e","unresolved":false,"context_lines":[{"line_number":3573,"context_line":"                reason \u003d _(\u0027Resize to zero disk flavor is not allowed.\u0027)"},{"line_number":3574,"context_line":"                raise exception.CannotResizeDisk(reason\u003dreason)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"            if new_instance_type:"},{"line_number":3577,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3578,"context_line":"                    context, instance.uuid)"},{"line_number":3579,"context_line":"                root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"},{"line_number":3580,"context_line":""},{"line_number":3581,"context_line":"                is_volume_backed \u003d compute_utils.is_volume_backed_instance("},{"line_number":3582,"context_line":"                    context, instance, bdms)"},{"line_number":3583,"context_line":"                if is_volume_backed:"},{"line_number":3584,"context_line":"                    volume \u003d self.volume_api.get(context, root_bdm.volume_id)"},{"line_number":3585,"context_line":"                    volume_image_metadata \u003d volume.get(\u0027volume_image_metadata\u0027,"},{"line_number":3586,"context_line":"                                                       {})"},{"line_number":3587,"context_line":"                    image_ref \u003d volume_image_metadata.get(\u0027image_id\u0027)"},{"line_number":3588,"context_line":"                else:"},{"line_number":3589,"context_line":"                    image_ref \u003d instance.image_ref"},{"line_number":3590,"context_line":"                image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3591,"context_line":"                self._validate_numa_topology(new_instance_type, image)"},{"line_number":3592,"context_line":"                self._validate_flavor_image(context, image_id, image,"},{"line_number":3593,"context_line":"                                            new_instance_type, root_bdm)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_4294e944","line":3590,"range":{"start_line":3576,"start_character":12,"end_line":3590,"end_character":69},"updated":"2019-01-11 20:04:06.000000000","message":"I think this is wrong.  In the case of a resize the image isn\u0027t changing.  Also, I think it\u0027s possible the image properties (of the image) may have been updated since the instance was created, so I think we should use instance.image_meta here rather than the current properties for the image.  (In order to match what will be used later on in the virt driver.)","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"0ff4a20f7d1c04e5069a07315344d3425af676e0","unresolved":false,"context_lines":[{"line_number":3573,"context_line":"                reason \u003d _(\u0027Resize to zero disk flavor is not allowed.\u0027)"},{"line_number":3574,"context_line":"                raise exception.CannotResizeDisk(reason\u003dreason)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"            if new_instance_type:"},{"line_number":3577,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3578,"context_line":"                    context, instance.uuid)"},{"line_number":3579,"context_line":"                root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"},{"line_number":3580,"context_line":""},{"line_number":3581,"context_line":"                is_volume_backed \u003d compute_utils.is_volume_backed_instance("},{"line_number":3582,"context_line":"                    context, instance, bdms)"},{"line_number":3583,"context_line":"                if is_volume_backed:"},{"line_number":3584,"context_line":"                    volume \u003d self.volume_api.get(context, root_bdm.volume_id)"},{"line_number":3585,"context_line":"                    volume_image_metadata \u003d volume.get(\u0027volume_image_metadata\u0027,"},{"line_number":3586,"context_line":"                                                       {})"},{"line_number":3587,"context_line":"                    image_ref \u003d volume_image_metadata.get(\u0027image_id\u0027)"},{"line_number":3588,"context_line":"                else:"},{"line_number":3589,"context_line":"                    image_ref \u003d instance.image_ref"},{"line_number":3590,"context_line":"                image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3591,"context_line":"                self._validate_numa_topology(new_instance_type, image)"},{"line_number":3592,"context_line":"                self._validate_flavor_image(context, image_id, image,"},{"line_number":3593,"context_line":"                                            new_instance_type, root_bdm)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_39ad0588","line":3590,"range":{"start_line":3576,"start_character":12,"end_line":3590,"end_character":69},"in_reply_to":"bfdaf3ff_4294e944","updated":"2019-01-16 20:56:27.000000000","message":"\u003e I think this is wrong.  In the case of a resize the image isn\u0027t\n \u003e changing.  Also, I think it\u0027s possible the image properties (of the\n \u003e image) may have been updated since the instance was created, so I\n \u003e think we should use instance.image_meta here rather than the\n \u003e current properties for the image.  (In order to match what will be\n \u003e used later on in the virt driver.)\n\ngetting image meta from request_spec now as you suggested, since it is what is used in later resize path.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"fc957294012961f75a59cb4b3351341cc72218f7","unresolved":false,"context_lines":[{"line_number":3573,"context_line":"                reason \u003d _(\u0027Resize to zero disk flavor is not allowed.\u0027)"},{"line_number":3574,"context_line":"                raise exception.CannotResizeDisk(reason\u003dreason)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"            if new_instance_type:"},{"line_number":3577,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3578,"context_line":"                    context, instance.uuid)"},{"line_number":3579,"context_line":"                root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"},{"line_number":3580,"context_line":""},{"line_number":3581,"context_line":"                is_volume_backed \u003d compute_utils.is_volume_backed_instance("},{"line_number":3582,"context_line":"                    context, instance, bdms)"},{"line_number":3583,"context_line":"                if is_volume_backed:"},{"line_number":3584,"context_line":"                    volume \u003d self.volume_api.get(context, root_bdm.volume_id)"},{"line_number":3585,"context_line":"                    volume_image_metadata \u003d volume.get(\u0027volume_image_metadata\u0027,"},{"line_number":3586,"context_line":"                                                       {})"},{"line_number":3587,"context_line":"                    image_ref \u003d volume_image_metadata.get(\u0027image_id\u0027)"},{"line_number":3588,"context_line":"                else:"},{"line_number":3589,"context_line":"                    image_ref \u003d instance.image_ref"},{"line_number":3590,"context_line":"                image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3591,"context_line":"                self._validate_numa_topology(new_instance_type, image)"},{"line_number":3592,"context_line":"                self._validate_flavor_image(context, image_id, image,"},{"line_number":3593,"context_line":"                                            new_instance_type, root_bdm)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_280e4332","line":3590,"range":{"start_line":3576,"start_character":12,"end_line":3590,"end_character":69},"in_reply_to":"bfdaf3ff_4294e944","updated":"2019-01-14 21:42:48.000000000","message":"\u003e I think this is wrong.  In the case of a resize the image isn\u0027t\n \u003e changing.  Also, I think it\u0027s possible the image properties (of the\n \u003e image) may have been updated since the instance was created, so I\n \u003e think we should use instance.image_meta here rather than the\n \u003e current properties for the image.  (In order to match what will be\n \u003e used later on in the virt driver.)\n\nwhat if the instance is volume backed?","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"59729c373fb6b9c829d1bd6d28d8ec5156373736","unresolved":false,"context_lines":[{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        try:"},{"line_number":534,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":535,"context_line":"        except ValueError as e:"},{"line_number":536,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":537,"context_line":"            # consider this an invalid request"},{"line_number":538,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":539,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":542,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_9eb51ad0","line":539,"range":{"start_line":535,"start_character":8,"end_line":539,"end_character":47},"updated":"2019-01-15 15:47:15.000000000","message":"I don\u0027t see any other place handle this like this.","commit_id":"7cb53a855a0490a836f90ad4cb945e5bcd83c753"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"456ddd7439b271032f4db287f6b4ddabd6c5c50f","unresolved":false,"context_lines":[{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        try:"},{"line_number":534,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":535,"context_line":"        except ValueError as e:"},{"line_number":536,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":537,"context_line":"            # consider this an invalid request"},{"line_number":538,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":539,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":542,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_e11cbfc2","line":539,"range":{"start_line":535,"start_character":8,"end_line":539,"end_character":47},"in_reply_to":"bfdaf3ff_9eb51ad0","updated":"2019-01-15 20:12:10.000000000","message":"\u003e I don\u0027t see any other place handle this like this.\n\nIt is similar to what\u0027s in _validate_and_build_base_options(), line 811","commit_id":"7cb53a855a0490a836f90ad4cb945e5bcd83c753"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"59729c373fb6b9c829d1bd6d28d8ec5156373736","unresolved":false,"context_lines":[{"line_number":3589,"context_line":"                    image_ref \u003d instance.image_ref"},{"line_number":3590,"context_line":"                image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3591,"context_line":"                self._validate_flavor_image(context, image_id,"},{"line_number":3592,"context_line":"                                            instance.image_meta,"},{"line_number":3593,"context_line":"                                            new_instance_type, root_bdm)"},{"line_number":3594,"context_line":""},{"line_number":3595,"context_line":"        if not new_instance_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_dd7645d9","line":3592,"range":{"start_line":3592,"start_character":44,"end_line":3592,"end_character":63},"updated":"2019-01-15 15:47:15.000000000","message":"this seems causing test failure, you passed ImageMeta here and it should be image?","commit_id":"7cb53a855a0490a836f90ad4cb945e5bcd83c753"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"456ddd7439b271032f4db287f6b4ddabd6c5c50f","unresolved":false,"context_lines":[{"line_number":3589,"context_line":"                    image_ref \u003d instance.image_ref"},{"line_number":3590,"context_line":"                image_id, image \u003d self._get_image(context, image_ref)"},{"line_number":3591,"context_line":"                self._validate_flavor_image(context, image_id,"},{"line_number":3592,"context_line":"                                            instance.image_meta,"},{"line_number":3593,"context_line":"                                            new_instance_type, root_bdm)"},{"line_number":3594,"context_line":""},{"line_number":3595,"context_line":"        if not new_instance_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_c14f3bbb","line":3592,"range":{"start_line":3592,"start_character":44,"end_line":3592,"end_character":63},"in_reply_to":"bfdaf3ff_dd7645d9","updated":"2019-01-15 20:12:10.000000000","message":"Done","commit_id":"7cb53a855a0490a836f90ad4cb945e5bcd83c753"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d75b56599b6b53852b88eb9c2aa09df29a12b419","unresolved":false,"context_lines":[{"line_number":3611,"context_line":"            context, instance.uuid)"},{"line_number":3612,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3613,"context_line":""},{"line_number":3614,"context_line":"        legacy_spec \u003d request_spec.to_legacy_request_spec_dict()"},{"line_number":3615,"context_line":"        legacy_spec \u003d jsonutils.loads(jsonutils.dumps(legacy_spec))"},{"line_number":3616,"context_line":"        image \u003d legacy_spec[\u0027image\u0027]"},{"line_number":3617,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3618,"context_line":"            context, instance.uuid)"},{"line_number":3619,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_d1b660da","line":3616,"range":{"start_line":3614,"start_character":0,"end_line":3616,"end_character":36},"updated":"2019-01-22 19:39:18.000000000","message":"this seems kind of indirect...is there no cleaner way to do this?","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"9b2809a6cf118cf8270320aa21fad824037ecec6","unresolved":false,"context_lines":[{"line_number":3611,"context_line":"            context, instance.uuid)"},{"line_number":3612,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3613,"context_line":""},{"line_number":3614,"context_line":"        legacy_spec \u003d request_spec.to_legacy_request_spec_dict()"},{"line_number":3615,"context_line":"        legacy_spec \u003d jsonutils.loads(jsonutils.dumps(legacy_spec))"},{"line_number":3616,"context_line":"        image \u003d legacy_spec[\u0027image\u0027]"},{"line_number":3617,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3618,"context_line":"            context, instance.uuid)"},{"line_number":3619,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_84ccefbc","line":3616,"range":{"start_line":3614,"start_character":0,"end_line":3616,"end_character":36},"in_reply_to":"9fdfeff1_d1b660da","updated":"2019-01-23 17:21:20.000000000","message":"Done","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4f135443e9d39ec1a5adf279fc0449714af2efc5","unresolved":false,"context_lines":[{"line_number":3611,"context_line":"            context, instance.uuid)"},{"line_number":3612,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3613,"context_line":""},{"line_number":3614,"context_line":"        image \u003d obj_base.obj_to_primitive(request_spec.image)"},{"line_number":3615,"context_line":"        image \u003d jsonutils.loads(jsonutils.dumps(image))"},{"line_number":3616,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3617,"context_line":"            context, instance.uuid)"},{"line_number":3618,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_679651f3","line":3615,"range":{"start_line":3614,"start_character":8,"end_line":3615,"end_character":55},"updated":"2019-01-29 15:59:14.000000000","message":"Why does this need to happen? Seems like masking a bug - there should at least be a comment. Also, request_spec.image might not even be there for volume-backed servers right?","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"02a4ade237a955af3702b17a8e1a7c51a50b71d9","unresolved":false,"context_lines":[{"line_number":3611,"context_line":"            context, instance.uuid)"},{"line_number":3612,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3613,"context_line":""},{"line_number":3614,"context_line":"        image \u003d obj_base.obj_to_primitive(request_spec.image)"},{"line_number":3615,"context_line":"        image \u003d jsonutils.loads(jsonutils.dumps(image))"},{"line_number":3616,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3617,"context_line":"            context, instance.uuid)"},{"line_number":3618,"context_line":"        root_bdm \u003d compute_utils.get_root_bdm(context, instance, bdms)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_2b1799a6","line":3615,"range":{"start_line":3614,"start_character":8,"end_line":3615,"end_character":55},"in_reply_to":"9fdfeff1_679651f3","updated":"2019-01-31 02:22:35.000000000","message":"\u003e Why does this need to happen? Seems like masking a bug - there\n \u003e should at least be a comment. Also, request_spec.image might not\n \u003e even be there for volume-backed servers right?\nChanged to get image metadata from instance.system_metadata. It works for both image and volume backed instances.","commit_id":"2c206de988e45d0375ff7a7bdeef877cc16b8096"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5879c81dae420f6cba5b3d2e57f0986a732ba815","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_28b92414","line":624,"range":{"start_line":624,"start_character":17,"end_line":624,"end_character":46},"updated":"2019-02-25 07:31:14.000000000","message":"why don\u0027t we call this method \u0027get_best_cpu_topology\u0027?  It will call this method and also \u0027_get_possible_cpu_topologies\u0027. \u0027_get_possible_cpu_topologies\u0027 will check the possible cpu topo also.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"49330f40dd7565ea4afa53bca5e0bf073cc3fdcf","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_37e96e19","line":624,"range":{"start_line":624,"start_character":17,"end_line":624,"end_character":46},"in_reply_to":"9fdfeff1_28b92414","updated":"2019-02-25 23:03:04.000000000","message":"Might make sense, but it\u0027s not really part of this commit.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"85e2b39a1f28dbc3fcd7ea2385acdfbebf8abec9","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_d3833655","line":624,"range":{"start_line":624,"start_character":17,"end_line":624,"end_character":46},"in_reply_to":"9fdfeff1_37e96e19","updated":"2019-02-27 07:11:58.000000000","message":"sorry, I didn\u0027t get why it isn\u0027t part of this commit...","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_f70df88e","line":624,"range":{"start_line":624,"start_character":17,"end_line":624,"end_character":46},"in_reply_to":"9fdfeff1_d3833655","updated":"2019-02-27 19:10:41.000000000","message":"The hardware._get_cpu_topology_constraints() function exists already.  We\u0027re just calling it.  Any change to the function name should be done in a separate commit.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"4b4b224fd5d7643ba44cdc2857617e42b7f3b37d","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_ec799dfb","line":624,"range":{"start_line":624,"start_character":17,"end_line":624,"end_character":46},"in_reply_to":"9fdfeff1_f70df88e","updated":"2019-02-28 07:20:47.000000000","message":"After talking on IRC, what Alex Xu meant was \"why don\u0027t we call get_best_cpu_topology() instead of _get_cpu_topology_constraints().\n\nThe answer is that we don\u0027t know the value of \"allow_threads\" as it\u0027s hypervisor-specific, and we don\u0027t know \"numa_topology\" here either.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5879c81dae420f6cba5b3d2e57f0986a732ba815","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":609,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        try:"},{"line_number":612,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":613,"context_line":"        except ValueError as e:"},{"line_number":614,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":615,"context_line":"            # consider this an invalid request"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":617,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"        # Only validate values of flavor/image so the return results of"},{"line_number":620,"context_line":"        # following \u0027get\u0027 functions are not used."},{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"},{"line_number":629,"context_line":"                                root_device_name):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_2815a4e5","line":626,"range":{"start_line":611,"start_character":7,"end_line":626,"end_character":68},"updated":"2019-02-25 07:31:14.000000000","message":"How about we put those check into method, then we needn\u0027t the hack at line 3570","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"85e2b39a1f28dbc3fcd7ea2385acdfbebf8abec9","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":609,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        try:"},{"line_number":612,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":613,"context_line":"        except ValueError as e:"},{"line_number":614,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":615,"context_line":"            # consider this an invalid request"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":617,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"        # Only validate values of flavor/image so the return results of"},{"line_number":620,"context_line":"        # following \u0027get\u0027 functions are not used."},{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"},{"line_number":629,"context_line":"                                root_device_name):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_73912a52","line":626,"range":{"start_line":611,"start_character":7,"end_line":626,"end_character":68},"in_reply_to":"9fdfeff1_1710eaff","updated":"2019-02-27 07:11:58.000000000","message":"I mean put all those check into another method (probably from line 533 to this line), then we needn\u0027t the hack in line 3572","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"49330f40dd7565ea4afa53bca5e0bf073cc3fdcf","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":609,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        try:"},{"line_number":612,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":613,"context_line":"        except ValueError as e:"},{"line_number":614,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":615,"context_line":"            # consider this an invalid request"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":617,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"        # Only validate values of flavor/image so the return results of"},{"line_number":620,"context_line":"        # following \u0027get\u0027 functions are not used."},{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"},{"line_number":629,"context_line":"                                root_device_name):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_1710eaff","line":626,"range":{"start_line":611,"start_character":7,"end_line":626,"end_character":68},"in_reply_to":"9fdfeff1_2815a4e5","updated":"2019-02-25 23:03:04.000000000","message":"Not sure what you mean here...are you suggesting adding explicit calls to hardware.numa_get_constraints() in the functions that call this function with validate_numa\u003dTrue?\n\nIf so, we\u0027d also have to add code to set \"image_meta\" in those calling sites, which seems like code duplication.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                        servers_policies.ZERO_DISK_FLAVOR, fatal\u003dFalse):"},{"line_number":609,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        try:"},{"line_number":612,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":613,"context_line":"        except ValueError as e:"},{"line_number":614,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":615,"context_line":"            # consider this an invalid request"},{"line_number":616,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":617,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"        # Only validate values of flavor/image so the return results of"},{"line_number":620,"context_line":"        # following \u0027get\u0027 functions are not used."},{"line_number":621,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":622,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":623,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":624,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":625,"context_line":"        if validate_numa:"},{"line_number":626,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _get_image_defined_bdms(self, instance_type, image_meta,"},{"line_number":629,"context_line":"                                root_device_name):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_c01d8c0f","line":626,"range":{"start_line":611,"start_character":7,"end_line":626,"end_character":68},"in_reply_to":"9fdfeff1_73912a52","updated":"2019-02-27 19:10:41.000000000","message":"I like the idea of a separate function for the resize case.\n\nThe _checks_for_create_and_rebuild() function will need to validate numa for rebuild but not for create, so we can\u0027t easily get rid of the \"validate_numa\" flag.","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5879c81dae420f6cba5b3d2e57f0986a732ba815","unresolved":false,"context_lines":[{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_081a2016","line":3574,"range":{"start_line":3574,"start_character":36,"end_line":3574,"end_character":40},"updated":"2019-02-25 07:31:14.000000000","message":"there should be \u0027True\u0027?","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"49330f40dd7565ea4afa53bca5e0bf073cc3fdcf","unresolved":false,"context_lines":[{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_f76be6b5","line":3574,"range":{"start_line":3574,"start_character":36,"end_line":3574,"end_character":40},"in_reply_to":"9fdfeff1_081a2016","updated":"2019-02-25 23:03:04.000000000","message":"no, the \"None\" corresponds to \"root_bdm\", and we\u0027re using the default \"validate_numa\u003dTrue\".","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf409a1baf0d72cdddf5fa434bfdb1d384021631","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                    raise exception.BootFromVolumeRequiredForZeroDiskFlavor()"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        try:"},{"line_number":612,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(image)"},{"line_number":613,"context_line":"        except ValueError as e:"},{"line_number":614,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":615,"context_line":"            # consider this an invalid request"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_ef145d43","line":612,"range":{"start_line":612,"start_character":12,"end_line":612,"end_character":59},"updated":"2019-02-26 16:00:21.000000000","message":"If you used instance.image_meta earlier you\u0027d have already hit this.","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4a34ad4edb66c800ca94199adef596359fdf083f","unresolved":false,"context_lines":[{"line_number":809,"context_line":"                block_device.properties_root_device_name("},{"line_number":810,"context_line":"                    boot_meta.get(\u0027properties\u0027, {})))"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        try:"},{"line_number":813,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(boot_meta)"},{"line_number":814,"context_line":"        except ValueError as e:"},{"line_number":815,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":816,"context_line":"            # consider this an invalid request"},{"line_number":817,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":818,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":819,"context_line":"        numa_topology \u003d hardware.numa_get_constraints("},{"line_number":820,"context_line":"                instance_type, image_meta)"},{"line_number":821,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_2069fdbc","line":818,"range":{"start_line":812,"start_character":8,"end_line":818,"end_character":47},"updated":"2019-02-27 15:06:32.000000000","message":"OK I see you copied this - can we pull this out into a private helper method, something like:\n\ndef _get_image_meta_obj(image_meta_dict)\n   ....","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":809,"context_line":"                block_device.properties_root_device_name("},{"line_number":810,"context_line":"                    boot_meta.get(\u0027properties\u0027, {})))"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"        try:"},{"line_number":813,"context_line":"            image_meta \u003d objects.ImageMeta.from_dict(boot_meta)"},{"line_number":814,"context_line":"        except ValueError as e:"},{"line_number":815,"context_line":"            # there must be invalid values in the image meta properties so"},{"line_number":816,"context_line":"            # consider this an invalid request"},{"line_number":817,"context_line":"            msg \u003d _(\u0027Invalid image metadata. Error: %s\u0027) % six.text_type(e)"},{"line_number":818,"context_line":"            raise exception.InvalidRequest(msg)"},{"line_number":819,"context_line":"        numa_topology \u003d hardware.numa_get_constraints("},{"line_number":820,"context_line":"                instance_type, image_meta)"},{"line_number":821,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_6094e536","line":818,"range":{"start_line":812,"start_character":8,"end_line":818,"end_character":47},"in_reply_to":"9fdfeff1_2069fdbc","updated":"2019-02-27 19:10:41.000000000","message":"Done","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf409a1baf0d72cdddf5fa434bfdb1d384021631","unresolved":false,"context_lines":[{"line_number":3566,"context_line":"                                         current_instance_type,"},{"line_number":3567,"context_line":"                                         new_instance_type)"},{"line_number":3568,"context_line":""},{"line_number":3569,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3570,"context_line":"        # We are not checking image status and root_bdm since image/volume are"},{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_c47b80bc","line":3569,"range":{"start_line":3569,"start_character":16,"end_line":3569,"end_character":78},"updated":"2019-02-26 16:00:21.000000000","message":"use instance.image_meta to get the same thing but in an ImageMeta object - note you\u0027d have to do image.status rather than image[\u0027status\u0027] because ImageMeta doesn\u0027t use the dict-compat mixin.","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"94e07f5ed5557bd2b33202aedc796af6313029e7","unresolved":false,"context_lines":[{"line_number":3566,"context_line":"                                         current_instance_type,"},{"line_number":3567,"context_line":"                                         new_instance_type)"},{"line_number":3568,"context_line":""},{"line_number":3569,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3570,"context_line":"        # We are not checking image status and root_bdm since image/volume are"},{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_3b0fec2e","line":3569,"range":{"start_line":3569,"start_character":16,"end_line":3569,"end_character":78},"in_reply_to":"9fdfeff1_c47b80bc","updated":"2019-02-27 15:31:30.000000000","message":"Nevermind this would break _validate_flavor_image which expects a dict.","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf409a1baf0d72cdddf5fa434bfdb1d384021631","unresolved":false,"context_lines":[{"line_number":3570,"context_line":"        # We are not checking image status and root_bdm since image/volume are"},{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_e426c4cb","line":3573,"range":{"start_line":3573,"start_character":45,"end_line":3573,"end_character":47},"updated":"2019-02-26 16:00:21.000000000","message":"why not pass image.id here?","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":3570,"context_line":"        # We are not checking image status and root_bdm since image/volume are"},{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_f7989869","line":3573,"range":{"start_line":3573,"start_character":45,"end_line":3573,"end_character":47},"in_reply_to":"9fdfeff1_e426c4cb","updated":"2019-02-27 19:10:41.000000000","message":"image id is not available when using utils.get_image_from_system_metadata().  Since we\u0027re not checking image status the image id isn\u0027t actually needed in _validate_flavor_image().","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf409a1baf0d72cdddf5fa434bfdb1d384021631","unresolved":false,"context_lines":[{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_042428c5","line":3574,"range":{"start_line":3574,"start_character":36,"end_line":3574,"end_character":40},"updated":"2019-02-26 16:00:21.000000000","message":"use a named kwarg so people don\u0027t have to look at the method signature to figure out what this is","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":3571,"context_line":"        # not changed during resize."},{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_a04bad84","line":3574,"range":{"start_line":3574,"start_character":36,"end_line":3574,"end_character":40},"in_reply_to":"9fdfeff1_042428c5","updated":"2019-02-27 19:10:41.000000000","message":"Done","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b8853fd0bbca1d3aaaab2a9e89cb08b594936c56","unresolved":false,"context_lines":[{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""},{"line_number":3578,"context_line":"        if not CONF.allow_resize_to_same_host:"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_16b44c35","line":3575,"updated":"2019-02-27 07:34:09.000000000","message":"We probably need unittest ensure resize calling this check.","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":3572,"context_line":"        image[\u0027status\u0027] \u003d \u0027active\u0027"},{"line_number":3573,"context_line":"        self._validate_flavor_image(context, \u0027\u0027, image, new_instance_type,"},{"line_number":3574,"context_line":"                                    None)"},{"line_number":3575,"context_line":""},{"line_number":3576,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3577,"context_line":""},{"line_number":3578,"context_line":"        if not CONF.allow_resize_to_same_host:"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_57c2c435","line":3575,"in_reply_to":"9fdfeff1_16b44c35","updated":"2019-02-27 19:10:41.000000000","message":"modified _test_resize() to add a check for this.","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":533,"context_line":"        # reason, we rely on the DB to cast True to a String."},{"line_number":534,"context_line":"        return True if bool_val else \u0027\u0027"},{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_49de653f","line":536,"range":{"start_line":536,"start_character":8,"end_line":536,"end_character":30},"updated":"2019-03-02 03:05:24.000000000","message":"Would be nice to take this opportunity to document the parameters here, specifically image because from just looking at this I can\u0027t tell if it\u0027s a dict or an ImageMeta object.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":533,"context_line":"        # reason, we rely on the DB to cast True to a String."},{"line_number":534,"context_line":"        return True if bool_val else \u0027\u0027"},{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cfc8fe22","line":536,"range":{"start_line":536,"start_character":8,"end_line":536,"end_character":30},"in_reply_to":"9fdfeff1_49de653f","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"},{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8963ed41","line":538,"updated":"2019-03-02 03:05:24.000000000","message":"Why did we need to split this out? If there were a docstring I wouldn\u0027t have to ask. I\u0027m assuming something about the resize case and maybe volume-backed servers? But that change in compute.utils points out that even for volume-backed servers the image status is faked to \u0027active\u0027.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0dc9590b2d942249b08efdbd1a89d4168fb4de45","unresolved":false,"context_lines":[{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"},{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_91c9b87a","line":538,"in_reply_to":"9fdfeff1_34523f6a","updated":"2019-03-04 17:58:18.000000000","message":"\u003e In the resize/move case the image doesn\u0027t change and so even if it\u0027s been deactivated that shouldn\u0027t block the operation.\n\nIf the image was deactivated wouldn\u0027t resize fail on the destination host if it needs to download the image because it\u0027s not in the image cache?","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"},{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_34523f6a","line":538,"in_reply_to":"9fdfeff1_8963ed41","updated":"2019-03-04 17:32:29.000000000","message":"In the create or rebuild cases we could be specifying a new image and so we need to check that it\u0027s active.  In the resize/move case the image doesn\u0027t change and so even if it\u0027s been deactivated that shouldn\u0027t block the operation.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":535,"context_line":""},{"line_number":536,"context_line":"    def _validate_flavor_image(self, context, image_id, image,"},{"line_number":537,"context_line":"                               instance_type, root_bdm, validate_numa\u003dTrue):"},{"line_number":538,"context_line":"        if image and image[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":539,"context_line":"            raise exception.ImageNotActive(image_id\u003dimage_id)"},{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_d415ee4a","line":538,"in_reply_to":"9fdfeff1_91c9b87a","updated":"2019-03-05 18:05:50.000000000","message":"Yeah, it would.  But sometimes it could work (if the image is cached or we\u0027re using raw), so we can\u0027t fail it due to the image being inactive (since that would result in a behaviour change).","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _validate_flavor_image_nostatus(self, context, image, instance_type,"},{"line_number":544,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":545,"context_line":"        if not image:"},{"line_number":546,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_69b809e8","line":543,"range":{"start_line":543,"start_character":8,"end_line":543,"end_character":39},"updated":"2019-03-02 03:05:24.000000000","message":"nit: this could be a staticmethod","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        self._validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _validate_flavor_image_nostatus(self, context, image, instance_type,"},{"line_number":544,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":545,"context_line":"        if not image:"},{"line_number":546,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_0f4926b6","line":543,"range":{"start_line":543,"start_character":8,"end_line":543,"end_character":39},"in_reply_to":"9fdfeff1_69b809e8","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _validate_flavor_image_nostatus(self, context, image, instance_type,"},{"line_number":544,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":545,"context_line":"        if not image:"},{"line_number":546,"context_line":"            return"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_29ae8181","line":544,"range":{"start_line":544,"start_character":50,"end_line":544,"end_character":63},"updated":"2019-03-02 03:05:24.000000000","message":"Documenting this in a docstring would be nice.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                                             root_bdm, validate_numa)"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _validate_flavor_image_nostatus(self, context, image, instance_type,"},{"line_number":544,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":545,"context_line":"        if not image:"},{"line_number":546,"context_line":"            return"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_afc33a06","line":544,"range":{"start_line":544,"start_character":50,"end_line":544,"end_character":63},"in_reply_to":"9fdfeff1_29ae8181","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":631,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":632,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":633,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":634,"context_line":"        if validate_numa:"},{"line_number":635,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":636,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_09c5bd3d","line":633,"range":{"start_line":633,"start_character":17,"end_line":633,"end_character":46},"updated":"2019-03-02 03:05:24.000000000","message":"Why don\u0027t we make this a public method?","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        hardware.get_number_of_serial_ports(instance_type, image_meta)"},{"line_number":631,"context_line":"        if hardware.is_realtime_enabled(instance_type):"},{"line_number":632,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":633,"context_line":"        hardware._get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":634,"context_line":"        if validate_numa:"},{"line_number":635,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":636,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8e3af7c1","line":633,"range":{"start_line":633,"start_character":17,"end_line":633,"end_character":46},"in_reply_to":"9fdfeff1_09c5bd3d","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":1207,"context_line":""},{"line_number":1208,"context_line":"        # We can\u0027t do this check earlier because we need bdms from all sources"},{"line_number":1209,"context_line":"        # to have been merged in order to get the root bdm."},{"line_number":1210,"context_line":"        # Set validate_numa\u003dFalse since numa validation is already done"},{"line_number":1211,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, boot_meta,"},{"line_number":1212,"context_line":"                instance_type, metadata, injected_files,"},{"line_number":1213,"context_line":"                block_device_mapping.root_bdm(), validate_numa\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_297f61e0","line":1210,"updated":"2019-03-02 03:05:24.000000000","message":"Let\u0027s be specific and say that it\u0027s done by _validate_and_build_base_options.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":1207,"context_line":""},{"line_number":1208,"context_line":"        # We can\u0027t do this check earlier because we need bdms from all sources"},{"line_number":1209,"context_line":"        # to have been merged in order to get the root bdm."},{"line_number":1210,"context_line":"        # Set validate_numa\u003dFalse since numa validation is already done"},{"line_number":1211,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, boot_meta,"},{"line_number":1212,"context_line":"                instance_type, metadata, injected_files,"},{"line_number":1213,"context_line":"                block_device_mapping.root_bdm(), validate_numa\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cf96bef0","line":1210,"in_reply_to":"9fdfeff1_297f61e0","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc4227729a4c3973c684f5b2cdce93d536ae6346","unresolved":false,"context_lines":[{"line_number":3569,"context_line":"                                         current_instance_type,"},{"line_number":3570,"context_line":"                                         new_instance_type)"},{"line_number":3571,"context_line":""},{"line_number":3572,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3573,"context_line":"        # Can skip root_bdm check since it will not change during resize."},{"line_number":3574,"context_line":"        self._validate_flavor_image_nostatus(context, image, new_instance_type,"},{"line_number":3575,"context_line":"                                    root_bdm\u003dNone)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_7b91aaf7","line":3572,"updated":"2019-03-02 14:11:00.000000000","message":"We don\u0027t need to do this validation if same_instance_type is True (cold migration so the flavor doesn\u0027t change).","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":3569,"context_line":"                                         current_instance_type,"},{"line_number":3570,"context_line":"                                         new_instance_type)"},{"line_number":3571,"context_line":""},{"line_number":3572,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3573,"context_line":"        # Can skip root_bdm check since it will not change during resize."},{"line_number":3574,"context_line":"        self._validate_flavor_image_nostatus(context, image, new_instance_type,"},{"line_number":3575,"context_line":"                                    root_bdm\u003dNone)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_2f850aaf","line":3572,"in_reply_to":"9fdfeff1_7b91aaf7","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":3571,"context_line":""},{"line_number":3572,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3573,"context_line":"        # Can skip root_bdm check since it will not change during resize."},{"line_number":3574,"context_line":"        self._validate_flavor_image_nostatus(context, image, new_instance_type,"},{"line_number":3575,"context_line":"                                    root_bdm\u003dNone)"},{"line_number":3576,"context_line":""},{"line_number":3577,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3578,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e9795930","line":3575,"range":{"start_line":3574,"start_character":45,"end_line":3575,"end_character":49},"updated":"2019-03-02 03:05:24.000000000","message":"nit: alignment is gross here","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":3571,"context_line":""},{"line_number":3572,"context_line":"        image \u003d utils.get_image_from_system_metadata(instance.system_metadata)"},{"line_number":3573,"context_line":"        # Can skip root_bdm check since it will not change during resize."},{"line_number":3574,"context_line":"        self._validate_flavor_image_nostatus(context, image, new_instance_type,"},{"line_number":3575,"context_line":"                                    root_bdm\u003dNone)"},{"line_number":3576,"context_line":""},{"line_number":3577,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3578,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8fb9967a","line":3575,"range":{"start_line":3574,"start_character":45,"end_line":3575,"end_character":49},"in_reply_to":"9fdfeff1_e9795930","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        :param context: A context.RequestContext"},{"line_number":545,"context_line":"        :param image_id: UUID of the image"},{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_857ad222","line":546,"range":{"start_line":546,"start_character":22,"end_line":546,"end_character":77},"updated":"2019-03-04 21:30:46.000000000","message":"nit: you could add, \"; enforces the image status is \u0027active\u0027\"","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":"        :param context: A context.RequestContext"},{"line_number":545,"context_line":"        :param image_id: UUID of the image"},{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_baa83ad9","line":546,"range":{"start_line":546,"start_character":22,"end_line":546,"end_character":77},"in_reply_to":"9fdfeff1_857ad222","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":544,"context_line":"        :param context: A context.RequestContext"},{"line_number":545,"context_line":"        :param image_id: UUID of the image"},{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_65c32e59","line":547,"range":{"start_line":547,"start_character":44,"end_line":547,"end_character":72},"updated":"2019-03-04 21:30:46.000000000","message":"Don\u0027t need or want this really, see:\n\nhttps://github.com/openstack/nova/blob/c7db20d140eb0d3ccf0fd107eda7e80275bdd7d4/nova/objects/flavor.py#L194\n\nThat\u0027s a bigger change but I would remove this part of the docstring.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":544,"context_line":"        :param context: A context.RequestContext"},{"line_number":545,"context_line":"        :param image_id: UUID of the image"},{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_5ab58e31","line":547,"range":{"start_line":547,"start_character":44,"end_line":547,"end_character":72},"in_reply_to":"9fdfeff1_65c32e59","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"},{"line_number":551,"context_line":"               the NUMA-related metadata.  In the instance creation code path"},{"line_number":552,"context_line":"               this is handled separately and so we can skip it here."}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_85917256","line":549,"range":{"start_line":549,"start_character":38,"end_line":549,"end_character":42},"updated":"2019-03-04 21:30:46.000000000","message":"The root disk could change on a resize, do you mean does not change for a volume-backed server? I guess this is coupled with the actual check for VolumeSmallerThanMinDisk which for resize isn\u0027t an issue because the *image* doesn\u0027t change for resize. Anyway, this is confusingly worded but I\u0027m not sure what to use instead.\n\nThis does, however, leak details about what is validated and in the case of resize you *could* pass the root_bdm and it shouldn\u0027t be a problem because the image doesn\u0027t change and therefore if you passed create/rebuild it should be OK for resize. So that begs the question, do we actually need this root_bdm parameter to be optional? I guess so because otherwise we have to lookup the root bdm for no great reason in resize just to pass it here...","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties"},{"line_number":547,"context_line":"        :param instance_type: Flavor object (generally accessed as dict)"},{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"},{"line_number":551,"context_line":"               the NUMA-related metadata.  In the instance creation code path"},{"line_number":552,"context_line":"               this is handled separately and so we can skip it here."}],"source_content_type":"text/x-python","patch_set":31,"id":"7fc4fb27_ce3a63cc","line":549,"range":{"start_line":549,"start_character":38,"end_line":549,"end_character":42},"in_reply_to":"9fdfeff1_85917256","updated":"2019-03-05 18:05:50.000000000","message":"The wording would get really verbose to fully explain, I just trimmed it back.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"},{"line_number":551,"context_line":"               the NUMA-related metadata.  In the instance creation code path"},{"line_number":552,"context_line":"               this is handled separately and so we can skip it here."},{"line_number":553,"context_line":"        :raises: Many different possible exceptions.  See"},{"line_number":554,"context_line":"                 api.openstack.compute.servers.INVALID_FLAVOR_IMAGE_EXCEPTIONS"},{"line_number":555,"context_line":"                 for the full list."}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_258c4634","line":552,"range":{"start_line":551,"start_character":43,"end_line":552,"end_character":69},"updated":"2019-03-04 21:30:46.000000000","message":"Let\u0027s not tightly couple how this is used to what uses it, so remove this part.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":549,"context_line":"               the resize case as the disk does not change."},{"line_number":550,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"},{"line_number":551,"context_line":"               the NUMA-related metadata.  In the instance creation code path"},{"line_number":552,"context_line":"               this is handled separately and so we can skip it here."},{"line_number":553,"context_line":"        :raises: Many different possible exceptions.  See"},{"line_number":554,"context_line":"                 api.openstack.compute.servers.INVALID_FLAVOR_IMAGE_EXCEPTIONS"},{"line_number":555,"context_line":"                 for the full list."}],"source_content_type":"text/x-python","patch_set":31,"id":"7fc4fb27_4e4c3376","line":552,"range":{"start_line":551,"start_character":43,"end_line":552,"end_character":69},"in_reply_to":"9fdfeff1_258c4634","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6af0abe5182b545e3ab04925c8abacb1a27a9919","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_3953063c","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"updated":"2019-03-05 08:16:18.000000000","message":"so....for the Boot from volume case, we may get None value for the image, that will skip the flavor extra spec validation?\n\nAlso like we don\u0027t have unittest ensure this is called.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":31,"id":"7fc4fb27_ae46f74e","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"in_reply_to":"9fdfeff1_0c86fd14","updated":"2019-03-05 18:05:50.000000000","message":"I didn\u0027t want to change the logic while also moving code around.  Followup would be preferred.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9914e7257b48740d4b38ae6269bf1c4acfa1d884","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_8c4e6d36","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"in_reply_to":"9fdfeff1_3953063c","updated":"2019-03-05 12:49:12.000000000","message":"No I don\u0027t think that\u0027s the case, I\u0027m not actually sure why this conditional is here but it\u0027s latent. When we boot from volume, we store the volume_image_metadata from the volume into the instance image_* system_metadata and then for an operation like resize we pass that image system_metadata to this method and get it using:\n\nutils.get_image_from_system_metadata(\n                instance.system_metadata)\n\nSo I think we\u0027ll still run through this to validate the new flavor against the existing image in the case of a resize.\n\nSimilarly for rebuild we\u0027ll validate the new image against the existing flavor.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c569fbe02754af0ba4e22217c332f2eb3e24493c","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_0c86fd14","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"in_reply_to":"9fdfeff1_8c4e6d36","updated":"2019-03-05 12:57:06.000000000","message":"Looking over the code that calls this method this should never be None or {} so I think we could remove this - but probably do it in a follow up.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c7a51090bfe624ee4da6963bd39a0c9b1177550c","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_cc77953b","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"in_reply_to":"9fdfeff1_8c4e6d36","updated":"2019-03-05 13:08:24.000000000","message":"yes, I\u0027m wrong. That isn\u0027t the case.  resize will get metadata from volume. Rebuild always require image. I also didn\u0027t found why we need this.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":3593,"context_line":"        if not same_instance_type:"},{"line_number":3594,"context_line":"            image \u003d utils.get_image_from_system_metadata("},{"line_number":3595,"context_line":"                instance.system_metadata)"},{"line_number":3596,"context_line":"            # Can skip root_bdm check since it will not change during resize."},{"line_number":3597,"context_line":"            self._validate_flavor_image_nostatus("},{"line_number":3598,"context_line":"                context, image, new_instance_type, root_bdm\u003dNone)"},{"line_number":3599,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_45f06a92","line":3596,"updated":"2019-03-04 21:30:46.000000000","message":"What about calling get_pci_requests_from_flavor here to validate the new flavor as mentioned:\n\nhttps://review.openstack.org/#/c/620706/27/nova/api/openstack/compute/servers.py@a857","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":3593,"context_line":"        if not same_instance_type:"},{"line_number":3594,"context_line":"            image \u003d utils.get_image_from_system_metadata("},{"line_number":3595,"context_line":"                instance.system_metadata)"},{"line_number":3596,"context_line":"            # Can skip root_bdm check since it will not change during resize."},{"line_number":3597,"context_line":"            self._validate_flavor_image_nostatus("},{"line_number":3598,"context_line":"                context, image, new_instance_type, root_bdm\u003dNone)"},{"line_number":3599,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5fc1f717_4dfe7906","line":3596,"in_reply_to":"9fdfeff1_45f06a92","updated":"2019-03-05 18:05:50.000000000","message":"Adding in follow-on patch.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b6cf43feee10b405e1596050fdd3f4e7418a9045","unresolved":false,"context_lines":[{"line_number":546,"context_line":"        :param image: a dict representation of the image including properties,"},{"line_number":547,"context_line":"                      enforces the image status is active."},{"line_number":548,"context_line":"        :param instance_type: Flavor object"},{"line_number":549,"context_line":"        :param root_bdm: BlockDeviceMapping for root disk.  Will be None for"},{"line_number":550,"context_line":"               the resize case."},{"line_number":551,"context_line":"        :param validate_numa: Flag to indicate whether or not to validate"},{"line_number":552,"context_line":"               the NUMA-related metadata."},{"line_number":553,"context_line":"        :raises: Many different possible exceptions.  See"}],"source_content_type":"text/x-python","patch_set":32,"id":"5fc1f717_f33aa832","line":550,"range":{"start_line":549,"start_character":60,"end_line":550,"end_character":31},"updated":"2019-03-05 19:06:36.000000000","message":"nit: we should just remove this (let\u0027s not encode who calls this and why) and make root_bdm\u003dNone. Could be done in a follow up.","commit_id":"5e7b840e48eb480ba1955e6ba52fbcaf9884c3fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b6cf43feee10b405e1596050fdd3f4e7418a9045","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    @staticmethod"},{"line_number":563,"context_line":"    def _validate_flavor_image_nostatus(context, image, instance_type,"},{"line_number":564,"context_line":"                                        root_bdm, validate_numa\u003dTrue):"},{"line_number":565,"context_line":"        if not image:"},{"line_number":566,"context_line":"            return"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        image_properties \u003d image.get(\u0027properties\u0027, {})"},{"line_number":569,"context_line":"        config_drive_option \u003d image_properties.get("}],"source_content_type":"text/x-python","patch_set":32,"id":"5fc1f717_b34420b9","line":566,"range":{"start_line":565,"start_character":8,"end_line":566,"end_character":18},"updated":"2019-03-05 19:06:36.000000000","message":"I think we can remove this in a follow up as well.","commit_id":"5e7b840e48eb480ba1955e6ba52fbcaf9884c3fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b6cf43feee10b405e1596050fdd3f4e7418a9045","unresolved":false,"context_lines":[{"line_number":3593,"context_line":"        if not same_instance_type:"},{"line_number":3594,"context_line":"            image \u003d utils.get_image_from_system_metadata("},{"line_number":3595,"context_line":"                instance.system_metadata)"},{"line_number":3596,"context_line":"            # Can skip root_bdm check since it will not change during resize."},{"line_number":3597,"context_line":"            self._validate_flavor_image_nostatus("},{"line_number":3598,"context_line":"                context, image, new_instance_type, root_bdm\u003dNone)"},{"line_number":3599,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5fc1f717_932004fa","line":3596,"updated":"2019-03-05 19:06:36.000000000","message":"Still don\u0027t see a patch that calls get_pci_requests_from_flavor in here, I guess you\u0027re working on that yet.","commit_id":"5e7b840e48eb480ba1955e6ba52fbcaf9884c3fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"100d464f143733020c711fb312b9072f38fb07ba","unresolved":false,"context_lines":[{"line_number":3595,"context_line":"                instance.system_metadata)"},{"line_number":3596,"context_line":"            # Can skip root_bdm check since it will not change during resize."},{"line_number":3597,"context_line":"            self._validate_flavor_image_nostatus("},{"line_number":3598,"context_line":"                context, image, new_instance_type, root_bdm\u003dNone)"},{"line_number":3599,"context_line":""},{"line_number":3600,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3601,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3fce034c_e8ea4caa","line":3598,"range":{"start_line":3598,"start_character":51,"end_line":3598,"end_character":64},"updated":"2019-04-17 00:30:43.000000000","message":"This regressed volume-backed resize where the flavor disk is smaller than the current instance root_gb, see bug 1825020.","commit_id":"5e7b840e48eb480ba1955e6ba52fbcaf9884c3fa"}],"nova/tests/unit/api/openstack/compute/test_server_actions.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e4a56f42135dcb78b1fd2062eeb00e695a2d9159","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                \u00272\u0027: {\u0027id\u0027: uuids.image_id, \u0027status\u0027: \u0027active\u0027,"},{"line_number":549,"context_line":"                      \u0027container_format\u0027: \u0027ari\u0027},"},{"line_number":550,"context_line":"                \u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027:"},{"line_number":551,"context_line":"                     {\u0027id\u0027: uuids.image_id, \u0027status\u0027: \u0027active\u0027,"},{"line_number":552,"context_line":"                      \u0027container_format\u0027: \u0027raw\u0027,"},{"line_number":553,"context_line":"                      \u0027properties\u0027: {\u0027kernel_id\u0027: 1, \u0027ramdisk_id\u0027: 2}},"},{"line_number":554,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_454ee5c1","line":551,"range":{"start_line":551,"start_character":28,"end_line":551,"end_character":42},"updated":"2019-02-22 21:08:50.000000000","message":"is it weird that this is the same for both entries?","commit_id":"d8f6882f547bd1a92fb38de5aed287d56bf8b233"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":1940,"context_line":"    def _test_resize(self, mock_get_all_by_host,"},{"line_number":1941,"context_line":"                     mock_get_by_instance_uuid, mock_get_flavor, mock_upsize,"},{"line_number":1942,"context_line":"                     mock_inst_save, mock_count, mock_limit, mock_record,"},{"line_number":1943,"context_line":"                     mock_migration, mock_validate,"},{"line_number":1944,"context_line":"                     flavor_id_passed\u003dTrue,"},{"line_number":1945,"context_line":"                     same_host\u003dFalse, allow_same_host\u003dFalse,"},{"line_number":1946,"context_line":"                     project_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_25df660d","line":1943,"range":{"start_line":1943,"start_character":37,"end_line":1943,"end_character":50},"updated":"2019-03-04 21:30:46.000000000","message":"We should assert this is *not* called for cold migrate.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":1940,"context_line":"    def _test_resize(self, mock_get_all_by_host,"},{"line_number":1941,"context_line":"                     mock_get_by_instance_uuid, mock_get_flavor, mock_upsize,"},{"line_number":1942,"context_line":"                     mock_inst_save, mock_count, mock_limit, mock_record,"},{"line_number":1943,"context_line":"                     mock_migration, mock_validate,"},{"line_number":1944,"context_line":"                     flavor_id_passed\u003dTrue,"},{"line_number":1945,"context_line":"                     same_host\u003dFalse, allow_same_host\u003dFalse,"},{"line_number":1946,"context_line":"                     project_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":31,"id":"5fc1f717_6dbc95bb","line":1943,"range":{"start_line":1943,"start_character":37,"end_line":1943,"end_character":50},"in_reply_to":"9fdfeff1_25df660d","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"}],"nova/tests/unit/virt/test_hardware.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b8853fd0bbca1d3aaaab2a9e89cb08b594936c56","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"                                         extra_specs\u003d{"},{"line_number":1277,"context_line":"                    \"hw:cpu_policy\": \"foo\","},{"line_number":1278,"context_line":"                }),"},{"line_number":1279,"context_line":"                \"image\": {"},{"line_number":1280,"context_line":"                    \"properties\": {}"},{"line_number":1281,"context_line":"                },"},{"line_number":1282,"context_line":"                \"expect\": exception.InvalidCPUAllocationPolicy,"},{"line_number":1283,"context_line":"            },"},{"line_number":1284,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_1303fe11","line":1281,"range":{"start_line":1279,"start_character":16,"end_line":1281,"end_character":18},"updated":"2019-02-27 07:34:09.000000000","message":"we also need test case for image properties?","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"597a4ab5804a11eea0712128c249e720e482114d","unresolved":false,"context_lines":[{"line_number":1276,"context_line":"                                         extra_specs\u003d{"},{"line_number":1277,"context_line":"                    \"hw:cpu_policy\": \"foo\","},{"line_number":1278,"context_line":"                }),"},{"line_number":1279,"context_line":"                \"image\": {"},{"line_number":1280,"context_line":"                    \"properties\": {}"},{"line_number":1281,"context_line":"                },"},{"line_number":1282,"context_line":"                \"expect\": exception.InvalidCPUAllocationPolicy,"},{"line_number":1283,"context_line":"            },"},{"line_number":1284,"context_line":"            {"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_80dea467","line":1281,"range":{"start_line":1279,"start_character":16,"end_line":1281,"end_character":18},"in_reply_to":"9fdfeff1_1303fe11","updated":"2019-02-27 19:10:41.000000000","message":"Done","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b8853fd0bbca1d3aaaab2a9e89cb08b594936c56","unresolved":false,"context_lines":[{"line_number":1288,"context_line":"                    \"hw:cpu_policy\": fields.CPUAllocationPolicy.DEDICATED,"},{"line_number":1289,"context_line":"                    \"hw:cpu_thread_policy\": \"foo\","},{"line_number":1290,"context_line":"                }),"},{"line_number":1291,"context_line":"                \"image\": {"},{"line_number":1292,"context_line":"                    \"properties\": {}"},{"line_number":1293,"context_line":"                },"},{"line_number":1294,"context_line":"                \"expect\": exception.InvalidCPUThreadAllocationPolicy,"},{"line_number":1295,"context_line":"            },"},{"line_number":1296,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_33008202","line":1293,"range":{"start_line":1291,"start_character":16,"end_line":1293,"end_character":18},"updated":"2019-02-27 07:34:09.000000000","message":"ditto","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"}],"nova/virt/hardware.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"fbf10eadff2980a0701769a4cc7e874bd2313f2e","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"    flavor_policy, image_policy \u003d _get_flavor_image_meta("},{"line_number":1288,"context_line":"        \u0027cpu_policy\u0027, flavor, image_meta)"},{"line_number":1289,"context_line":""},{"line_number":1290,"context_line":"    if flavor_policy and (flavor_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1291,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1292,"context_line":"            requested\u003dflavor_policy,"},{"line_number":1293,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"    if image_policy and (image_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1296,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1297,"context_line":"            requested\u003dimage_policy,"},{"line_number":1298,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"},{"line_number":1299,"context_line":""},{"line_number":1300,"context_line":"    if flavor_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1301,"context_line":"        cpu_policy \u003d flavor_policy"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_fd49fe5f","line":1298,"range":{"start_line":1290,"start_character":0,"end_line":1298,"end_character":58},"updated":"2019-01-11 20:04:06.000000000","message":"nit: I kind of feel like it\u0027d be nicer to specify whether it was the image or the flavor (or both) specifying bad policies.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"fc957294012961f75a59cb4b3351341cc72218f7","unresolved":false,"context_lines":[{"line_number":1287,"context_line":"    flavor_policy, image_policy \u003d _get_flavor_image_meta("},{"line_number":1288,"context_line":"        \u0027cpu_policy\u0027, flavor, image_meta)"},{"line_number":1289,"context_line":""},{"line_number":1290,"context_line":"    if flavor_policy and (flavor_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1291,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1292,"context_line":"            requested\u003dflavor_policy,"},{"line_number":1293,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"    if image_policy and (image_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1296,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1297,"context_line":"            requested\u003dimage_policy,"},{"line_number":1298,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"},{"line_number":1299,"context_line":""},{"line_number":1300,"context_line":"    if flavor_policy \u003d\u003d fields.CPUAllocationPolicy.DEDICATED:"},{"line_number":1301,"context_line":"        cpu_policy \u003d flavor_policy"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_ead592ba","line":1298,"range":{"start_line":1290,"start_character":0,"end_line":1298,"end_character":58},"in_reply_to":"bfdaf3ff_fd49fe5f","updated":"2019-01-14 21:42:48.000000000","message":"Added \u0027source\u0027 om exception to be either \u0027flavor extra specs\u0027 or \u0027image properties\u0027. Not checking for all scenarios (e.g. both invalid) since code would be too complicated.","commit_id":"b19c2b7ccacfe3c464d1512049b0d2bc64b81350"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d75b56599b6b53852b88eb9c2aa09df29a12b419","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        flavor_max_threads \u003d int(flavor_max_threads)"},{"line_number":311,"context_line":"    except ValueError as e:"},{"line_number":312,"context_line":"        msg \u003d _(\u0027Invalid flavor extra spec. Error: %s\u0027) % six.text_type(e)"},{"line_number":313,"context_line":"        raise exception.InvalidRequest(msg)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    LOG.debug(\"Flavor limits %(sockets)d:%(cores)d:%(threads)d\","},{"line_number":316,"context_line":"              {\"sockets\": flavor_max_sockets,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_b755ba52","line":313,"range":{"start_line":313,"start_character":8,"end_line":313,"end_character":43},"updated":"2019-01-22 19:39:18.000000000","message":"does the change to InvalidRequest get unit-tested anywhere?","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"9b2809a6cf118cf8270320aa21fad824037ecec6","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        flavor_max_threads \u003d int(flavor_max_threads)"},{"line_number":311,"context_line":"    except ValueError as e:"},{"line_number":312,"context_line":"        msg \u003d _(\u0027Invalid flavor extra spec. Error: %s\u0027) % six.text_type(e)"},{"line_number":313,"context_line":"        raise exception.InvalidRequest(msg)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    LOG.debug(\"Flavor limits %(sockets)d:%(cores)d:%(threads)d\","},{"line_number":316,"context_line":"              {\"sockets\": flavor_max_sockets,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_e64aa353","line":313,"range":{"start_line":313,"start_character":8,"end_line":313,"end_character":43},"in_reply_to":"9fdfeff1_b755ba52","updated":"2019-01-23 17:21:20.000000000","message":"\u003e does the change to InvalidRequest get unit-tested anywhere?\n\nadded new test test_hardware.VCPUTopologyTest.test_invalid_flavor_values","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"d75b56599b6b53852b88eb9c2aa09df29a12b419","unresolved":false,"context_lines":[{"line_number":1302,"context_line":"        \u0027cpu_policy\u0027, flavor, image_meta)"},{"line_number":1303,"context_line":""},{"line_number":1304,"context_line":"    if flavor_policy and (flavor_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1305,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1306,"context_line":"            source\u003d\u0027flavor extra specs\u0027,"},{"line_number":1307,"context_line":"            requested\u003dflavor_policy,"},{"line_number":1308,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_d752be67","line":1305,"range":{"start_line":1305,"start_character":14,"end_line":1305,"end_character":50},"updated":"2019-01-22 19:39:18.000000000","message":"do these exceptions get unit-tested anywhere?","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":28433,"name":"Jack Ding","email":"jackding@gmail.com","username":"jackding"},"change_message_id":"9b2809a6cf118cf8270320aa21fad824037ecec6","unresolved":false,"context_lines":[{"line_number":1302,"context_line":"        \u0027cpu_policy\u0027, flavor, image_meta)"},{"line_number":1303,"context_line":""},{"line_number":1304,"context_line":"    if flavor_policy and (flavor_policy not in fields.CPUAllocationPolicy.ALL):"},{"line_number":1305,"context_line":"        raise exception.InvalidCPUAllocationPolicy("},{"line_number":1306,"context_line":"            source\u003d\u0027flavor extra specs\u0027,"},{"line_number":1307,"context_line":"            requested\u003dflavor_policy,"},{"line_number":1308,"context_line":"            available\u003dstr(fields.CPUAllocationPolicy.ALL))"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_863e37d8","line":1305,"range":{"start_line":1305,"start_character":14,"end_line":1305,"end_character":50},"in_reply_to":"9fdfeff1_d752be67","updated":"2019-01-23 17:21:20.000000000","message":"test added","commit_id":"fb10f7ed0cd1566da3e068490300b1ebd053af8f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf409a1baf0d72cdddf5fa434bfdb1d384021631","unresolved":false,"context_lines":[{"line_number":187,"context_line":"    :param flavor: Flavor object to read extra specs from"},{"line_number":188,"context_line":"    :param image_meta: nova.objects.ImageMeta object instance"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    :raises: exception.ImageSerialPortNumberInvalid if the serial port count"},{"line_number":191,"context_line":"             is not a valid integer"},{"line_number":192,"context_line":"    :raises: exception.ImageSerialPortNumberExceedFlavorValue if the serial"},{"line_number":193,"context_line":"             port count defined in image is greater than that of flavor"}],"source_content_type":"text/x-python","patch_set":25,"id":"9fdfeff1_cf5e3912","line":190,"updated":"2019-02-26 16:00:21.000000000","message":"general note that splitting the hardware.py changes out to a subsequent patch would have reduced the cognitive load on reviewing this change...","commit_id":"df723adab02d84229b17cd57ae3b24704b1a69f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":1569,"context_line":"        for c in numa_topology.cells:"},{"line_number":1570,"context_line":"            setattr(c, \u0027pagesize\u0027, pagesize)"},{"line_number":1571,"context_line":""},{"line_number":1572,"context_line":"    cpu_policy \u003d _get_cpu_policy_constraint(flavor, image_meta)"},{"line_number":1573,"context_line":"    cpu_thread_policy \u003d _get_cpu_thread_policy_constraint(flavor, image_meta)"},{"line_number":1574,"context_line":"    rt_mask \u003d _get_realtime_constraint(flavor, image_meta)"},{"line_number":1575,"context_line":"    emu_threads_policy \u003d get_emulator_thread_policy_constraint(flavor)"},{"line_number":1576,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e9515965","line":1573,"range":{"start_line":1572,"start_character":4,"end_line":1573,"end_character":77},"updated":"2019-03-02 03:05:24.000000000","message":"Both of these methods raise a new exception which is not documented in the nice list of exceptions that *this* method raises.","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"46fd70cfdc5f8e91d5c4138ae89cbcca9aad05e8","unresolved":false,"context_lines":[{"line_number":1569,"context_line":"        for c in numa_topology.cells:"},{"line_number":1570,"context_line":"            setattr(c, \u0027pagesize\u0027, pagesize)"},{"line_number":1571,"context_line":""},{"line_number":1572,"context_line":"    cpu_policy \u003d _get_cpu_policy_constraint(flavor, image_meta)"},{"line_number":1573,"context_line":"    cpu_thread_policy \u003d _get_cpu_thread_policy_constraint(flavor, image_meta)"},{"line_number":1574,"context_line":"    rt_mask \u003d _get_realtime_constraint(flavor, image_meta)"},{"line_number":1575,"context_line":"    emu_threads_policy \u003d get_emulator_thread_policy_constraint(flavor)"},{"line_number":1576,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_abd9ed56","line":1573,"range":{"start_line":1572,"start_character":4,"end_line":1573,"end_character":77},"in_reply_to":"9fdfeff1_e9515965","updated":"2019-03-04 17:32:29.000000000","message":"Done","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"}],"releasenotes/notes/flavor-extra-spec-image-property-validation-7310954ba3822477.yaml":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":2,"context_line":"upgrade:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    With added validations for flavor extra-specs and image properties, Server"},{"line_number":5,"context_line":"    API for server create, resize and rebuild could return 400 exceptions for"},{"line_number":6,"context_line":"    additional reasons."},{"line_number":7,"context_line":"    See `change`_ for `blueprint flavor-extra-spec-image-property-validation`_"},{"line_number":8,"context_line":"    for details."},{"line_number":9,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":27,"id":"9fdfeff1_c94815b5","line":6,"range":{"start_line":5,"start_character":74,"end_line":6,"end_character":23},"updated":"2019-03-02 03:05:24.000000000","message":"This is nebulous - you don\u0027t have to iterate every new exception that can be raised and handled in that big 400 list, but at least point out the new things that get validated in the API (like in the commit message).","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    With added validations for flavor extra-specs and image properties, Server"},{"line_number":5,"context_line":"    API for server create, resize and rebuild could return 400 exceptions for"},{"line_number":6,"context_line":"    additional reasons."},{"line_number":7,"context_line":"    See `change`_ for `blueprint flavor-extra-spec-image-property-validation`_"},{"line_number":8,"context_line":"    for details."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    .. _change: https://review.openstack.org/#/q/I06fad233006c7bab14749a51ffa226c3801f951b"}],"source_content_type":"text/x-yaml","patch_set":27,"id":"9fdfeff1_29cd2130","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":18},"updated":"2019-03-02 03:05:24.000000000","message":"If you do a bit more in the description above then you can just remove this, as an operator I wouldn\u0027t want to have to review the change to grok it (or a user for that matter).\n\nMaybe point out, somewhere in here, that the benefit of this is incompatible flavor/image combinations will be caught early in the API with a clear error response to the user rather than failing later in the compute service where a fault has to be retrieved and/or logs have to be read.\n\nI would probably also point out that while this is not an exhaustive image/flavor combination validation, it applies to the features pointed out in the commit message (which you should list here).","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1d34057c8b2728a93f668f7a7b08120dfec770d1","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    for details."},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    .. _change: https://review.openstack.org/#/q/I06fad233006c7bab14749a51ffa226c3801f951b"},{"line_number":11,"context_line":"    .. _blueprint flavor-extra-spec-image-property-validation: https://blueprints.launchpad.net/nova/+spec/flavor-extra-spec-image-property-validation"}],"source_content_type":"text/x-yaml","patch_set":27,"id":"9fdfeff1_e9ff1933","line":11,"updated":"2019-03-02 03:05:24.000000000","message":"Don\u0027t link to the blueprint, link to the spec:\n\nhttps://specs.openstack.org/openstack/nova-specs/specs/stein/approved/flavor-extra-spec-image-property-validation.html","commit_id":"64d1984c85c040fcb62f803986f929ce80564aeb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    With added validations for flavor extra-specs and image properties, the"},{"line_number":5,"context_line":"    APIs for server create, resize and rebuild will now return 400 exceptions"},{"line_number":6,"context_line":"    where it didn\u0027t before due to the extra-specs or properties not being"},{"line_number":7,"context_line":"    properly formatted or being mutually incompatible."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    For all three actions we will now check both the flavor and image to"}],"source_content_type":"text/x-yaml","patch_set":31,"id":"9fdfeff1_85241210","line":6,"range":{"start_line":6,"start_character":10,"end_line":6,"end_character":19},"updated":"2019-03-04 21:30:46.000000000","message":"they did not","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    With added validations for flavor extra-specs and image properties, the"},{"line_number":5,"context_line":"    APIs for server create, resize and rebuild will now return 400 exceptions"},{"line_number":6,"context_line":"    where it didn\u0027t before due to the extra-specs or properties not being"},{"line_number":7,"context_line":"    properly formatted or being mutually incompatible."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"    For all three actions we will now check both the flavor and image to"}],"source_content_type":"text/x-yaml","patch_set":31,"id":"5fc1f717_adc11d31","line":6,"range":{"start_line":6,"start_character":10,"end_line":6,"end_character":19},"in_reply_to":"9fdfeff1_85241210","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d4ea3c5a2c2847cb1dd9d3482591cfe8f800c86e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"    fail later on much further down the stack where the operator would have"},{"line_number":17,"context_line":"    to get involved."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    .. _spec flavor-extra-spec-image-property-validation: https://specs.openstack.org/openstack/nova-specs/specs/stein/approved/flavor-extra-spec-image-property-validation.html"}],"source_content_type":"text/x-yaml","patch_set":31,"id":"9fdfeff1_e584fed5","line":19,"updated":"2019-03-04 21:30:46.000000000","message":"This is no longer used.","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0209c256f5882bca4031c84e37e09f79123a646d","unresolved":false,"context_lines":[{"line_number":16,"context_line":"    fail later on much further down the stack where the operator would have"},{"line_number":17,"context_line":"    to get involved."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    .. _spec flavor-extra-spec-image-property-validation: https://specs.openstack.org/openstack/nova-specs/specs/stein/approved/flavor-extra-spec-image-property-validation.html"}],"source_content_type":"text/x-yaml","patch_set":31,"id":"5fc1f717_4ddc3918","line":19,"in_reply_to":"9fdfeff1_e584fed5","updated":"2019-03-05 18:05:50.000000000","message":"Done","commit_id":"a1502ee01468630f53bfc16cba06a323c803489e"}]}
