We place these in a 'legacy_migrations' directory, as we will soon be
adding alembic-based migrations in a 'migration' directory.
Change-Id: Ib927e4c48f59a467a913875111ffbf64ffe0de90
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
At this point is nova's lifecycle, we're not going to change our ORM,
making the layer of indirection that is 'nova.db.sqlalchemy' is a
useless one. Start removing it with the 'migration' module.
Change-Id: I5fd6c6f74b7de2b422359cbe72defb07252e6b1e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change If90d9295b231166a28c2cc350d324691821a696b kicked off this effort
but only change the migrations. This change completes the job.
Change-Id: Ic0f2c326ebce8d7c89b0debf5225cbe471daca03
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This change is a partial revert of
Ibf8dca4bd57b3bddb39955b53cc03564506f5754
to reintoduce a try-except which is required for
some non standard hardware.
On the Cavium ThunderX platform, it's possible to have
virutal functions which are netdevs which are not associated
to a PF. This causes the PF name lookup to fail.
Prior to Ibf8dca4bd57b3bddb39955b53cc03564506f5754
when the lookup failed it was caught and we skipped
populating the parent PF interface name.
This change restores that behavior.
Closes-Bug: #1915255
Change-Id: Ia10ccdd9fbed3870d0592e3cbbff17f292651dd2
The link of `TLS everywhere` should be 'https://docs.openstack.org/
project-deploy-guide/tripleo-docs/latest/features/tls-everywhere.html'.
Closes-Bug: #1933062
Change-Id: I468b82edeb899b0a780f8b545ad23ee0428a93ea
The nova-tox-functional-py36 job was replaced with the current py38
version during Victoria by I1d6a2986fcb0435cfabdd104d202b65329909d2b.
However as clearly stated in both the Victoria and Xena runtime
reference documents python 3.6 remains supported through CentOS 8 and
later CentOS 8 stream.
This change reintroduces functional test coverage for py36 using a
CentOS 8 stream based job.
[1] https://governance.openstack.org/tc/reference/runtimes/victoria.html
[2] https://governance.openstack.org/tc/reference/runtimes/xena.html
Change-Id: I6ef77bd92f2595016a99d1953414d3f554f6b2eb
Only install mariadb on EL based hosts. Also when using mariadb and
postgresql on EL based distros we need to ensure each service is
configured and actually started before using either.
Co-Authored-By: Ade Lee <alee@redhat.com>
Change-Id: I7122933d85bd7d0333c2c35e0f1a8414c1baa6d5
Nova has never supported specifying per numa node
cpu toplogies. Logically the cpu toplogy of a guest
is independent of its numa toplogy and there is no
way to model different cpu toplogies per numa node
or implement that in hardware.
The presence of the code in nova that allowed the generation
of these invalid configuration has now been removed as it
broke the automatic selection of cpu topologies based
on hw:max_[cpus|sockets|threads] flavor and image properties.
This change removed the incorrect code and related unit
tests with assert nova could generate invalid topologies.
Closes-Bug: #1910466
Change-Id: Ia81a0fdbd950b51dbcc70c65ba492549a224ce2b
This change reproduces bug #1910466
When hw:cpu_max_[sockets|cores|threads] is configured
in addition to an explict numa topologies and cpu pinning
nova is currently incapable of generating the correct
virtual CPU topology resulting in an index out of range
error as we attempt to retrieve the first topology
from an empty list.
This change reproduces the error via a new functional
test.
Related-Bug: #1910466
Change-Id: I333b3d85deed971678141307dd06545e308cf989
This was removed in change I9b964c8e68051a995635a3d5f5aa09af2b0dcb82 but
it's still a valid thing to do. Reintroduce it, cleaning up the test in
the process by removing references to dump tables (which were removed
entirely in change I17db7cdaad2c6368092b4fb00d5959711ad249f9) as well as
references to migrations that no longer exist as they've been squashed.
Change-Id: I70219a094e473da113c9855b610c11faea50f3b3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The task_log table contains instance usage audit records if
nova-compute has been configured with [DEFAULT]instance_usage_audit =
True. This will be the case if OpenStack Telemetry is being used in the
deployment, as the option causes nova to generate audit information
that Telemetry then retrieves from the server usage audit log API [1].
Historically, there has been no way to delete task_log table records
other than manual database modification. Because of this, task_log
records could pile up over time and operators are forced to perform
manual steps to periodically truncate the table.
This adds a --task-log option to the 'nova-manage db
archive_deleted_rows' CLI to also archive task_log records while
archiving the database. --task-log works in conjunction with --before
if operators desire archving only records that are older than <date>.
The 'updated_at' field is used by --task-log --before <date> to
determine the age of a task_log record for archival.
Closes-Bug: #1877189
[1] https://docs.openstack.org/api-ref/compute/#server-usage-audit-log-os-instance-usage-audit-log
Change-Id: Ibed67854a693c930effd4dba7aca6cd03b65bd92
This currently runs in the 'check' pipeline, as part of the pep8 job,
which causes otherwise perfectly valid backports to report as failing
CI. There's no reason a stable core shouldn't be encouraged to review
these patches: we simply want to prevent them *merging* before their
parent(s). Resolve this conflict by moving the check to separate voting
job in the 'gate' pipeline as well as a non-voting job in the 'check'
pipeline to catch more obvious issues.
Change-Id: Id3e4452883f6a3cf44ff58b39ded82e882e28c23
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Reduce some duplication before we move these things around.
Change-Id: Id2285eeb7c56f598768da376d85b6830c2e99fb6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
A number of the abstract APIs in 'nova.db.api' had a different function
signature to their concrete implementations in 'nova.db.sqlalchemy.api'.
Correct this. Functions changed include:
- action_get_by_request_id
- create_context_manager
- instance_add_security_group
- instance_extra_update_by_uuid
- instance_get_all_by_filters
- instance_remove_security_group
- migration_get
- migration_get_by_id_and_instance
- pci_device_update
- service_get_minimum_version
- virtual_interface_delete_by_instance
- virtual_interface_get_by_instance
- virtual_interface_get_by_instance_and_network
To do this, the following script was used:
>>> import nova.db.api as base_api
>>> import nova.db.sqlalchemy.api as sqla_api
>>> import collections
>>> import inspect
>>> for name in dir(base_api):
... fn_base = getattr(base_api, name)
... if not isinstance(fn_base, collections.Callable):
... continue
... fn_sqla = getattr(sqla_api, name, None)
... if not fn_sqla or not isinstance(fn_sqla, collections.Callable):
... print(f'missing function in nova.api.sqlalchemy.db: {name}')
... spec_base = inspect.getfullargspec(fn_base)
... spec_sqla = inspect.getfullargspec(fn_sqla)
... if spec_base != spec_sqla:
... print('mismatched function specs:')
... print(f'base: {spec_base}')
... print(f'sqla: {spec_sqla}')
... break
In order for *this* to work, it was necessary to update the many
decorators in 'nova.db.sqlalchemy.api' so that function signatures were
preserved. This is possible by setting the signature of the wrapper to
that of the wrapped function.
Change-Id: Icb97a8b4e17fdbb2146ddf2729c906757c664f66
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We want to remove a level of indirection. Preserve the useful things
here, specifically, the docstrings. This was managed using the following
script:
>>> from nova.db import api as api_a
>>> from nova.db.sqlalchemy import api as api_b
>>> from inspect import getmembers, isfunction
>>> members_a = dict(getmembers(api_a, isfunction))
>>> members_b = dict(getmembers(api_b, isfunction))
>>> mismatch_members = []
>>> for member in members_a:
... if member in members_b:
... doc_a = members_a[member].__doc__
... doc_a = doc_a.strip() if doc_a else doc_a
... doc_b = members_b[member].__doc__
... doc_b = doc_b.strip() if doc_b else doc_b
... if doc_a and doc_a != doc_b:
... mismatch_members.append(member)
>>> for member in mismatch_members:
... print(member)
The docstrings are still missing a lot of information about parameters,
but that can be addressed another time/never.
Change-Id: I9f414cf831316b624132d9e06192f1ecbbd3dd78
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This made sense back in the day where the ORM was configurable and we
were making lots of direct calls to the database. Now, in a world where
most things happen via o.vo, it's just noise. Remove it.
Change-Id: I216cabcde5311abd46fdad9c95bb72c31b414010
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>