If CONF.image_cache.remove_unused_base_images is True, the base and
swap files are removed during the image cache manager's periodic
task while the ephemeral backing files are never deleted. This is a
long standing bug and this patch proposes to remove the ephemeral
backing files in the same way as for the swap files.
Change-Id: Ibf722265a4450fb81d40dee635667e39bc5b3edc
Closes-bug: #1602193
If the nova compute image cache is on the same disk as the instance
directory then the images in the cache will consume the same disk
resource as the nova instances which can lead to disk overallocation.
This patch adds a new config option
[workarounds]/reserve_disk_resource_for_image_cache . If it is set the
libvirt driver will reserve DISK_GB resources in placement for the
actual size of the image cache.
This is a low complexity solution with known limitations:
* Reservation is updated long after the image is downloaded
* This code allows the reservation to push the provider into negative
available resource if the reservation + allocations exceed the total
inventory.
Change-Id: If874f018ea996587e178219569c2903c2ee923cf
Closes-Bug: #1878024
Blueprint image-precache-support added a conf section called
[image_cache], so it makes sense to move all the existing image
cache-related conf options into it.
Old:
[DEFAULT]image_cache_manager_interval
[DEFAULT]image_cache_subdirectory_name
[DEFAULT]remove_unused_base_images
[DEFAULT]remove_unused_original_minimum_age_seconds
[libvirt]remove_unused_resized_minimum_age_seconds
New:
[image_cache]manager_interval
[image_cache]subdirectory_name
[image_cache]remove_unused_base_images
[image_cache]remove_unused_original_minimum_age_seconds
[image_cache]remove_unused_resized_minimum_age_seconds
Change-Id: I3c49825ac0d70152b6c8ee4c8ca01546265f4b80
Partial-Bug: #1847302
The method's return value is never used, only its side-effects are
used. We rename it to reflect its actual usage, and remove the unused
return value to avoid confusion.
NOTE(mdbooth): The use of global state is a large part of what makes
ImageCacheManager hard to read. I don't mean to imply with this change
that's what should be done here, only to make it clearer to the reader
that it is what's being done currently.
Change-Id: Ic82f6d4f00fd1226673750538019339937a623bc
The config options of the section
"nova/netconf" got moved to the
new central location
"nova/conf/netconf.py"
Change-Id: I8a17b6f00b15e03de55385fc0206bdc82441304a
Depends-On: I0da2ad7daa942b85c3395dc4861c6e18368ece88
Implements: blueprint centralize-config-options-newton
Add options from 'virt.imagecache'. These options are part of the
'DEFAULT' group but are included in the "nova.conf.virt" file in hope
that they can eventually be moved to their own group.
Change-Id: I0e683c08b0479e41487c6b05de7d588f5d88ad0e
Implements: bp centralize-config-options-newton
Make a single db call to get bdms for all instances instead of one
call per instance.
Change-Id: I74864b398f2d17a24b9ed676945183401e9872a0
Closes-Bug: #1484847
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
This commit includes:
- using oslo_utils instead of oslo.utils
- using oslo_serialization instead of oslo.serialization
- using oslo_db instead of oslo.db
- using oslo_i18n instead of oslo.i18n
- using oslo_middleware instead of oslo.middleware
- using oslo_config instead of oslo.config
- using oslo_messaging instead of "from oslo import messaging"
- using oslo_vmware instead of oslo.vmware
Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
Currently swap backing files are never removed from the system.
The image clean-up code should recognise at least obsolete unused files
need to be removed.
Change-Id: I09519a73c7233f2dc6f46f6cd094a3e1cc3dc395
Partial-Bug: 1253991a
During development of Juno, Ia227f4c4e69ecf361ab02d1d17a3010303650104
added a warning that the behaviour of periodic_tasks with an interval of
0 would change. This patch changes the behaviour and removes the
warning.
Oslo (which provides the @periodic_task decorator) uses spacing=0 to
mean "run at the default interval of 60s", but several nova methods used
spacing=0 to mean "don't run". These methods now behave consistently
with the Oslo code.
Due to an error in the original patch, some of the warnings refer to the
intended behaviour change as being in "the K release", and some to "Juno".
The warning about changing behaviour is first present in Juno, so this
patch should be merged in Kilo.
Change-Id: Ie5f2092a3b84e3674fe6a68ce511d2dc218bb625
Closes-bug: 1276203
Commit 1023e703bd added support
for objects. This patch ensures that the parsing of the instances
is correct.
The patch does the following:
1. In the method _list_running_instances it treats all instances
as an object
2. Fixes the bug mentioned below. The code was making a string from
None. This would lead to invalid image details.
3. Ensures that the unit tests actually pass instance objects instead
of an instance dict
4. In relevant tests updates assertEquals to have the expected parameter
first
Closes-bug: #1354664
Change-Id: Ib028baab4d4c823f22c371a83f7a813c24d77570
The behaviour of Oslo's @periodic_task decorator is that
a repeat interval of 0 means that the method will be
called regularly. Several Nova methods which use that
decorator also have code for returning early (ie no-op)
if the interval is 0. This is inconsistent for users, and
means there is timing-related code where it doesn't belong.
This patch adds a warning when a user takes a value of 0
from config and uses it as an interval in a @periodic_task.
Ideally all code will use Oslo's convention that 0 means
run at the default rate and a negative interval will mean
"don't run". After this warning has been in place for a full
release cycle that can be the case.
Change-Id: Ia227f4c4e69ecf361ab02d1d17a3010303650104
DocImpact: Warns of upcoming change to behaviour when
*_interval is set to 0
Closes-Bug: #1272830
Partial-Bug: #1276203
Just like the beginning of every other release, remove the deprecated
config option aliases that were marked as deprecated in Icehouse.
Equivalent Icehouse patch: I64548e40f6cea42275a6f0f3ebdc0c4cd9324804
DocImpact: Configurations that were deprecated in the Icehouse release are not
recognized in Juno.
Change-Id: I346ee0248c03e60716bd7dc4a5ee4493610867cb
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.
Also a check is added to hacking to detect if they are re-added.
Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
In addition to this it creates a base ImageCacheManager class.
This moves common image cache config from the libvirt driver into
a place that can be shared between drivers, nova.virt.imagecache
The libvirt specific image caching variables are untouched.
The other image cache fields that were in the nova.compute.manager
have also been moved to the common place.
These common configuration can be used by the
blueprint multiple-image-cache-handlers and the
blueprint vmware-image-cache-management.
DocImpact
The following configuration variables are now in the DEFAULT
section:
image_cache_manager_interval
image_cache_subdirectory_name
remove_unused_base_images
remove_unused_original_minimum_age_seconds
Change-Id: I92080f20c3d21ec348aff7d0a9795e773bcc2649