- bump version from 2 to 3 for cinderclient
- update aws ec2 interface for create_colume and
create_network_interface. add cilent_token param
- fix describe network interface - something was
changed in neutron ports output
- set metadata port for OVN conf file also
Change-Id: Ie3e5a5930d5a8159050ecc0900239935558dddd7
This change allows for the EC2 API call to RegisterImage to support
external URLS provided for the "ImageLocation" parameter:
https://docs.aws.amazon.com/cli/latest/reference/ec2/register-image.html
It enforces that all standards defined there are adhered to
This changes affects RegisterImage from S3 Bucket, requiring
that the "ImageLocation" for it begin with an "s3://" (case-insensitive).
Change-Id: I2a5e93de68b1a654418781fc77369d91dd17dd48
Signed-off-by: Tyler Parcell <Parcell.Tyler@gmail.com>
The commit I34b12b96de3ea21beaf935ed8a9f6bae2fe0d0bc and
Ib384ae8130dcc6cbd47a837d11ca171ce02ef29e introduced the
deprecated oslo_utils.timeutils.isotime() is deprecated
as of 1.6.
The deprecation message says to use the datetime.datetime.isoformat()
instead, but the format of the string generated by isoformat isn't
the same as the format of the string generated by isotime. The string
is used in tokens and other public APIs and we can't change it
without potentially breaking clients.
So the workaround is to copy the current implementation from
oslo_utils.timeutils.isotime() to ec2api.api.ec2utils.
For more informations:
https://docs.openstack.org/oslo.utils/latest/reference/timeutils.html
Change-Id: Id62fb53264b04a7ea6ae3035a129353c5cfa040a
Closes-Bug: #1461251
replacement of functions performed earlier with nova-cert service
function decrypt_text copied from novaclient to image api
certificates in devstack for uploading image to s3 are created by openssl
Change-Id: Ibf7b90ea29085656005317c4aa0fd96f3313da0c
The i18n team has decided not to translate the logs because it seems
like it not very useful; operators prefer to have them in English so
that they can search for those strings on the internet.
See http://lists.openstack.org/pipermail/openstack-dev/2017-March/thread.html#113365.
Change-Id: I4418a388934ef58acb70c7f637b0236a6ccc7fe6
Closes-Bug: #1682101
current devstack deploys glance version '2' only.
use it.
messages in keystone's exceptions was changed.
fix unit tests that checks it.
Change-Id: I7ed1f0ff518efa374a5e3b693c5785958c77340d
Remove the Oslo Incubator code for timeutils in favor for the
oslo.utils functionality.
Change-Id: Idb7917b80add6aa0f492e6974b630c3a8ffce71f
Depends-On: Ieff34b88d857727e02a3918908b2719535ff4b55
This change introduces ec2api.openstack.common.timeutils that
substitutes the deprecating functions from oslo_utils. Using the
isoformat in the datetime lib will change the time format in API.
So it is better to carry this function in ec2-api. The deprecation
happens in this commit.
https://review.openstack.org/#/c/252898/
Change-Id: Id3606e7ca73ab3e7d58cfe6131984dbf0f3b7e4d
1) fix bug with filtering
filters were applied before unpaired items is added to result
2) fix races in default security group creation
3) add waiter for associate/disassociate address
4) fix security group classic test
it should choose default group group only from classic groups
5) fix describe_vpc_with_filters test
it can run in parallel with other test with same CIDR
6) fix networks list for instance run at subnet creation/deletion
7) fix selective decsribe by names
it should not delete valid items from db
Change-Id: Iadadefb8b4abebbb3b8efc0e536e5de30ed23dab
Creating of an image by a running instance stops the instance. This
takes a time, and a client can resend the request due to timeout. The
resended request fails because instance is already not in appropriate
state (it's stoping, stopped, or scheduling at the moment).
Thus ec2api should make such images asynchronously. It should create a
DB item to reserve the image id, return it to a caller, and then stop
the instance and do other things. While image is asynchronously created
and no Glance image exists, ec2api should return the image in responses
for describe operation. Describe operation should return the image with
and without selective filter by the image id passed in.
Also it should consider a race when asynchronous task has not finished,
but Glance image is already created, and another client describe images.
In that case ec2api should not create a new db item, but reuse existed
one.
If the creation failed, ec2api should expose the image as failed and
allow to delete it.
Unit tests for auto_update_db and handle_unpaired_item will be added in
a separate review, because some refactoring is required for that.
Change-Id: Iba4ade5000bea4af35d97abd1e708bbbc57f372a
Glance image statuses are not compatible with AWS EC2. Now they will be
translated to appropriated EC2 states.
Also following to Nova EC2, ec2api uses internal states to indicate
progress of image registration. These states must be translated to valid
EC2 states, but this had been forgotten when image operations was ported
to ec2api.
Change-Id: I3e4bdaa84e654ffe6f7a8ed0b1e461f161829d90
If a volume size is not provided to register_image, ec2api should anyway
store it in image bdm. Otherwise it will not be exposed in describe
image operation.
Change-Id: Ibf14ffabe77f8426fc9f35e557d1dfa34082fef1
In according to initial DB API contract, a user can not modify db items
of other project. Shortly before 0.1.0 release this had been broken due
to a critical bugfix.
This patch makes images to avoid creating of db item in other project.
It uses db mapping instead.
Change-Id: I07119b7e1348bbe63e5c736dad4141daa2a07fb9
Currently if an image has not even been described, but a user gets its
id (from describe instance results for example), describe image with
selective filter operation will fail with InvalidAMIIDNotFound
exception.
The reason is that the mapping db object (id-os_id pair) is created, but
has no project_id set. Project_id was unknown when the mapping was being
created. So both requests to db by current project and for public
objects do not get this mapping.
Change-Id: I80dacdf4d3d7c317c3e96a6f0d45923e41cc5a40
Don not specify project_id for the calls, because it can differs of the
processed image project_id.
Change-Id: I0b149d6dc1ace4f93012e392a9a41a167bd95eb8
Currently this function set default values for certain bdm attributes,
such as delete_on_termination, or boot_index. Also it returns mappings
wich is not fully bdm v2 compatible. This prevents to use it for wide
range of purposes.
This patch make the function to return fully bdm v2 compatible mapping
with only passed (and unambiguously calculated) attributes are set.
Change-Id: I4a5ec244cc1d41855128090127a3b0fa266891c0
Currently image describe operation doesn't support some bdm v2 related
features of block device mappings. Like virtual (ephemeral and swap)
devices in block_device_mapping property, image source for a volume and
so on.
This patch uses previously introduced get_os_image_mappings to get a
list of image mappings in bdm v2 format and formats it.
Also rootDeviceType image attribute is always placed to the image.
deleteOnTermination attribute is always displayed as well.
Change-Id: Ie96b0dbf69926ff54b2581ad5cb6fe2636af2717
- public ami images in DB had incorrect project id
- public aki,ari images had incorrect project id
Change-Id: I752d0f98fed150cfa7c5de792d50b091e00afae1
fix register_image function -
code can access outer variable but "set operation" will create
a new name in the current scope, which cover the outer one.
Change-Id: Ica2750fbf05e0d3c68ed199996afd8c6e7662229
merged from Ifb5cb05b9cc2b8758d5a8e34f7792470a73d7c40
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
The dictionary constructor approach has two distinct disadvantages
from the proposed syntax though. First, it isn't as legible as a
dict comprehension. Second, it forces the programmer to create an
in-core list object first, which could be expensive.
Nova dropped python 2.6 support, we can leverage this now.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.
[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/154798/
Change-Id: I1bc53e335b6c291da5c54f067f9fdfd5da6b2902
EC2 describe images crashes on volume backed instance snapshot which has
several volumes.
merged from Ibe278688b118db01c9c3ae1763954adf19c7ee0d
related bug #1370265
Change-Id: I538bc2cf1a2093bc8055350d01ce406505776db5
Copy S3 server implmenetation and unit tests from Nova.
Add fileutils from oslo-incubator and refresh incubation modules.
Upgrade script doesn't copy buckets content because Nova S3 server
is not intended to be permanent full functionality object storage, but
has to be used temporary to CreateImage operation only.
Change-Id: I7d38b0a8e014dfff8238e7134d837d1074e4dd95
An image registration by s3 manifest is performed in a separate thread.
So occured errors are not reported to user.
Original Nova EC2 code contains error logging for such thread. Now we've
copied it.
Change-Id: I12bace1b64031900e9f8e2d27d12e3f3e240ae7d
Originally (in Nova) this function was intendend to get context to get
full access to DB, i.e. to read previously deleted data (with deleted
field is on) or across tenant data access.
Since ec2api database has no ability to hide data instead of delete it,
and API requests for other tenant data are managed by special DB API
methods, we don't need such context elevation.
Change-Id: I16ce6f973872a320858d27d87ed8928958169b3f