Commit Graph

16446 Commits

Author SHA1 Message Date
MotoKen dcabd6159a Fix reserve_block_device_name while attach volume
The block device name will not be reserved in current implementation
due to missing volume_id in block_device_mapping. This will cause
block_device.instance_block_mapping does not return the ebs device
which should be reserved.

This patch adds the volume_id to block_device_mapping while reserving
block device name and changes the rpcapi to send the volume_id.

Fixes bug 1062033

Change-Id: I8f08b568619fefa99850de0bee7d605749d53b0a
2012-10-05 15:53:52 +08:00
Jenkins 101093428d Merge "Always use bdm in instance_block_mapping on Xen" 2012-10-05 06:05:36 +00:00
Jenkins 6b916217af Merge "xenapi: Refactor snapshots during resize" 2012-10-05 01:10:45 +00:00
Clay Gerrard 07845ad68f Always use bdm in instance_block_mapping on Xen
It doesn't seem that Xen will set the 'root_device_name' property on
instances.  This is causing instance_block_mapping to return early
without evaluating the bdm before returning the list of device_names
in use.  I'm not sure why instance_block_mapping does this
(optimization?) but on Xen at least it seems that it should not.

Added a check for Xen compute_driver flag in instance_block_mapping to
"guess" the root_device_name (similarlly to what is done in
compute.utils for swap and ephemeral).

fixes bug #1061944

Change-Id: If5b1a2b7377232c78f0629a3624552ecf6ceb0ee
2012-10-04 18:59:43 -05:00
Jenkins b1896ede69 Merge "Move snapshot image property inheritance" 2012-10-04 23:38:23 +00:00
Jenkins cbd850ca3a Merge "Fix XML response for return_reservation_id." 2012-10-04 22:54:26 +00:00
Jenkins 73e0642f0d Merge "libvirt: Fix _cleanup_resize" 2012-10-04 22:41:16 +00:00
Jenkins 2a5f567e24 Merge "Add api samples to Certificates extension" 2012-10-04 21:57:22 +00:00
Jenkins 5d5260aae6 Merge "Add nova-cert service to integrated_helpers" 2012-10-04 21:54:25 +00:00
Jenkins 9cb46a450c Merge "powervm: remove broken instance filtering" 2012-10-04 21:40:02 +00:00
Kevin L. Mitchell 1c68e733ca Move snapshot image property inheritance
The xenapi snapshotting code had support for inheriting properties
from the base image of the snapshot (by way of the system metadata
set on the snapshotted instance).  The problem, however, came in the
fact that some image properties were set in nova.compute.api, but
those properties were not excluded from this inheritance logic
except through a configuration option called
"non_inheritable_image_properties".  I had previously updated the
default setting for this option to work around the bugs introduced
by setting image properties in two different locations, but now it
is time for the real fix.

This change moves the inheritance logic into
nova.compute.api:API._create_image.  Note that two properties are
still set through the xenapi snapshotting logic: the "os_type" and
the "auto_disk_config" properties, which are presumed to be xenapi
specific.  The change also alters the inheritance logic to ensure
that the work-around listing of image properties in
non_inheritable_image_properties is no longer necessary; the
default for this configuration option is updated accordingly.

(Note: It will not harm anything to have these image properties
still listed in non_inheritable_image_properties, so configurations
that override this option do not need to be altered.)

Change-Id: I3514da432cc10c75418e1de9752f60640d579136
2012-10-04 16:23:14 -05:00
Jenkins 88c8c979b9 Merge "powervm: exception handling improvements" 2012-10-04 20:33:37 +00:00
Matthew Treinish 903b51e148 Fix XML response for return_reservation_id.
The XML serializer for create uses the server template for it's response.
However, when return_reservation_id is set, only a reservation_id is
going to be returned.

To enable the XML response to be serialized the reservation id is now
returned in a server tag/object.

This commit fixes bug 1061124

Change-Id: Ic74071b1d527c3f3752e296d3fd46a28a99beb76
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
2012-10-04 15:59:49 -04:00
Jenkins b4617555b4 Merge "libvirt: ignore deleted domain while get block dev" 2012-10-04 19:37:46 +00:00
Jenkins df22ef9c0f Merge "Updated code to update attach_time of a volume while detaching" 2012-10-04 17:27:57 +00:00
Jenkins 5ca55f5578 Merge "Stop network.api import on network import" 2012-10-04 17:23:24 +00:00
Jenkins 3c8ed4ec14 Merge "Zmq register opts fix in receiver" 2012-10-04 17:04:47 +00:00
Jenkins f96fe43e63 Merge "Add ability to download images via BitTorrent." 2012-10-04 17:01:48 +00:00
Vishvananda Ishaya 31764456bd Stop network.api import on network import
The nova.network.__init__.py was importing the network.api
automatically at import time. This was leading to some silly
workarounds (for example in nova/virt/firewall.py) involving
late importing nova.network to stop circular imports.

It is also causing issues with https://review.openstack.org/#/c/13007/
because quantum api needs to import a flag from network manager
which is causing a circular import.

This fixes the issue by moving to use the code from volume_api
which only imports the api class when the method is called. It cleans
up the tests that were stubbing out network.API and also removes
the unneeded workarounds.

Change-Id: I4c9b372d078ab4398e797335a8de5e9e1077e31f
2012-10-04 09:49:24 -07:00
Jenkins b01c148f2f Merge "Remove deprecated Folsom code: config convert" 2012-10-04 16:36:45 +00:00
Jenkins 96f610516f Merge "ip_protocol for ec2 security groups" 2012-10-04 15:54:19 +00:00
MotoKen 5a16b8f3e2 libvirt: ignore deleted domain while get block dev
The get_all_block_devices could raise libvirtError if domain was deleted
while listing instances. This will cause LibvirtISCSIVolumeDriver to fail
disconnect_volume. This patch ignores the domain that could not be found
to avoid this issue.

Fixes bug 1060836

Change-Id: I9dc994d8ca7fc084830adb4f6f9d3ca10e0fe577
2012-10-04 15:25:18 +08:00
Renuka Apte 3595275016 xenapi: Refactor snapshots during resize
Currently, we use VM.snapshot for resize, which fails if we have a
volume attached to the VM, which does not support snapshots. This change
uses VDI.snapshot instead, for all VDIs that are not attached by nova.

Also needed for xenapi: detaching and reattaching volumes during
migrations and reverting of migrations.

Fixes Bug #1028092

Change-Id: I3e2973747135a9c33de194e38537620c397bb87e
2012-10-03 20:32:22 -05:00
Matt Odden b4e9e3ee39 powervm: remove broken instance filtering
Filtering isn't necessary (nor desired in some cases)
Irrelevant comment cleanup

fixes bug #1061291

Change-Id: I0798ff20aea7551b1d1100e8a439c39be99291e1
2012-10-03 22:17:44 +00:00
Rick Harris 216a83da47 Add ability to download images via BitTorrent.
This patch adds a new dom0 plugin which supports downloading images via
BitTorrent. Torrent metadata files are assumed to be served from a
webserver which is specified by the `torrent_base_url` config.

Under the hood, the dom0 plugins calls out to rasterbar's libtorrent via
Python bindings in order perform the initial download as well as the
seeding thereafter.

Implements BP xenserver-bittorrent-images

Change-Id: I824720a6e3a37317080a22cd7405d2a88172c3ef
2012-10-03 21:29:46 +00:00
Matt Odden ef61126ddc powervm: exception handling improvements
PowerVMLPARInstanceNotFound should extend InstanceNotFound so nova
can handle it as an InstanceNotFound when LPARs are missing
Small bug fix so cleanup failing due to LPARs not existing does
not cause the delete to fail out, since we had nothing to cleanup

fixes bug #1061173

Change-Id: I3b26a477e55b4627f401dbb25c66d5e84ab1fa3f
2012-10-03 19:20:11 +00:00
Jenkins 1d4506c16a Merge "Compare lists in api samples against all matches" 2012-10-03 10:53:14 +00:00
Boris Filippov c96c4df3e6 Create util for root device path retrieval
blueprint snapshots-for-everyone

Create libvirt.utils.find_disk(virt_dom) function.
This function will retrieve disk path from instance configuration.
Will return path both for file and device backed instance root devices.
Will throw error in case, when device can't be found.

Change-Id: I612a19221c6ff78079ab53a8d77295c555514c77
2012-10-03 03:59:26 +04:00
Jenkins 3cb3db034d Merge "Remove dependency on python-ldap for tests" 2012-10-02 23:56:23 +00:00
Vishvananda Ishaya 8ca9ba946e Remove dependency on python-ldap for tests
We have a fake ldap implementation for testing, but the tests still
fail if ldap isn't installed. This modifies the usage of ldap in
the LdapDNS tests to stub the module before attempting to import
it. This allows us to test without having python-ldap installed.

It removes the unneccessary FakeLdapDNS in favor of using the real
LdapDNS with the module stubbed out. It also removes the dependency
on python-ldap from test-requires.

Change-Id: Ifbe09e16436afa6999dcb7385763492b0026556c
2012-10-02 16:01:49 -07:00
Mauro S. M. Rodrigues 103ba15161 Add api samples to Certificates extension
Change-Id: Ifb61c9cd90f03225c27b5683e5f54f30c636994c
2012-10-02 15:01:10 -07:00
Vishvananda Ishaya 82e5e16662 Add nova-cert service to integrated_helpers
This allows us to do integration tests that need to use nova-cert.
Note that creating a certs for every test seems a bit excessive,
so this adds a fake_crypto module to return fake values.

Change-Id: Ia92c1dde8b122aef096004e9aad0a14ee587bbf0
2012-10-02 15:01:10 -07:00
Jenkins 6c20ffc91c Merge "Remove deprecated Folsom code: bandwith_poll_interval" 2012-10-02 21:27:18 +00:00
Vishvananda Ishaya cb6291add6 Compare lists in api samples against all matches
Lists of dictionaries don't always sort the same way, so rather
than attempting to sort them, just compare each item in the list
against all other copies looking for a match.

This change uncovered a bug in one of the api samples test where
an extra item in the template was being ignored.

Change-Id: I8750560a1760de7f1991563788680b2dac445aaa
2012-10-02 14:03:56 -07:00
John Herndon 10d503b27b ip_protocol for ec2 security groups
fix for bug 1057196.
-Enforce restrictions on IP protocol in AuthorizeSecurityGroupIngress call.
 This value may only be: 'tcp', 'udp', 'icmp', '6', '17' or '1'
-Ensure that ip protocol returned from DescribeSecurityGroups is in lower case,
 in case security group was set improperly in previous versions
-Update EC2APIError in nova/exception.py to remove the HTTP error code from the
 message. The HTTP error code is inserted in nova.api.ec2.faults.Fault. Inserting
 the code in the EC2APIError causes the HTTP code to appear twice in the message
-Update unit tests to expect new error message when invalid protocol is entered.
-Fixing pep8 issues

Change-Id: Iffe0f38abde327288e6a3960a72ad6a273f78aca
2012-10-02 19:54:45 +00:00
Joe Gordon 492116d0f4 Remove deprecated Folsom code: config convert
Removes config file converter: nova-manage config convert

Change-Id: I146bff9ac00a4885e7054f999ae52159da3f86ef
2012-10-02 10:57:31 -07:00
Johannes Erdfelt 6bc8c20be7 Make resource tracker uses faster DB query
Fixes bug 1060363

db.instance_get_all_by_filters() uses a regex when filtering on host,
which will do a full table scan. A regex isn't needed and instead,
db.instance_get_all_by_host() can be used which does not impact the
performance so much.

Change-Id: I812e1d5320763e5c65232351e1e21285e04e6a4b
2012-10-02 17:55:00 +00:00
Joe Gordon a6762f2b67 Remove deprecated Folsom code: bandwith_poll_interval
Remove bandwidth_poll_interval's deprecated name: bandwith_poll_interval

Change-Id: I7015b306994096610aaaffc03ae5246ae160cbc3
2012-10-02 10:53:03 -07:00
Johannes Erdfelt 0291266fb6 Add TestCase.stub_module to make stubbing modules easier
Previously various test cases would modify sys.modules directly,
duplicating code unnecessarily.

Change-Id: I09d333d6daf527e34db0262b28edcb0323cb2855
2012-10-02 14:17:29 +00:00
Jenkins 9e47250314 Merge "Fix booting a raw image on XenServer" 2012-10-02 10:25:07 +00:00
Jenkins d4e907509e Merge "Add aggregates extension to API samples test." 2012-10-02 09:50:39 +00:00
OpenStack Jenkins 496cb35beb Merge "Imported Translations from Transifex" 2012-10-02 09:48:03 +00:00
Jenkins 659d4d5175 Merge "remove deprecated connection_type flag" 2012-10-02 01:16:08 +00:00
OpenStack Jenkins e100cb19f5 Imported Translations from Transifex
Change-Id: I7d4e3134917f274fa7385115b7dc4ba4f92f36b8
2012-10-02 00:03:57 +00:00
Joe Gordon 771458f724 Remove outdated moduleauthor tags
The moduelauthor tags are used by the docs to see who wrote what.
But many of them are outdated and wrong.

fixes bug 1044578

Change-Id: I9cc27430c906d1418faf28e1b53f6306c62e8f98
2012-10-01 15:25:47 -07:00
Jenkins d399c75568 Merge "xenapi: Removing legacy swap-in-image." 2012-10-01 21:56:20 +00:00
Jenkins 14cfc19381 Merge "Catch NotFound exception in FloatingIP add/remove" 2012-10-01 21:54:35 +00:00
Jenkins 8a332ea285 Merge "Remove TestCase.assertNotRaises" 2012-10-01 20:40:03 +00:00
Sean Dague 625996722f remove deprecated connection_type flag
Fixes bug #1025712

connection_type was deprecated in Folsom and should now
be removed in Grizzly as early as possible to shake out
any fallout. This removes all references to it, changes
the config sample and tests appropriately.

Remove old default fixtures for flavors that specify
ephemeral disks if the connection_type flag was set to
'libvirt'

Change-Id: I8af831600a1931ae92c6d06c5105bd1bd81debe3
2012-10-01 15:14:39 -04:00
Matthew Treinish ce2ba8fae8 Add aggregates extension to API samples test.
Change-Id: I8f0f5b022795dc1d766e585cab8fe5f8445a3722
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
2012-10-01 14:51:04 -04:00