Eventually, we should stop supporting X_USER because it is *supposed* to
be the user's login name rather than their id. But this change preserves
the old behavior for stability.
For more info checkout keystone/middleware/auth_token.py in the keystone
project.
Note: this commit just moves the existing code in Nova with no other
changes. A subsequent commit will sync it with latest openstack-common
so that it is easier see the new changes.
Ziad Sawalha [Tue, 24 Jan 2012 19:03:32 +0000 (13:03 -0600)]
Use Keystone Extension Syntax for EC2 Creds
- Syntax is OS-KSEC2:ec2Credentials (not ec2Credentials)
- adds to fix for bug 917408
- Syntax also requires a call to /tokens instead of /ec2tokens
- Changes are compatible (old syntax supported)
- Warning will be issued to log if URL syntax is old
Maru Newby [Thu, 2 Feb 2012 20:52:10 +0000 (12:52 -0800)]
Raise ApiError in response to InstanceTypeNotFound
* Updates methods in nova.compute.instance_types to catch
InstanceTypeNotFound exceptions and re-raise them as ApiError.
- Previously, the methods in instance_types were raising ApiError in
response to DBError, but the underlying db calls have since been
updated to detect empty results and throw more specific exceptions.
* Updates get_instance_type_by_flavor_id to not try to catch DBError,
as the underlying db call only ever raises FlavorNotFound.
get_instance_type_by_flavor_id should not raise ApiError, as callers
expect the FlavorNotFound exception and know how to handle it.
* Fixes bug 872618
Michael Still [Mon, 9 Jan 2012 07:21:57 +0000 (18:21 +1100)]
blueprint nova-image-cache-management phase1
Phase 1 of the image-cache-management blueprint. Implement
checksumming and verification of base images, as well as
removal of base images which are not in use. Removal is
enabled with a flag.
* Makes virtual interfaces get the instance and pass it to network.api
* Sends the id from the instance when looking up vifs
* Repairs the tests
* Fixes bug 925682
File locks in nova have a bad habit of lingering if the process that
created them is killed, and there isn't a good automated way to fix this
behavior. This option allows a deployer to avoid the problem if they
know they are only running a single nova process on a machine.
Pádraig Brady [Thu, 2 Feb 2012 14:56:54 +0000 (14:56 +0000)]
fix stale libvirt images on download failure. Bug 801412
If we've just truncated/created the file to receive
the download, but the download fails, then delete the file.
Otherwise subsequent downloads would not be attempted.
Soren Hansen [Wed, 1 Feb 2012 17:10:39 +0000 (18:10 +0100)]
Remove Hyper-V support
HyperV has been unmaintained for several releases now. The unit tests
are superficial, we have no way to test it, noone has stepped forward
to maintain it, and for a very long time, we've not had any reports that
it works. Furthermore, many improvements have been made across other
hypervisor drivers that have not been done in the HyperV driver, so even
if it worked, it would only expose a subset of the functionality that
the other drivers do.
Trey Morris [Mon, 9 Jan 2012 17:52:53 +0000 (11:52 -0600)]
Ties quantum, melange, and nova network model
get_instance_nw_info() now returns network model, and keeps the network
info cache up to date.
virt shim and translation in place for virts to get at the old stuff
Make sure multiple calls to _get_session() aren't nested
Fixes bug 924918
async_call_plugin() acquires a xenapi session as does the nested call to
get_xenapi_host(). This can cause a deadlock if multiple greenthreads
all block waiting for the outer sessions to be freed to allocate the
inner session. This change moves the call to get_xenapi_host() to outside
the with statement to ensure calls to _get_session() aren't nested.
bug 921087: i18n-key and local-storage hard-coded in xenapi
This fix introduces a new flag 'sr_matching_filter', whose default value is
'other-config:i18n-key=local-storage'. This filter is used for finding the
SR on which to install guest instances. The default value is the Local
Storage in default XenServer/XCP installations, and it is what was hard-coded
so far.
To select an SR with a different matching criteria, this flag can be set
to 'other-config:my_favorite_sr=true'. On the other hand, to fall back on
the Default SR, as displayed by XenCenter and as returned by
xenapi.pool.get_default_SR, this flag can be set to to 'default-sr:true'.
This changeset also makes a small code simplification along the way.
Pádraig Brady [Tue, 31 Jan 2012 23:46:42 +0000 (23:46 +0000)]
optimize libvirt raw image handling. Bug 924970
Tests were seen to time-out on libvirt when raw images were
used, which was due to large disk images being copied around
inefficiently. A system with standard disks was seen to take
an extra 60s/10G which was a problem with large root and
ephemeral disks. The changes below attempt to minimize the
I/O in dealing with cached raw images. These changes should
also help to minimize the disk space used for such images,
by avoiding the naïve copy which undoes the sparseness.
* nova/virt/libvirt/connection.py (_cache_image): Do the
resize here, rather than in _fetch_image(), so that we
can control when the resizing is done, to minimize the
amount of data that needs to be copied. Also if we're
generating rather than fetching the image, then just
generate in the instance dir too, as this should be faster.
* nova/tests/fake_libvirt_utils.py: Remove the resize
functionality since it's no longer used.
* nova/tests/test_libvirt.py: Likewise.
* nova/virt/libvirt/utils.py (fetch_image): Likewise.
(copy_image): Shell out to cp since it deals better
with sparse files. Note the above changes avoid sparse
copies, so this is just an ancillary improvement in the area.