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
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
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
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>
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
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
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
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
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
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
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
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
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
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
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
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
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