[nova] Proper way to regenerate request_specs of existing instances?

Sylvain Bauza sbauza at redhat.com
Tue Jun 1 12:34:50 UTC 2021


On Tue, Jun 1, 2021 at 2:17 PM Patryk Jakuszew <patryk.jakuszew at gmail.com>
wrote:

> Hi!
>
> I have a Rocky deployment and I want to enable
> AggregateInstanceExtraSpecsFilter on it. There is one slight problem I'm
> trying to solve in a proper way: fixing the request_specs of instances that
> are already running.
>
> After enabling the filter, I want to add necessary metadata keys to
> flavors, but this won't be propagated into request_specs of running
> instances, and this will cause issues later on (like scheduler selecting
> wrong destination hosts for migration, for example)
>
> Few years ago I encountered a similar problem on Mitaka: that deployment
> already had the filter enabled, but some flavors were misconfigured and
> lacked the metadata keys. I ended up writing a crude Python script which
> connected directly into the Nova database, searched for bad request_specs
> and manually appended the necessary extra_specs keys into request_specs
> JSON blob.
>
> Now, my question is: has anyone encountered a similar scenario before? Is
> there a more clean method for regeneration of instance request_specs, or do
> I have to modify the JSON blobs manually by writing directly into the
> database?
>
>
As Nova looks at the RequestSpec records for knowing what the user was
asking when creating the instance, and as the instance values can be
modified when for example you move an instance, that's why we don't support
to modify the RequestSpec directly.

In general, this question is about AZs : as in general some operators want
to modify the AZ value of a specific RequestSpec, this would also mean that
the users using the related instance would not understand why now this
instance would be on another AZ if the host is within another one.

As you said, if you really want to modify the RequestSpec object, please
then write a Python script that would use the objects class by getting the
RequestSpec object directly and then persisting it again.

-Sylvain


--
> Regards,
> Patryk Jakuszew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20210601/3c2da199/attachment.html>


More information about the openstack-discuss mailing list