summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeodor Tersin <ftersin@hotmail.com>2016-12-28 18:03:00 +0300
committerFeodor Tersin <ftersin@hotmail.com>2017-01-19 15:03:26 +0000
commit092cc7d494433226bab999965e595f82ec2e9352 (patch)
treee61f8e1a0e43f7dabeefeb8ddaa56e19a63042f5
parent66bdf406e26b490ce7578b6f48074471cf314e97 (diff)
Switch to Nova v2.32 API2.0.1
At v2.33 new bdm field 'tag' was introduced. This field is automatically created by snapshot operation for volume backed instance (ebs). The result of the operation - bdm - is stored in metadata of the snapshot image. When ec2api user requires to run an instance with this image changing some attributes of the attached volume (e.g. delete_on_termination), this bdm is merged with user defined parameters and sent to Nova. As the result the new 'tag' field is sent to Nova since v2.32. However the used API version is v2.10, which does not support 'tag' field. This did not lead to faults (until I56348dc2) because Nova verified the first bdm only, but the first bdm for ebs instances was a bdm for the image. With the noted fix this no more works. This patch swithes ec2api to use v2.32 to get 'tag' field supported. Change-Id: I68329bbffeeff5d460f3fca1a212ba20b35fc284 (cherry picked from commit 480dc02de0d8413aa518a23b22a0140013df1350) (cherry picked from commit 4deceadc272b212003bc9cee8161a82757c6ef64)
Notes
Notes (review): Code-Review+2: Andrey Pavlov <andrey.mp@gmail.com> Workflow+1: Andrey Pavlov <andrey.mp@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 23 Jan 2017 08:42:20 +0000 Reviewed-on: https://review.openstack.org/419961 Project: openstack/ec2-api Branch: refs/heads/stable/mitaka
-rw-r--r--ec2api/clients.py5
-rw-r--r--ec2api/tests/unit/test_clients.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/ec2api/clients.py b/ec2api/clients.py
index 6373f0d..dd98fa8 100644
--- a/ec2api/clients.py
+++ b/ec2api/clients.py
@@ -68,7 +68,10 @@ LEGACY_NOVA_API_VERSION = '2'
68# properties 68# properties
69# Nova API's 2.10 microversion provides admin access to users keypairs, 69# Nova API's 2.10 microversion provides admin access to users keypairs,
70# which allows metadata service to expose openssh part of an instance key 70# which allows metadata service to expose openssh part of an instance key
71REQUIRED_NOVA_API_MICROVERSION = '2.10' 71# Nova API's 2.32 microversion allows 'tag' field of bdm v2, which may be
72# contained in image bdms, defined by users or autocreated with instance
73# snapshot
74REQUIRED_NOVA_API_MICROVERSION = '2.32'
72_nova_api_version = None 75_nova_api_version = None
73 76
74 77
diff --git a/ec2api/tests/unit/test_clients.py b/ec2api/tests/unit/test_clients.py
index ca7c428..82265c7 100644
--- a/ec2api/tests/unit/test_clients.py
+++ b/ec2api/tests/unit/test_clients.py
@@ -54,7 +54,7 @@ class ClientsTestCase(base.BaseTestCase):
54 links=[{'href': 'http://host:port/path/v2/'}]) 54 links=[{'href': 'http://host:port/path/v2/'}])
55 v2_1 = mock.NonCallableMock() 55 v2_1 = mock.NonCallableMock()
56 v2_1.configure_mock(id='v2.1', 56 v2_1.configure_mock(id='v2.1',
57 version='2.11', 57 version='2.40',
58 links=[{'href': 'http://host:port/path/v2.1/'}]) 58 links=[{'href': 'http://host:port/path/v2.1/'}])
59 59
60 # test normal flow 60 # test normal flow