Repository navigation
Closed as not planned
Labels
IaaSIssues or pull requests relevant for Team1: IaaSSCS is standardizedSCS is standardizedSprint DublinSprint Dublin (2023, cwk 22+23)Sprint EdmontonSprint Edmonton (2023, cwk 24+25)enhancementNew feature or requeststandardsIssues / ADR / pull requests relevant for standardization & certification
Milestone
Description
edit for the current proposal, jump to this comment
When flavor names need to change, this will cause pain for customers and operators.
- If we just rename the flavors (in the database, nova-api does not expose this), running instances and code using flavor UUIDs will be fine; however IaC code that uses the old names will fail. This may include reconciliation loops (e.g. in cluster-api), causing significant pain.
- Creating a duplicate set of flavors (one with old and one with new name) does create some UI challenges and postpones the issue to the point in time when the duplicates will be switched off ... The problem at that point in time is worse, as we'll likely have things referencing flavors that we then want to delete. Advanced database magic, which is risky.
We have this problem, as issue #190 reported that k8s based solutions create labels using the IaaS flavor names and ":" is not allowed in k8s labels. Following the reasoning in #192, a proposal exists as PR #226, where we introduce a 1:1 relationship between old and new names. The strategy to ease the transition pain however is not addressed yet.
This issue is supposed to discuss ideas how to smooth the transition for operators and their customers.
Metadata
Metadata
Assignees
Labels
IaaSIssues or pull requests relevant for Team1: IaaSSCS is standardizedSCS is standardizedSprint DublinSprint Dublin (2023, cwk 22+23)Sprint EdmontonSprint Edmonton (2023, cwk 24+25)enhancementNew feature or requeststandardsIssues / ADR / pull requests relevant for standardization & certification
Type
Projects
- StatusShow more project fieldsDone
Activity
garloff commentedon Feb 18, 2023
One possibility would be to add the unfortunately missing flavor alias support to nova.
When users request old names, they would silently get the flavors with the new names instead, introducing a flavor_by_name matching that also hits the alias names.
The attached PoC works nicely with the openstackclient tools.
Testing with other tools (capo, occm, terraform) still has to be done.
scs-flavor-by-alias.diff
garloff commentedon Feb 18, 2023
From: Kurt Garloff [email protected]
Subject: Allow query flavor by name, support alias in desc
When flavors get renamed, all running instances will automatically
see the new names, as they reference the flavors by the unchanged
flavor IDs.
Infra-as-Code tooling from users or from Operators acting as a user
(such as for example the k8s-cluster-api-provider in a managed KaaS
setting) may have configuration with the old flavor names and thus
starts failing after the rename.
nova unfortunately does not have a mechanism to support ailases
for flavors. It does not even expose functionaliaty to find flavors
by name via the API. Neither GET NOVA_URL/v2.1/flavors?name=NAME
nor GET NOVA_URL/v2.1/flavors/NAME work. The openstackclient
on openstack flavor show NAME instead gets a list of all flavors,
searches it for the ID and then does another query with the ID.
To remediate this, we do two things:
(1) We support GET NOVA_URL/v2.1/flavors/NAME. This is only
invoked if the lookup by ID failed and if the NAME starts
with SCS. This will get logged.
This significantly speeds up openstack flavor show SCSNAME
if there is a long list of flavors, as we don't need to transfer
that list. Other tools that don't check whether an identifer
is or is not a UUID and just try (like openstackclient does)
will benefit likewise.
(2) When the GET NOVA_URL/v2.1/flavors/NAME happens and the
name starts with SCS but is not found, another database lookup
is done, checking whether an entry with alias=NAME exists
in the description column of the flavors table. This will
create another log entry.
This works nicely for openstackclient server create and flavor show.
The strategy for a flavor rename could thus be implemented as:
Rename all flavors from OLDNAME to NEWNAME and add alias=OLDNAME
into the description. The nova API does not expose the rename
capability, so it must be done in the database (nova_api flavors
table). It is recommended to script and carefully test this.
The alias support could be dropped later, when no log entries are
created any more indicating that the alias support is no longer
needed.
Considerations for risks and adverse effects:
2.55 and is thus often not even reported and thus unlikely used much.
So we can indeed store our alias information there.
(We could of course also do a few python replace lines to do the
translations without storing anything in any table; this would be
very SCS specific then.)
another query to it will not cause any significant load. Instead,
avoiding to transfer the list of flavors will likely be beneficial
for the overall load on the server.
GET NOVA_URL/v2.1/flavors/NAME succeeds is negligible. We limit
this to names starting with SCS which should not have any duplicates.
The extra check for SCS names is an extra safety measure which
could be dropped to make this aliasing support more generally useful.
by name is searched and found and the reported name then diverges from
what has been asked for. Careful code might have assertions that fail.
but recognize that an identifier is not a UUID and thus query
the list immediately. For these tools, the workaround will be
ineffective. We should validate capo, occm, terraform here.
Way forward:
alias support functionality upstream. A good solution would be to
have a generic mechanism for this drafted in a blueprint and
submitted and merged upstream.
searching, i.e. GET NOVA_URL/v2.1/flavors?name=XXX (and also
other attributes). The openstackclient should detect that an identifier
is not a UUID and the use this new interface when searching for
a flavor by name.
the properties (stored in the separate flavor_extra_specs table).
This would be cleaner and at the same time slightly worse in terms
of performance.
would need to be taught about this.
Signed-off-by: Kurt Garloff [email protected]
garloff commentedon Feb 21, 2023
Would be good to understand whether that approach is:
(1) highly appreciate and we should further pursue it
(2) appreciated from a conceptual point of view but would require a more clean upstream approach
(3) totally hated as it's a hack
garloff commentedon Feb 27, 2023
Some challenges of avoiding standardized flavor naming can be read in SovereignCloudStack/issues#287.
garloff commentedon Mar 7, 2023
Note: The IDs of flavors can be chosen arbitrarily, they don't necessarily need to be in UUID format.
This opens another option to have a smooth transition v1->v2:
0. Stop nova-api (no new servers)
The DB changes of course should be scripted (python) and tested very carefully.
Some research needs to be done whether any other place exists that references the flavors.
The theory is that after this change
The billing system which is likely assigning prices to flavors would need to be adjusted to understand the new names.
garloff commentedon Aug 9, 2023
Further work needed:
https://github.com/SovereignCloudStack/minutes/blob/main/iaas/20230710-overflow.md
https://github.com/SovereignCloudStack/minutes/blob/main/iaas/20230719.md
mbuechse commentedon Aug 16, 2023
Alias Proposal
extra_specsto store any aliases, e.g.,scs:name-v2=SCS-4V-16my-namespace-name=extra-largeGET novaURL/flavors?property%3Ascs%3Aname-v2=SCS-4V-16(%3Ais uri-encoded:)GET novaURL/flavors?property%3Amy-namespace-name=extra-large(The uri-encoding of colons may not be necessary, for the Glance API docs don't do it.)
mbuechse commentedon Aug 21, 2024
I guess I will finally close this issue. We have the extra-specs. If people need server-side queries, then we have to open a new issue for that.