Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core modifications for future zones service.
Makes compute/network/volume API classes pluggable Splits some code out in compute/api Adds some race condition checking on deletes in compute/api Make instance_delete support UUIDs Add support to RPC to cast to specific servers Migrations for future zones Change-Id: Ibee126cd6d325e11770f27589e79dfd0e6104b99
- Loading branch information
Showing
18 changed files
with
429 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
nova/db/sqlalchemy/migrate_repo/versions/078_add_rpc_info_to_zones.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2012 OpenStack LLC. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from sqlalchemy import * | ||
|
||
meta = MetaData() | ||
|
||
zones = Table('zones', meta, | ||
Column('id', Integer(), primary_key=True, nullable=False), | ||
) | ||
|
||
is_parent = Column('is_parent', Boolean(), default=False) | ||
rpc_host = Column('rpc_host', String(255)) | ||
rpc_port = Column('rpc_port', Integer()) | ||
rpc_virtual_host = Column('rpc_virtual_host', String(255)) | ||
|
||
|
||
def upgrade(migrate_engine): | ||
meta.bind = migrate_engine | ||
|
||
zones.create_column(is_parent) | ||
zones.create_column(rpc_host) | ||
zones.create_column(rpc_port) | ||
zones.create_column(rpc_virtual_host) | ||
|
||
|
||
def downgrade(migrate_engine): | ||
meta.bind = migrate_engine | ||
|
||
zones.drop_column(rpc_virtual_host) | ||
zones.drop_column(rpc_port) | ||
zones.drop_column(rpc_host) | ||
zones.drop_column(is_parent) |
35 changes: 35 additions & 0 deletions
35
nova/db/sqlalchemy/migrate_repo/versions/078_sqlite_downgrade.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
BEGIN TRANSACTION; | ||
|
||
CREATE TEMPORARY TABLE zones_temp ( | ||
created_at DATETIME, | ||
updated_at DATETIME, | ||
deleted_at DATETIME, | ||
deleted BOOLEAN, | ||
id INTEGER NOT NULL, | ||
name VARCHAR(255), | ||
api_url VARVHAR(255), | ||
username VARCHAR(255), | ||
password VARCHAR(255), | ||
weight_offset FLOAT, | ||
weight_scale FLOAT, | ||
PRIMARY KEY (id), | ||
CHECK (deleted IN (0, 1)) | ||
); | ||
|
||
INSERT INTO zones_temp | ||
SELECT created_at, | ||
updated_at, | ||
deleted_at, | ||
deleted, | ||
id, | ||
name, | ||
api_url, | ||
username, | ||
password, | ||
weight_offset, | ||
weight_scale FROM zones; | ||
|
||
DROP TABLE zones; | ||
|
||
ALTER TABLE zones_temp RENAME TO zones; | ||
COMMIT; |
31 changes: 31 additions & 0 deletions
31
nova/db/sqlalchemy/migrate_repo/versions/079_add_zone_name_to_instances.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2012 OpenStack LLC. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from sqlalchemy import * | ||
|
||
meta = MetaData() | ||
|
||
|
||
def upgrade(migrate_engine): | ||
meta.bind = migrate_engine | ||
instances = Table('instances', meta, autoload=True) | ||
zone_name = Column('zone_name', String(255)) | ||
instances.create_column(zone_name) | ||
|
||
|
||
def downgrade(migrate_engine): | ||
meta.bind = migrate_engine | ||
instances = Table('instances', meta, autoload=True) | ||
zone_name = Column('zone_name', String(255)) | ||
instances.drop_column(zone_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.