Second step in removing references to instance_types. Remove all
references to instance_type in nova.compute.flavors.
Also update compute devref to reflect changed name.
Partially implements bp flavor-instance-type-dedup
renamed: nova/tests/test_instance_types.py -> test_flavors.py
Change-Id: I7413bf832c61d04ab90ec8b1370d3f01372c4172
It is possible to use the agent, cloud-init and config drive
together on a single server. In this case we should still
be injecting the instance metadata.
The current code is inconsistent between spawn and migrations.
The correct approach is to always inject the data into xenstore.
fixes bug 1188618
Change-Id: I253b34234544cff353985a5b53ec084ea332535a
This patch makes every boot create a block device mapping if the
instance was started with an image.
These block devices are not used anywhere at the moment but will be used
in the future as part of a more flexible block device API.
This patch also makes sure they are deleted once the instance is deleted
as well.
Change-Id: Ia89d531be71c460f1f82fcfce34b270639a23061
blueprint: improve-block-device-handling
This patch migrates the DB to the new data format. In addition it also
utilizes routines introduced in the change
I9370333059b8c9aaf92010470b8475a913d329b2 in a way that will allow us
to transition into using the new data in Nova logic one step at a time.
This is accomplished in a following manner in the DB/conductor layer,
which is supposed to allow for subsequent changes to be as granular as
possible:
* Read operations - data is always read as is found in the DB - meaning
in the new format, and transformed after every call. This will allow us
to make granular changes in the API/Compute layers.
* Data is converted inside the DB methods that do writes, and an
additional 'legacy' flag is added (set to True by default). It is up to
the calling method to make sure it supplies the DB layer with the format
it is intending to write, to avoid guessing.
An exception to the above is when using conductor due to rpcapi
versioning, so this patch adds a 'legacy' flag to the
block_device_mapping_get_all_by_instance conductor method and bumps the
version of the API.
This patch also fixes some of the block device fixtures in tests, when it was
required to be aware of the new data structure (mostly when mocking DB
methods that return the new data format).
This patch is not supposed to provide any new functionality to Nova.
blueprint: improve-block-device-handling
Change-Id: If30afdb59d4c4268b97d3d10270df2cc729a0c4c
This fixes an issue where not all of the LUNs are seen
by the kernel at attach time, but later become available.
We now rescan the list of devices seen by multipath at
detach time.
Also added another unit test case.
Fixes Bug: #1175366
Change-Id: Id5b313b17454ec32672373b7b564b9450466b7a2
There was no tests in test_db_api for s3_image_*
methods.
Add tests to ensure that all works.
blueprint db-api-tests
Change-Id: I906025f4c5178b26c222fb28d5c3b220e00ae79c
When there's 2 options with the same name, the script gets confused and
doesn't know in which group it goes. This fixes it, and fixes also the
template generation which is broken for various reasons:
- gettext.install was missing
- nova-rootwrap when imported calls exit() because it doesn't find a valid
configuration file, so let's exclude it entirely anyway
- eventlet/greendns needs to be ignored for this
Change-Id: Iaa4e9a806e79032ce1675b46a6b7a7628c3eff89
Signed-off-by: Julien Danjou <julien@danjou.info>
DB models definition should be up-to-date with DB schema obtained after applying of
migrations. Currently, there are no tests enforcing this and it's really hard to
analyze what indexes should be added, and what indexes we have at the moment.
So the first step is it to fix all models, and add missing descriptions about
Indexes and UniqueConstraints in __table_args__ and use explicit 'nullable'
parameter in columns description.
Add missing 'nullable' parameters to all Columns
Add empty __table_args__ parameter to Table
There is no indexes and no unique constraints in this table at this moment.
blueprint db-sync-models-with-migrations
Change-Id: I9b31e8976f514e370d6b46076b469fe5e5c8e0f1
This patch adds the utility functions that will help us switch
between versions of block device mapping data.
In order to accomplish this, and to have a more structured approach to
dealing with block device mapping data in the future, this patch
introduces a BlockDeviceDict class which is a thin wrapper around a
standard dict that makes it easier to reason about which fields are
present in the dictionary, and introduces said conversion routines.
blueprint: improve-block-device-handling
Change-Id: I9370333059b8c9aaf92010470b8475a913d329b2
Fix cases where setting the explanation for an HTTP exception
based on a Nova exception was done using str(ANovaException)
rather than using ANovaException.format_message()
Change-Id: Ia8a361fcb088dcf3c17be0d296aee494b9f063d7
analyze_opts is a tool to help clean out a nova.conf file by checking
for unused and default values set in your nova.conf
Change-Id: I01fff134f8906bff929c55bea8c152653d3e9760
Instances that are booted from volume currently miss out on glance
metadata that instances booted from images receive. By extracting
that data and passing it on in the create request we make it
available to both sorts of instance boot, fixing bug 1175571.
Change-Id: I8c01ba3065a909ca8e1805db9a10a423b10fe289
We have found that current constraint name convention allows us to create
constraints with duplicate names. It happens if we add constraints
in different tables with the same column names (for example, `name`,
`deleted`). In this case we can not create new constraint in mysql due to
database limitation (it requires constraint name to be unique within a
database). To solve this issue unique constraint name convention has
been changed from "uniq_c1_x_c2_x_c3" to "uniq_t0c10c20c3" where `t` is
a table name and columns `c1`, `c2`, `c3` are in UniqueConstraint.
Fixed unique constraints in models description.
Synced db code from oslo (function `_raise_if_duplicate_entry_error()`
modified respectively to new unique constraint name convention).
blueprint db-enforce-unique-keys
Fixes: bug 1182054
Change-Id: I4122dfb910a07a1a423781ebc22e9ce50596a05d
Database access is costly in tests and many tests
don't actually need it. This patch provides a
simple way we can speed up the Nova tests by
providing a new base class, `NoDBTestCase` which
allows us to white-list tests not needing database
access.
The following speedups were observed:
With TestCase: Ran 265 tests in 17.080s
With NoDBTestCase: Ran 265 tests in 9.478s
Further optimizaton could be done by fixing
`test_host_filters` to not hit the database. This
will require some effort though in order to
maintain the quality of test coverage since part
of what's doing is testing the code in the DB
layer.
Change-Id: Ic34c4c39d7f680ac501efb459fdeaa51331ffe1c