From f5952ef6858bfa62b3a6512b04e61d08d61faaf5 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 23 Apr 2012 11:37:34 +0100 Subject: [PATCH] Adding ovs_tunnel_interface to schema; adding new tables to update script (3.0.2 to 3.0.3) --- setup/db/create-schema.sql | 15 ++++++++++++++- setup/db/db/schema-2214to30.sql | 1 - setup/db/db/schema-302to303.sql | 21 +++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index afcd8cc388d..2570b9d77c5 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -114,7 +114,8 @@ DROP TABLE IF EXISTS `cloud`.`op_nwgrp_work`; DROP TABLE IF EXISTS `cloud`.`op_vm_ruleset_log`; DROP TABLE IF EXISTS `cloud`.`ovs_host_vlan_alloc`; DROP TABLE IF EXISTS `cloud`.`ovs_tunnel`; -DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_account`; +DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_network`; +DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_interface`; DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_alloc`; DROP TABLE IF EXISTS `cloud`.`ovs_vlan_mapping_dirty`; DROP TABLE IF EXISTS `cloud`.`ovs_vm_flow_log`; @@ -1751,6 +1752,18 @@ CREATE TABLE `cloud`.`ovs_tunnel`( PRIMARY KEY(`from`, `to`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `cloud`.`ovs_tunnel_interface` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `ip` varchar(16) DEFAULT NULL, + `netmask` varchar(16) DEFAULT NULL, + `mac` varchar(18) DEFAULT NULL, + `host_id` bigint DEFAULT NULL, + `label` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `cloud`.`ovs_tunnel_interface` (`ip`, `netmask`, `mac`, `host_id`, `label`) VALUES ('0', '0', '0', 0, 'lock'); + CREATE TABLE `cloud`.`ovs_tunnel_network`( `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, `from` bigint unsigned COMMENT 'from host id', diff --git a/setup/db/db/schema-2214to30.sql b/setup/db/db/schema-2214to30.sql index a4e3bbc012d..9abd329d49e 100755 --- a/setup/db/db/schema-2214to30.sql +++ b/setup/db/db/schema-2214to30.sql @@ -742,4 +742,3 @@ UPDATE `cloud`.`networks` n SET n.display_text=(CONCAT('guestNetworkForBasicZon UPDATE `cloud`.`configuration` SET description='Bypass internal dns, use exetrnal dns1 and dns2' WHERE name='use.external.dns'; UPDATE `cloud`.`configuration` SET category='Alert' WHERE name='capacity.check.period'; - diff --git a/setup/db/db/schema-302to303.sql b/setup/db/db/schema-302to303.sql index c0aedf581fc..72d40e977b9 100755 --- a/setup/db/db/schema-302to303.sql +++ b/setup/db/db/schema-302to303.sql @@ -53,4 +53,25 @@ CREATE TABLE `cloud`.`volume_host_ref` ( ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; INSERT IGNORE INTO `cloud`.`disk_offering` (name, display_text, customized, unique_name, disk_size, system_use) VALUES ( "Custom", "Custom Disk", 1, "Cloud.com-Custom", 0, 1); +# Changes for OVS tunnel manager +CREATE TABLE `cloud`.`ovs_tunnel_interface` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `ip` varchar(16) DEFAULT NULL, + `netmask` varchar(16) DEFAULT NULL, + `mac` varchar(18) DEFAULT NULL, + `host_id` bigint(20) DEFAULT NULL, + `label` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`ovs_tunnel_network`( + `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, + `from` bigint unsigned COMMENT 'from host id', + `to` bigint unsigned COMMENT 'to host id', + `network_id` bigint unsigned COMMENT 'network identifier', + `key` int unsigned COMMENT 'gre key', + `port_name` varchar(32) COMMENT 'in port on open vswitch', + `state` varchar(16) default 'FAILED' COMMENT 'result of tunnel creatation', + PRIMARY KEY(`from`, `to`, `network_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;