11394 Commits

Author SHA1 Message Date
Brian Elliott
2a052a30ab Keep the ComputeNode model updated with usage
Keep the compute host's ComputeNode model in sync with the
level of resource usage.  This enables the ComputeNode
model to be used as a basis for scheduling decisions
rather than forcing scheduler to calculate free
resources from an instance_get_all on each request.

Resources like memory and disk are claimed as instances are built
or deleted.  There is also support for configurable compute node
stats (a generic key/value store) for extensible advertising of other
usage stats that may be useful for a particular scheduler
implementation.  Additionally, there is a periodic task on the
compute host that audits actual resource consumption at the virt
layer to ensure that the database stays in sync.

This change partially implements blueprint: scheduler-resource-race

This patch complements:
https://review.openstack.org/#/c/9540/  (build re-scheduling support)

Change-Id: Ibbe3839a054f8b80664b413d47f766ca8d68e3f2
2012-06-21 04:25:24 +00:00
Johannes Erdfelt
cb6bf2cf18 Don't stuff non-db data into instance dict
The RPC API passes admin_pass and injected_files as arguments, but when
calling the driver API, those values get stuffed into the instance dict
which is otherwise all data that is stored in the database. This has
led to some bugs (such as 1034948) which could have been avoided if
the code was consistent.

Change-Id: I09a7de8eca3791a5ab27e93b22e5ccccee31cf09
2012-08-12 04:15:41 +00:00
David McNally
743ef64258 Making security group refresh more specific
Fixes bug 1029495

The trigger_members_refresh method in compute.api.py specifies
a group id in the call to refresh_security_group_members. This
is just the last group id seen and ignores the fact that a
refresh may impact members of multiple groups.

This is masked by the fact that on the host the group id is
ignored and all instances have their security rules refreshed
regardless of if they are part of the changed group or not.

This change modifies the logic surrounding refreshes so we send
a refresh request for each instance which is affected by a
security group change, this ensures we aren't spending time
refreshing unaffected instances and also removes the possibility
of refreshing an instance multiple times if it is a member of
more than one group.

Also changed to be instance-centric is the refresh carried out
when a rule is added/removed to a security group.

Change-Id: Iec98e9aed818fdc4ecc88c8dcdd4ee5fa9386e00
2012-08-01 15:51:29 +01:00
Russell Bryant
94d8f1c3cc Use dict style access for image_ref.
When reading image_ref from an instance, use dict style syntax.  This is
to be compatible with no-db-messaging changes.

Part of blueprint no-db-messaging.

Change-Id: I19753da6301c5d78b8fb13b30fbc6996ba828096
2012-08-03 22:07:22 -04:00
Dan Prince
a730ec52e3 Remove unused InstanceInfo class.
We no longer use InstanceInfo.

Also removes some unused _map_to_instance_info functions in
various virt drivers.

Change-Id: I02ead10e43426b9ad051970e9e78e970de5b1ac1
2012-08-06 12:09:23 -04:00
Dan Prince
4af0c9aa7c Remove list_instances_detail from compute drivers.
Removes the list_instances_detail function from various compute drivers
which implement it. We no longer make use of this compute driver
call when syncing power states.

Change-Id: I4980bd8d4ec14c61e16d5be105659f0d5b6748ba
2012-08-06 11:44:11 -04:00
Pádraig Brady
8559919e15 maint: remove an unused import in libvirt.driver
This import was recently reintroduced, due to
confusing pylint output. Therefore remove it again
and adjust things so pylint won't warn in future.

Change-Id: I25f293f171c651c25d27e8d55c9240fd808590ba
2012-08-04 06:01:32 +01:00
Mikyung Kang
815ed0ce6d Fixes bare-metal spawn error.
Implements blueprint Bare-metal provisioning. Fixes bug 1025942.

Change-Id: I55d16747d117de728b02ac938083ef8a79eaaca7
2012-07-17 20:22:25 -04:00
John Garbutt
bf171ac8c7 Refactoring required for blueprint xenapi-live-migration
This refactoring of the libvirt live migration code is
required to enable live migration in the xenapi driver.

This change ensures libvirt specific checks are performed
only when the libvirt driver is enabled.

The complication is that some of these checks require
information to be passed between the source and destination
hosts. For example, when comparing CPU flags.

Change-Id: I7389f0b7f03313d7f04b907f481787dadf0716fd
2012-01-31 14:49:04 +00:00
Sean Dague
d72bf92224 refactor baremetal/proxy => baremetal/driver
Part of bp:virt-driver-cleanup

Make the baremetal driver consistent in naming as a driver
instead of a proxy / connection.

Change-Id: I75d7d90bd8139842b588f1fafb1267511f29a1fb
2012-07-06 10:30:04 -04:00
Andrew Bogott
38b594fedc Switch to common logging.
I only just moved logging from nova to common, so behavior should remain the same.

Change-Id: I1d7304ca200f9d024bb7244d25be2f9a670318fb
2012-06-28 15:59:23 -05:00
Vishvananda Ishaya
86c77ef73b Make libvirt LoopingCalls actually wait()
* Adds wait() to all the LoopingCall timers
 * Fixes loopingCalls in baremetal/proxy.py as well
 * Includes failing test to verify result from destroy
 * Fixes tests depending on improper behavior
 * Fixes bug 1015355

Change-Id: I9e1914c446170e49f0aab76c7745b55d12132425
2012-06-20 00:44:25 +00:00
Zhongyue Luo
d3a8e89f37 Imports cleanup
Fixes bug #1013770

1. Reorder imports by full module path
2. Insert two blank lines after the last import

Change-Id: I294ac3ab528f17a72811392d1732158e9487f3bf
2012-06-16 00:58:36 +08:00
Zhongyue Luo
fc358d95bf Unused imports cleanup (folsom-2)
Fixes bug #1008023

Change-Id: Ifb8ecbb7430fdabd7b5d81ab23df66942abd9cb7
2012-06-03 13:23:11 +08:00
Sean Dague
0ed1297863 convert virt drivers to fully dynamic loading
Progress on bp:virt-driver-cleanup

This series of patches converts the virt drivers to loading via
importutils making it possible to add a virt driver without changing
core code. It deprecates the use of connection_type in favor of a
full driver name in compute_driver.

Based on email thread with Vish and Jay Pipes on approaches to do
this.

Change-Id: I48366ec7efc7b095859988e5e6ac5a853b98b8a7
2012-05-22 15:13:20 -04:00
Yun Mao
032636dd59 cleanup power state (partially implements bp task-management)
Removed duplicate and invalid state in power_state:
FAILED, SHUTOFF, BLOCKED
This is the first step in cleaning up nova state machine
and do better task management (bp/task-management)

http://wiki.openstack.org/VMState

Change-Id: I586b9058fada5efd468870fb187590fc0e37aa8f
2012-05-24 21:51:57 -04:00
Armando Migliaccio
8cb93721b8 clean-up of the bare-metal framework.
address minor problems and errors found in the driver, such as old
docstrings, unused imports, and variables, references of non-existent
classes, and methods; plus remove the requirement that every sub-driver
needs to be implemented as singleton, as the tilera one.

Change-Id: I5943bcdd785c1b4b83e95f88bd7d69c1edc5f62f
2012-05-25 02:16:51 +01:00
Brian Elliott
95173b4f45 Added a instance state update notification
Added a instance update notification (compute.instance.update) that
will report on changes to vm_state and task_state. The goal here is
to provide useful insight into instance state transitions.  (e.g.
BUILDING->ACTIVE)

The new notification has minimial dependencies and is intended for
wide use across the different layers/packages within nova.  Calls
in compute api/manager, scheduler, and the virt layer that modify
the instance state have been instrumented with this notification.

Change-Id: I223eb7eccc8aa079b782f6bb17727cd0b71d18ed
2012-05-13 21:06:29 +00:00
Brian Waldon
62ab8e18bf Update pep8 dependency to v1.1
The latest release of pep8 adds stricter rules for extraneous
whitespace within lines. This patch also addresses these new
violations acoss the codebase.

Change-Id: Ib7e50281870473df1704ed50868c5c2e26bdb02e
2012-05-24 06:56:15 -07:00
Joe Gordon
6c5a501a18 Alphabetize imports in nova/tests/
Change-Id: Ib8e747f91f5277aecc3be01a5e8cee5bc911e823
2012-05-14 14:42:29 -07:00
Russell Bryant
31726f925a Make use of openstack.common.jsonutils.
This patch imports jsonutils from openstack-common.  It removes the
equivalent code from nova.utils and then converts the code base to use
jsonutils.  The primary motivator for this change was to remove the rest
of the dependencies from nova.rpc on nova.utils.

Change-Id: If43658b9b098ed56cba018c81be268b8c3e2916a
2012-05-15 12:54:16 -04:00
Joe Gordon
5f4b3c32fc Alphabetize imports in nova/virt/
Change-Id: Ifca489da67cc834284ee2f2beeaafb28f0638f7e
2012-05-14 14:43:43 -07:00
Alex Meade
ead78d55f1 Replaces exceptions.Error with NovaException
Fixes bug 817107

Change-Id: I6253e6bbcc44676c587b315fa32afba6459e676a
2012-05-03 14:29:50 -04:00
Michael Still
4d7d26988f Log instance information for baremetal.
Change-Id: I38b230b2d4506bc6f7758698a381b3e1ae392e2b
2012-04-12 12:32:25 +10:00
Yuriy Taraday
c6ebf69344 Improved localization testing.
Moved localization tests to tools/hacking.py.

Change-Id: I903b90dfb09a46a72b1c64c30301f90661999f5b
2012-02-24 16:13:44 +04:00
Peng Yong
cbd8b2af50 remove unused flag:
baremetal_injected_network_template
baremetal_uri
baremetal_allow_project_net_traffic

Change-Id: I9766924cc7621e14fc52088a558b95cfd5d7ce8d
2012-04-02 23:04:34 +08:00
Rick Harris
abf5d936ba Add periodic_fuzzy_delay option.
Fixes bug 962665

This random delay is intended to reduce the stampeding behavior
associated with periodic tasks when compute workers are restarted in
unison across a cluster.

Change-Id: Ie3771d94af29049061c129b8ea562ee447a61771
2012-03-22 23:50:36 +00:00
Yuriy Taraday
b1c0c62044 HACKING fixes, TODO authors.
Looks like this fixes all HACKING problems that were around.
Thanks to Dina Belova and Alexander Kovalev for this work.

Change-Id: I63ae1ab2f1bb37daa236cde4096c3c893fd80dd2
2012-03-06 12:47:47 +04:00
Mark McLoughlin
748e6cd61a Add pybasedir and bindir options
Add a pybasedir option so that it can be used for interpolation in the
default values of other options. This helps eliminate hard-coded paths
from the sample config file.

Also add a bindir option for similar reasons, but it also helps with
packaging.

Change-Id: Iadc746dcf2a24adbdf9bac945b5b330f01faeeb5
2012-03-09 11:05:13 +00:00
Johannes Erdfelt
a5f36b3a84 Only raw string literals should be used with _()
Fix a number of places where formatted strings were used with _() (causing
gettext to not match the string) or variables with _() (causing xgettext
to not extract a string)

Also, there's no value in internationalizing an empty string

Change-Id: Iac7dbe46eeaa8ddf03c2a357ecd52f69aa8678aa
2012-03-04 19:06:31 +00:00
Johannes Erdfelt
db41c88bc2 Remove unnecessary setting up and down of mox and stubout
test.TestCase already sets up self.mox and self.stubs as well as calling
self.mox.UnsetStubs(), self.stubs.UnsetAll(), self.stubs.SmartUnsetAll()
and self.mox.VerifyAll() during tearDown.

Change-Id: I74f0824ca1e8daa7b0ee7d7a62b226ba51206e6f
2012-03-01 23:38:17 +00:00
Johannes Erdfelt
45398f7bba Remove unnecessary variables from tests
Change-Id: Id83ea12ee89ee6511277aa2f0929f9bedb8f638b
2012-03-01 23:01:34 +00:00
Michael Still
40e20462b1 Move get_info to taking an instance.
This is a first step towards using uuids in this interface instead
of instance names (which are synonyms for instance ids).

Change-Id: I54b32a5020b0dbc21ba7156ed38ed188c483086b
2012-02-22 12:30:37 +11:00
Joe Gordon
b87a238364 Exception cleanup
Do not write "except:", use "except Exception:" at the very least

Change-Id: I539c013132309791f18c46819232102e9232e917
2012-02-21 00:10:04 -08:00
Zhongyue Luo
327ed78965 Backslash continuations (nova.tests)
Fixes bug #925285

Backslash continuations removal for package nova.tests

Change-Id: I089dfb9a06a807e58ebb21329800a4eff40ed2bb
2012-02-06 09:50:06 +08:00
Brian Waldon
a8dfbe6518 Replace ApiError with new exceptions
* Convert ApiError to EC2APIError
* Add new exceptions to replace ApiError where it didn't belong
* Fixes bug 926250

Change-Id: Ia711440ee0313faf8ea8c87e2c0a2f5b39cc55a2
2012-02-03 13:29:57 -08:00
Jason Kölker
c622ffbc6a Standardize logging delaration and use
* Make modules use getLogger(__name__) and log to the result

Change-Id: Ib6d69b4be140ec89affc86ed11e65e422d551df1
2012-02-14 12:07:02 -06:00
Pádraig Brady
1b5ac0b767 remove unused and buggy function from baremetal proxy
* nova/virt/baremetal/proxy.py (_fetch_image): This function
reference 'images' which is undefined.  So just remove it
as it's unused.

Change-Id: I7016f6e8a68fefab4342adadd032e93f963a074e
2012-02-10 15:18:50 +00:00
Zhongyue Luo
3e655eeab0 Backslash continuations (nova.virt.baremetal)
Fixes bug #929998

Backslash continuations removal for package nova.virt.baremetal

Change-Id: I74beb27b5f5f13fbd6a391a2dc8acf2834846066
2012-02-10 02:44:22 -05:00
Mark McLoughlin
9813a7f075 Remove the last of the gflags shim layer
Make FLAGS a ConfigOpts instance and fix up all the places where we
expected FlagValues behaviour.

Change-Id: I8f96f42e0d8d30ba6b362d29861e717cf0fa9e89
2012-02-03 00:50:58 +00:00
Mikyung Kang
fb851af390 Implements blueprint heterogeneous-tilera-architecture-support
Change-Id: Iad8f66af18eb396f4737cd4ea168edcc77481ee6
2011-11-07 14:32:22 -05:00
Anne Gentle
c1c8d7b296 Deleting test dir from a pull from trunk 2011-02-26 11:13:32 -06:00
Anne Gentle
58279aa0f1 Updated to remove built docs 2011-02-21 14:30:20 -06:00
Jesse Andrews
07d272b2aa initial commit 2010-05-27 23:05:26 -07:00