OpenStack Compute (Nova)

Merge lp:~termie/nova/austin_migration into lp:~hudson-openstack/nova/trunk

Proposed by termie on 2011-01-31
Status: Merged
Approved by: Soren Hansen on 2011-01-31
Approved revision: 639
Merged at revision: 640
Proposed branch: lp:~termie/nova/austin_migration
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 131 lines (+35/-24) 3 files modified
To merge this branch: bzr merge lp:~termie/nova/austin_migration
Reviewer Review Type Date Requested Status
Thierry Carrez (community) gfe Approve on 2011-01-31
Vish Ishaya (community) Approve on 2011-01-31
Jay Pipes (community) Approve on 2011-01-31
Devin Carlen (community) 2011-01-31 Approve on 2011-01-31
Review via email: mp+47952@code.launchpad.net

Description of the Change

Match the initial db version to the actual Austin release db schema.

Fixes: https://bugs.launchpad.net/nova/+bug/709183

Tested by copying nova/tests/db/nova.austin.sqlite to ./nova.sqlite and running ./bin/nova-manage db sync

To post a comment you must log in.
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Jay Pipes (jaypipes) wrote :

yup, nice work.

review: Approve
Vish Ishaya (vishvananda) wrote :

lgtm. This officially needs an exception. IMO this is a required feature. I don't know of anyone actually using austin in production, but I still feel it is imperative that we provide a working upgrade path.

review: Approve
Thierry Carrez (ttx) wrote :

Agreed, we need that one in.

review: Approve (gfe)
OpenStack Infra (hudson-openstack) wrote :

The person who submitted this branch (termie) does not appear in http://wiki.openstack.org/Contributors?action=raw

OpenStack Infra (hudson-openstack) wrote :

The person who submitted this branch (termie) does not appear in http://wiki.openstack.org/Contributors?action=raw

Preview Diff

1=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/001_austin.py'
2--- nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-01-18 23:59:02 +0000
3+++ nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-01-31 01:16:21 +0000
4@@ -134,6 +134,9 @@
5 Column('ramdisk_id',
6 String(length=255, convert_unicode=False, assert_unicode=None,
7 unicode_error=None, _warn_on_bytestring=False)),
8+ Column('server_name',
9+ String(length=255, convert_unicode=False, assert_unicode=None,
10+ unicode_error=None, _warn_on_bytestring=False)),
11 Column('launch_index', Integer()),
12 Column('key_name',
13 String(length=255, convert_unicode=False, assert_unicode=None,
14@@ -178,23 +181,6 @@
15 )
16
17
18-iscsi_targets = Table('iscsi_targets', meta,
19- Column('created_at', DateTime(timezone=False)),
20- Column('updated_at', DateTime(timezone=False)),
21- Column('deleted_at', DateTime(timezone=False)),
22- Column('deleted', Boolean(create_constraint=True, name=None)),
23- Column('id', Integer(), primary_key=True, nullable=False),
24- Column('target_num', Integer()),
25- Column('host',
26- String(length=255, convert_unicode=False, assert_unicode=None,
27- unicode_error=None, _warn_on_bytestring=False)),
28- Column('volume_id',
29- Integer(),
30- ForeignKey('volumes.id'),
31- nullable=True),
32- )
33-
34-
35 key_pairs = Table('key_pairs', meta,
36 Column('created_at', DateTime(timezone=False)),
37 Column('updated_at', DateTime(timezone=False)),
38@@ -523,7 +509,7 @@
39 meta.bind = migrate_engine
40
41 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,
42- instances, iscsi_targets, key_pairs, networks,
43+ instances, key_pairs, networks,
44 projects, quotas, security_groups, security_group_inst_assoc,
45 security_group_rules, services, users,
46 user_project_association, user_project_role_association,
47@@ -539,7 +525,7 @@
48 def downgrade(migrate_engine):
49 # Operations to reverse the above upgrade go here.
50 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,
51- instances, iscsi_targets, key_pairs, networks,
52+ instances, key_pairs, networks,
53 projects, quotas, security_groups, security_group_inst_assoc,
54 security_group_rules, services, users,
55 user_project_association, user_project_role_association,
56
57=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py'
58--- nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-01-18 23:59:02 +0000
59+++ nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-01-31 01:16:21 +0000
60@@ -41,6 +41,10 @@
61 Column('id', Integer(), primary_key=True, nullable=False),
62 )
63
64+volumes = Table('volumes', meta,
65+ Column('id', Integer(), primary_key=True, nullable=False),
66+ )
67+
68
69 #
70 # New Tables
71@@ -131,6 +135,23 @@
72 )
73
74
75+iscsi_targets = Table('iscsi_targets', meta,
76+ Column('created_at', DateTime(timezone=False)),
77+ Column('updated_at', DateTime(timezone=False)),
78+ Column('deleted_at', DateTime(timezone=False)),
79+ Column('deleted', Boolean(create_constraint=True, name=None)),
80+ Column('id', Integer(), primary_key=True, nullable=False),
81+ Column('target_num', Integer()),
82+ Column('host',
83+ String(length=255, convert_unicode=False, assert_unicode=None,
84+ unicode_error=None, _warn_on_bytestring=False)),
85+ Column('volume_id',
86+ Integer(),
87+ ForeignKey('volumes.id'),
88+ nullable=True),
89+ )
90+
91+
92 #
93 # Tables to alter
94 #
95@@ -188,7 +209,8 @@
96 # Upgrade operations go here. Don't create your own engine;
97 # bind migrate_engine to your metadata
98 meta.bind = migrate_engine
99- for table in (certificates, consoles, console_pools, instance_actions):
100+ for table in (certificates, consoles, console_pools, instance_actions,
101+ iscsi_targets):
102 try:
103 table.create()
104 except Exception:
105
106=== modified file 'nova/db/sqlalchemy/migration.py'
107--- nova/db/sqlalchemy/migration.py 2011-01-13 00:57:04 +0000
108+++ nova/db/sqlalchemy/migration.py 2011-01-31 01:16:21 +0000
109@@ -46,12 +46,15 @@
110 meta.reflect(bind=engine)
111 try:
112 for table in ('auth_tokens', 'export_devices', 'fixed_ips',
113- 'floating_ips', 'instances', 'iscsi_targets',
114+ 'floating_ips', 'instances',
115 'key_pairs', 'networks', 'projects', 'quotas',
116- 'security_group_rules',
117- 'security_group_instance_association', 'services',
118+ 'security_group_instance_association',
119+ 'security_group_rules', 'security_groups',
120+ 'services',
121 'users', 'user_project_association',
122- 'user_project_role_association', 'volumes'):
123+ 'user_project_role_association',
124+ 'user_role_association',
125+ 'volumes'):
126 assert table in meta.tables
127 return db_version_control(1)
128 except AssertionError:
129
130=== added file 'nova/tests/db/nova.austin.sqlite'
131Binary files nova/tests/db/nova.austin.sqlite 1970-01-01 00:00:00 +0000 and nova/tests/db/nova.austin.sqlite 2011-01-31 01:16:21 +0000 differ