1439 Commits

Author SHA1 Message Date
Josh Kearney
c6fa2b7ca2 Log the URL to an image_ref and not just the ID.
Change-Id: Iaae6b969d9ef3cd0f50dd3297d4b0bb51f61f5c9
2011-11-14 15:30:23 -06:00
Ahmad Hassan
f26fae36c2 Verify security group parameters
Introduced various sanity checks before adding security group rule
into the database. The checks have been implemented both in EC2 and
openstack extension code.
Implemented the suggestions made in first patch by Brian
Fixed the unit tests in security groups
Fixed pep8 issues in security group unit tests

Fixes bug 869979.

Change-Id: I2ac28666e90e7bdeacb7b1c2676c0719cfb9e441
2011-11-11 09:46:15 +00:00
Joe Gordon
137fab4769 More spelling fixes inside of nova
Change-Id: I79daf7519c99cc363ac7175c85912298f273da8a
2011-11-09 19:57:44 -08:00
Aaron Lee
da86c164cf Refactor logging_error into utils
update: pep8, and fixing log output.
update2: more pep8, I'm looking at you vim
update3: more formating
update4: mailmap
update5: more pep8

Change-Id: I38617e14260e65ed5cb81b3554479d3720850aae
2011-11-09 11:49:52 -06:00
Jenkins
495662dd6d Merge "Added some documentation to db.api module docstring." 2011-11-09 05:06:21 +00:00
Brad Hall
ae2a368761 Add DHCP support to the QuantumManager and break apart dhcp/gateway
This introduces a new flag "quantum_use_dhcp=<boolean>" which indicates whether
or not to enable dhcp for all of the networks.  If it is set then we start
dnsmasq (and provide it with the IP/MACs from Melange) similar to how this was
done in linux_net before.

Prior to this if you enabled dhcp then you would also get a gateway device..
some people may not want that so we now require that you specify the gateway
when creating the network in order to end up with a device that will act as a
gateway.  If you're using Melange IPAM and you don't specify the gateway you
still end up with one because it doesn't allow you to not have one.  This lays
the groundwork for the option of not having one in the future, at least :)

Also, fix quantum/melange ipam interaction

We now query for the subnets by net_id/vif_id instead of searching through all
the blocks to find the right one.  Both of the allocate and deallocate for
instance calls are now using the vif_id -> network_id mapping instead of
searching the quantum networks.  get_port_by_attachment was also changed to
take a net_id so that we don't have to search through all of the quantum
networks to find the corresponding port.

Change-Id: I6a84da35237b6c5f5cdee91ada92642103439a97
2011-11-04 20:11:53 -07:00
Jenkins
8d6dba4c87 Merge "Log original dropped exception when a new exception occurs" 2011-11-03 17:28:43 +00:00
Lorin Hochstein
00016e3ee6 Added some documentation to db.api module docstring.
See https://lists.launchpad.net/openstack/msg05222.html for info about return values of db layer.

Change-Id: Id7cc7c783d40a9f81ca0e592691635ee15563e0b
2011-11-02 11:34:28 -04:00
renukaapte
a6e1e380db Xen Storage Manager Volume Driver
For details, please read the full specification here:
http://wiki.openstack.org/xenapi-sm-volume-driver

Change-Id: I17028a491d8ddee465bfa920907fe3bcaa911869
2011-11-01 16:16:09 -07:00
Jenkins
7400fb3158 Merge "flatten distributed scheduler" 2011-11-01 17:09:59 +00:00
Jenkins
84e231543e Merge "Fixes lp883279" 2011-11-01 15:06:08 +00:00
Jenkins
bd0ca427df Merge "Fix lp:861160 -- newly created network has no uuid" 2011-11-01 14:51:14 +00:00
Sandy Walsh
5dcf71a64b flatten distributed scheduler
This branch removes AbstractScheduler, BaseScheduler and LeastCostScheduler
and replaces it with DistributedScheduler. Now the points of extension are
handled via the --default_host_filters and --least_cost_functions only.

Also, greatly simplified the zone handling logic in DistibutedScheduler, mostly
by removing the cryptic dicts with helper classes.

Fixed up the Least Cost functions to better deal with multiple functions.
(In a followup patch I will removed the normalization that occurs as this will
be a problem).

Tests were mostly rewritten to support this new world order.

Debated removing JSONFilter since it's not accessible from the outside world,
but decided to keep it as there are discussions afoot on making scheduler
changes without having to redeploy code or restart services.

HostFilters once again get the all the host service capabilities, but now
via a HostInfo class that mostly contains read-only dicts of capabilities.

Virtual resource consumption is done in the DistributedScheduler class now.
The filters/weighing functions don't need to worry about this. Also, weighing
functions only have to return a single host and not worry about the number of
instances requested.

Change-Id: I92600a4a9c58b1add775c328a18d8f48c305861e
2011-11-01 04:28:34 -07:00
Brian Waldon
eeecf3536b Creating uuid -> id mapping for S3 Image Service
This creates a mapping of Glance uuids to preserve the
EC2-specific image id format. This adds a lazily generated
mapping layer that is stored in the database.

This also fixes bug 882658

Change-Id: I64bf6c7297b97f206b967781a28791aa3874ca81
2011-10-31 13:56:03 -04:00
Matt Dietz
dc1d040ac6 Fixes lp883279
Nova sending instance_id in notifications instead of uuids

Change-Id: I411ea1a9aee53af4ee8cb4b1118dc41549c80227
2011-10-31 11:44:04 -05:00
Johannes Erdfelt
3acbf6499c Log original dropped exception when a new exception occurs
If a exception is caught while processing a previous exception, make sure
to log it so it doesn't silently get discarded

Change-Id: Ic887db9c2592229970737daf5dd9732b2258877b
2011-10-31 16:42:47 +00:00
Unmesh Gurjar
b56dd3e883 Fix lp:861160 -- newly created network has no uuid
Implemented code review changes.
Fixed issue causing pep8 build failure.
Change-Id: If2cc0e23be8d4e1558a10fa86e6ba4cdec61b7d1
2011-10-31 11:32:09 +05:30
Aaron Lee
e141506944 Adding bulk create fixed ips. The true issue here
is the creation of IPs in the DB that are not 
currently used(we are building the entire block).
This fix is just a bandaid, but it does cut ~25 
seconds off of the quantum tests on my laptop.

(pre)$ ./run_tests.sh -N nova.tests.test_quantum:QuantumNovaIPAMTestCase
QuantumNovaIPAMTestCase
    test_allocate_and_deallocate_instance_dynamic               OK  11.36
    test_allocate_and_deallocate_instance_static                OK  11.27
    test_create_and_delete_nets                                 OK  10.35
    test_validate_bad_network                                   OK  0.10

(post)$ ./run_tests.sh -N nova.tests.test_quantum:QuantumNovaIPAMTestCase
QuantumNovaIPAMTestCase
    test_allocate_and_deallocate_instance_dynamic               OK  2.94
    test_allocate_and_deallocate_instance_static                OK  3.12
    test_create_and_delete_nets                                 OK  1.86
    test_validate_bad_network                                   OK  0.11
    

Change-Id: I46b629f9ca6e019c7c4c6aa8e869c551e5c13fb8
2011-10-27 17:37:34 -05:00
Chris Behrens
8a541f6bcd Revert how APIs get IP address info for instances
Fixes bug 862839

listing instances with IPs is extremely inefficient after changes were
made to query the network manager for IP information for each instance.
I tried adding a network manager call that said 'give me IP information
for 'x' instances', but that was also too slow.

We need a solution that caches IP info from the network manager before
we can fully untie things.  So, this reverts APIs to use
instance['fixed_ips'] which hasn't been untied in the DB yet.

Change-Id: I37d21105d6306f0a812c5eb0f0717a5094cd17b9
2011-10-26 19:17:42 -07:00
Jenkins
ec51366a6a Merge "Replaces all references to nova.db.api with nova.db" 2011-10-26 16:28:10 +00:00
Jenkins
607fd1274f Merge "Improve the liveness checking for services" 2011-10-26 01:01:00 +00:00
Alex Meade
412f112585 Replaces all references to nova.db.api with nova.db
Fixes bug 881640

Change-Id: Idaa9d175a82f42761e4fbfaf96571671cf44cbcd
2011-10-25 16:18:40 -04:00
Brian Waldon
684a84ca94 Convert instancetype.flavorid to string
Fixes bug 861666. This also removes some direct database access
in favor of using nova.compute.instance_types throughout the code.

Change-Id: I572cc19454fa76f435f5672d3d6e7ed55c8817da
2011-10-22 12:57:35 -04:00
David Subiros
2fc769e1d8 Improve the liveness checking for services
With this modification both nova-manage and scheduler use the flag
service_down_time and check positive and negative values in a
correct way.
Fixes bug: 867674.

Change-Id: I15c48d80cafa2089cd228c09c61b0a1e513730e8
2011-10-21 13:32:01 +01:00
Jenkins
ecff45d629 Merge "Repartition and resize disk when marked as managed." 2011-10-19 18:08:04 +00:00
Rick Harris
7c83b754dc Repartition and resize disk when marked as managed.
Implements part of the instance-disk-management blueprint.

Change-Id: I16d0f816cdf82ee1e19a323cb9976477924e4c5c
2011-10-19 11:45:42 -05:00
Chris Behrens
2e52ffc76b Remove dead DB API call.
Removes instance_set_state() from db/api.py.  The sqlalchemy version was
removed a while ago so this call is dead.

Change-Id: Icf6f55481bc0c6a9394ca9b7a15fcdab2c1ad483
2011-10-19 09:43:02 -07:00
Mark McLoughlin
7bb73a620a Remove unused flag_overrides from TestCase
This was replaced by _original_flags in e0ae19c7a, but it wasn't
actually removed.

Change-Id: I89ed7de263ff040d86dea970aa8fcda640d19f79
2011-10-15 16:44:56 +01:00
Jenkins
49eff2ef0d Merge "Adds the ability to automatically issue a hard reboot to instances that have been stuck in a 'rebooting' state for longer than a specified window." 2011-10-14 19:04:13 +00:00
Jenkins
f127d7d63c Merge "Xenapi driver can now generate swap from instance_type" 2011-10-14 18:54:09 +00:00
Rick Harris
acc5488acf Xenapi driver can now generate swap from instance_type
Change-Id: I50268a85ccd62b019436a207c2b52b1901597564
2011-10-13 18:46:38 -05:00
Josh Kearney
f60d3eff5c Adds the ability to automatically issue a hard reboot to instances that have been stuck in a 'rebooting' state for longer than a specified window.
Fixes bug 873099.

Change-Id: Ife2c64326fdb3ec849242583d1bd1d96f9f4be0f
2011-10-13 16:12:42 -05:00
Monsyne Dragon
697cfecb59 Adds more usage data to Nova's usage notifications.
Adds in bandwidth, state and IP data on standard notifications,
and new notifications on add/remove IP.

These were missing before, and are needed to meet spec.
This fixes bug 849117

Change-Id: Ie586ff3a91a56e5f5eff8abc6905ba6a0b624451
2011-10-12 19:11:14 +00:00
Jenkins
d0f4a18e99 Merge "Fix the grantee group loading for source groups" 2011-10-12 00:21:42 +00:00
Vishvananda Ishaya
427ce26919 Remove AoE, Clean up volume code
* Removes Ata Over Ethernet
 * Adds drivers to libvirt for volumes
 * Adds initialize_connection and terminate_connection to volume api
 * Passes connection info back through volume api

Change-Id: I1b1626f40bebe8466ab410fb174683293c7c474f
2011-10-11 14:25:04 -07:00
Jenkins
ab0ef769e2 Merge "moved floating ip db access and sanity checking from network api into network manager added floating ip get by fixed address added fixed_ip_get moved floating ip testing from osapi into the network tests where they belong" 2011-10-10 17:01:35 +00:00
Julien Danjou
db69ed2017 Include original exception in ClassNotFound exception
By doing this, we allow the error messages to be more useful. When an import
of a class fails because of a missing module dependency, it would have fail
that way for example:

$ nova-manage
Traceback (most recent call last):
  File "./bin/nova-manage", line 84, in <module>
    from nova import image
  File "/home/jd/Work/src/nova/nova/image/__init__.py", line 22, in <module>
    from nova.image import glance
  File "/home/jd/Work/src/nova/nova/image/glance.py", line 42, in <module>
    GlanceClient = utils.import_class('glance.client.Client')
  File "/home/jd/Work/src/nova/nova/utils.py", line 66, in import_class
    raise exception.ClassNotFound(class_name=class_str)
nova.exception.ClassNotFound: Class Client could not be found

This does not help the user, since it indicates the class Client cannot be
found, even if it is actually found but fail to import.

With this commit, the error message is better:
nova-manage
Traceback (most recent call last):
  File "./bin/nova-manage", line 84, in <module>
    from nova import image
  File "/home/jd/Work/src/nova/nova/image/__init__.py", line 22, in <module>
    from nova.image import glance
  File "/home/jd/Work/src/nova/nova/image/glance.py", line 42, in <module>
    GlanceClient = utils.import_class('glance.client.Client')
  File "/home/jd/Work/src/nova/nova/utils.py", line 66, in import_class
    raise exception.ClassNotFound(class_name=class_str, exception=exc)
nova.exception.ClassNotFound: Class Client could not be found: No module named kombu.connection

This helps to know that in this kombu is missing.

It would probably even better to rename ClassNotFound to
ClassCannotBeImported or something like that too.

Change-Id: I4100d931a0a825fa0729d5467d2f9268fdd2a261
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2011-10-10 09:55:37 +02:00
Stanislaw Pitucha
6915d1e912 Allow db schema downgrades
When a destination version is specified, check the current version and allow
downgrading the schema. Fixes bug 865357.

Change-Id: I47104158884421de92f50322a72243c170a4f1ad
2011-10-03 17:12:14 +01:00
Trey Morris
9f6acdf1e8 moved floating ip db access and sanity checking from network api into network manager
added floating ip get by fixed address
added fixed_ip_get
moved floating ip testing from osapi into the network tests where they
belong

Change-Id: I3ee53971206e37405a2adc2491412f7896e1af87
2011-09-30 15:39:02 -05:00
Vishvananda Ishaya
bec64033f8 Fix the grantee group loading for source groups
Fixes bug 859679.

Change-Id: Ia0b90b8373a02955f23b6dda0495f01511762822
2011-09-26 08:34:48 -07:00
Johannes Erdfelt
1a0c983020 Fix some minor issues due to premature merge of original code.
Consolidate duplicated code between delete() and force_delete(). Treat soft
deleted instances like hard deleted instances in queries. Fix running unit
tests individually do to using flags from a non-imported module.

blueprint deferred-delete-instance

Change-Id: Id58b607320536364867ee5c8d347b250406d9a2d
2011-09-26 02:56:08 +00:00
Jason Koelker
6248bd3be8 * Rework osapi to use network API not FK backref
* Fixes lp854585

Change-Id: I270794a08a1bfafe7af427cd31f1f60df1faa4ba
2011-09-25 12:24:52 -05:00
Rick Harris
77bf4e00f1 Merging trunk 2011-09-21 17:50:02 -05:00
Rick Harris
387594ced6 Adding OSAPI tests for flavor filtering 2011-09-21 17:49:35 -05:00
Rick Harris
66416b088c This patch adds instance progress which is used by the OpenStack API to indicate how far along the current executing action is (BUILD/REBUILD, MIGRATION/RESIZE).
For the first cut, we decided to keep it simple and compute progress by counting discrete steps. This is not ideal since some steps, in particular, steps which involve transferring large amounts of data over the network, take *much* longer than others. A better approximation would account for the data-transferred to the destination host, since in most cases, this dominates the time spent.

In addition to adding progress, this patch:

- Allows resizes to use same host for source and destination which is useful for dev environments without a second host. This is enabled by the --allow_resize_to_same_host flag.

- Fixes a bug in the glance and migration XenAPI plugins where the VHDs were being copied into the SR in the wrong order. Before the base-copy was copied first meaning it was possible for snapwatchd to see the base-copy before the dependent cow was present. It was treat the base_copy as an unreferenced parent, and GC it.

- Additional refactoring and cleanups.
2011-09-21 22:14:15 +00:00
Rick Harris
a89584f61d Merging trunk 2011-09-21 17:07:56 -05:00
Rick Harris
55ac7c9a32 Fixing tests 2011-09-21 15:59:40 -05:00
Rick Harris
10baa29ecc Adding flavor filtering 2011-09-21 16:29:36 +00:00
Chris Behrens
fcae82a644 Merged trunk 2011-09-21 09:00:18 +00:00
Chris Behrens
425ee80d43 floating ip could have no project and we should allow access 2011-09-21 08:37:54 +00:00