X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=database_utils%2Fmano_db_structure.sql;h=bd5df9d8149373000db70e1cf41c3732d51eb237;hb=e580c7d9d4c0f8a093597d83808f96cdab261b0c;hp=aca07aa01f635a382ec0a31ef5084e96622145c4;hpb=392f28583d8750e7e2c2c5f2341688ec5acdf824;p=osm%2FRO.git diff --git a/database_utils/mano_db_structure.sql b/database_utils/mano_db_structure.sql index aca07aa0..bd5df9d8 100644 --- a/database_utils/mano_db_structure.sql +++ b/database_utils/mano_db_structure.sql @@ -1,5 +1,5 @@ /** -* Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +* Copyright 2017 Telefónica Investigación y Desarrollo, S.A.U. * This file is part of openmano * All Rights Reserved. * @@ -19,11 +19,11 @@ * contact with: nfvlabs@tid.es **/ --- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64) +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) -- --- Host: localhost Database: mano_db +-- Host: localhost Database: {{mano_db}} -- ------------------------------------------------------ --- Server version 5.5.43-0ubuntu0.14.04.1 +-- Server version 5.7.18-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -37,14 +37,14 @@ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- --- Current Database: `mano_db` +-- Current Database: `{{mano_db}}` -- -/*!40000 DROP DATABASE IF EXISTS `mano_db`*/; +/*!40000 DROP DATABASE IF EXISTS `{{mano_db}}`*/; -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mano_db` /*!40100 DEFAULT CHARACTER SET latin1 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{{mano_db}}` /*!40100 DEFAULT CHARACTER SET latin1 */; -USE `mano_db`; +USE `{{mano_db}}`; -- -- Table structure for table `datacenter_nets` @@ -81,11 +81,12 @@ DROP TABLE IF EXISTS `datacenter_tenants`; CREATE TABLE `datacenter_tenants` ( `uuid` varchar(36) NOT NULL, `datacenter_id` varchar(36) NOT NULL COMMENT 'Datacenter of this tenant', - `vim_tenant_name` varchar(64) DEFAULT NULL, - `vim_tenant_id` varchar(36) DEFAULT NULL COMMENT 'Tenant ID at VIM', + `vim_tenant_name` varchar(256) DEFAULT NULL, + `vim_tenant_id` varchar(256) DEFAULT NULL COMMENT 'Tenant ID at VIM', `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if this tenant has been created by openmano, or it existed on VIM', `user` varchar(64) DEFAULT NULL, `passwd` varchar(64) DEFAULT NULL, + `config` varchar(4000) DEFAULT NULL, `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, PRIMARY KEY (`uuid`), @@ -129,6 +130,7 @@ CREATE TABLE `datacenters_flavors` ( `datacenter_id` varchar(36) NOT NULL, `vim_id` varchar(36) NOT NULL, `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if it has been created by openmano, or already existed', + `extended` varchar(2000) DEFAULT NULL COMMENT 'Extra description json format of additional devices', PRIMARY KEY (`id`), KEY `FK__flavors` (`flavor_id`), KEY `FK__datacenters_f` (`datacenter_id`), @@ -187,11 +189,14 @@ DROP TABLE IF EXISTS `images`; CREATE TABLE `images` ( `uuid` varchar(36) NOT NULL, `name` varchar(255) NOT NULL, - `location` varchar(200) NOT NULL, + `universal_name` varchar(255) DEFAULT NULL, + `checksum` varchar(32) DEFAULT NULL, + `location` varchar(200) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `metadata` varchar(2000) DEFAULT NULL, PRIMARY KEY (`uuid`), - UNIQUE KEY `location` (`location`) + UNIQUE KEY `location` (`location`), + UNIQUE KEY `universal_name_checksum` (`universal_name`,`checksum`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -212,6 +217,12 @@ CREATE TABLE `instance_interfaces` ( `ip_address` varchar(64) DEFAULT NULL, `vim_info` text, `type` enum('internal','external') NOT NULL COMMENT 'Indicates if this interface is external to a vnf, or internal', + `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface', + `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled', + `sdn_port_id` varchar(36) DEFAULT NULL COMMENT 'Port id in ovim', + `compute_node` varchar(100) DEFAULT NULL COMMENT 'Compute node id used to specify the SDN port mapping', + `pci` varchar(12) DEFAULT NULL COMMENT 'PCI of the physical port in the host', + `vlan` smallint(5) unsigned DEFAULT NULL COMMENT 'VLAN tag used by the port', PRIMARY KEY (`uuid`), KEY `FK_instance_vms` (`instance_vm_id`), KEY `FK_instance_nets` (`instance_net_id`), @@ -241,11 +252,11 @@ CREATE TABLE `instance_nets` ( `error_msg` varchar(1024) DEFAULT NULL, `vim_info` text, `multipoint` enum('true','false') NOT NULL DEFAULT 'true', - `external` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'If external, means that it already exists at VIM', + `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Created or already exists at VIM', `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, + `sdn_net_id` varchar(36) DEFAULT NULL COMMENT 'Network id in ovim', PRIMARY KEY (`uuid`), - UNIQUE KEY `vim_net_id_instance_scenario_id` (`vim_net_id`,`instance_scenario_id`), KEY `FK_instance_nets_instance_scenarios` (`instance_scenario_id`), KEY `FK_instance_nets_sce_nets` (`sce_net_id`), KEY `FK_instance_nets_nets` (`net_id`), @@ -276,8 +287,8 @@ CREATE TABLE `instance_scenarios` ( `description` varchar(255) DEFAULT NULL, `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, + `cloud_config` mediumtext, PRIMARY KEY (`uuid`), - UNIQUE KEY `name` (`name`), KEY `FK_scenarios_nfvo_tenants` (`tenant_id`), KEY `FK_instance_scenarios_vim_tenants` (`datacenter_tenant_id`), KEY `FK_instance_scenarios_datacenters` (`datacenter_id`), @@ -365,6 +376,9 @@ CREATE TABLE `interfaces` ( `modified_at` double DEFAULT NULL, `model` varchar(12) DEFAULT NULL, `mac` char(18) DEFAULT NULL, + `ip_address` varchar(64) DEFAULT NULL, + `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface', + `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled', PRIMARY KEY (`uuid`), UNIQUE KEY `internal_name_vm_id` (`internal_name`,`vm_id`), KEY `FK_interfaces_vms` (`vm_id`), @@ -374,6 +388,35 @@ CREATE TABLE `interfaces` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VM interfaces'; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `ip_profiles` +-- + +DROP TABLE IF EXISTS `ip_profiles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ip_profiles` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `net_id` varchar(36) DEFAULT NULL, + `sce_net_id` varchar(36) DEFAULT NULL, + `instance_net_id` varchar(36) DEFAULT NULL, + `ip_version` enum('IPv4','IPv6') NOT NULL DEFAULT 'IPv4', + `subnet_address` varchar(64) DEFAULT NULL, + `gateway_address` varchar(64) DEFAULT NULL, + `dns_address` varchar(64) DEFAULT NULL, + `dhcp_enabled` enum('true','false') NOT NULL DEFAULT 'true', + `dhcp_start_address` varchar(64) DEFAULT NULL, + `dhcp_count` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK_ipprofiles_nets` (`net_id`), + KEY `FK_ipprofiles_scenets` (`sce_net_id`), + KEY `FK_ipprofiles_instancenets` (`instance_net_id`), + CONSTRAINT `FK_ipprofiles_instancenets` FOREIGN KEY (`instance_net_id`) REFERENCES `instance_nets` (`uuid`) ON DELETE CASCADE, + CONSTRAINT `FK_ipprofiles_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE CASCADE, + CONSTRAINT `FK_ipprofiles_scenets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table containing the IP parameters of a network, either a net, a sce_net or and instance_net.'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `logs` -- @@ -445,6 +488,7 @@ CREATE TABLE `sce_interfaces` ( `sce_vnf_id` varchar(36) NOT NULL, `sce_net_id` varchar(36) DEFAULT NULL, `interface_id` varchar(36) DEFAULT NULL, + `ip_address` varchar(64) DEFAULT NULL, `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, PRIMARY KEY (`uuid`), @@ -522,8 +566,8 @@ CREATE TABLE `scenarios` ( `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, `descriptor` text COMMENT 'Original text descriptor used for create the scenario', + `cloud_config` mediumtext, PRIMARY KEY (`uuid`), - UNIQUE KEY `name` (`name`), KEY `FK_scenarios_nfvo_tenants` (`tenant_id`), CONSTRAINT `FK_scenarios_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user'; @@ -600,7 +644,8 @@ CREATE TABLE `vms` ( `vnf_id` varchar(36) NOT NULL, `flavor_id` varchar(36) NOT NULL COMMENT 'Link to flavor table', `image_id` varchar(36) NOT NULL COMMENT 'Link to image table', - `image_path` varchar(100) NOT NULL COMMENT 'Path where the image of the VM is located', + `image_path` varchar(100) DEFAULT NULL COMMENT 'Path where the image of the VM is located', + `boot_data` text, `description` varchar(255) DEFAULT NULL, `created_at` double NOT NULL, `modified_at` double DEFAULT NULL, @@ -640,7 +685,7 @@ CREATE TABLE `vnfs` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping routines for database 'mano_db' +-- Dumping routines for database '{{mano_db}}' -- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -652,17 +697,17 @@ CREATE TABLE `vnfs` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-05-13 12:23:52 +-- Dump completed on 2017-05-03 11:39:20 --- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64) +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) -- --- Host: localhost Database: mano_db +-- Host: localhost Database: {{mano_db}} -- ------------------------------------------------------ --- Server version 5.5.43-0ubuntu0.14.04.1 +-- Server version 5.7.18-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -681,7 +726,7 @@ CREATE TABLE `vnfs` ( LOCK TABLES `schema_version` WRITE; /*!40000 ALTER TABLE `schema_version` DISABLE KEYS */; -INSERT INTO `schema_version` VALUES (1,'0.1','0.2.2','insert schema_version','2015-05-08'),(2,'0.2','0.2.5','new tables images,flavors','2015-07-13'),(3,'0.3','0.3.3','alter vim_tenant tables','2015-07-28'),(4,'0.4','0.3.5','enlarge graph field at sce_vnfs/nets','2015-10-20'),(5,'0.5','0.4.1','Add mac address for bridge interfaces','2015-12-14'),(6,'0.6','0.4.2','Adding VIM status info','2015-12-22'),(7,'0.7','0.4.3','Changing created_at time at database','2016-01-25'),(8,'0.8','0.4.32','Enlarging name at database','2016-02-01'),(9,'0.9','0.4.33','Add ACTIVE:NoMgmtIP to instance_vms table','2016-02-05'),(10,'0.10','0.4.36','tenant management of vnfs,scenarios','2016-03-08'); +INSERT INTO `schema_version` VALUES (1,'0.1','0.2.2','insert schema_version','2015-05-08'),(2,'0.2','0.2.5','new tables images,flavors','2015-07-13'),(3,'0.3','0.3.3','alter vim_tenant tables','2015-07-28'),(4,'0.4','0.3.5','enlarge graph field at sce_vnfs/nets','2015-10-20'),(5,'0.5','0.4.1','Add mac address for bridge interfaces','2015-12-14'),(6,'0.6','0.4.2','Adding VIM status info','2015-12-22'),(7,'0.7','0.4.3','Changing created_at time at database','2016-01-25'),(8,'0.8','0.4.32','Enlarging name at database','2016-02-01'),(9,'0.9','0.4.33','Add ACTIVE:NoMgmtIP to instance_vms table','2016-02-05'),(10,'0.10','0.4.36','tenant management of vnfs,scenarios','2016-03-08'),(11,'0.11','0.4.43','remove unique name at scenarios,instance_scenarios','2016-07-18'),(12,'0.12','0.4.46','create ip_profiles table, with foreign keys to all nets tables, and add ip_address column to interfaces and sce_interfaces','2016-08-29'),(13,'0.13','0.4.47','insert cloud-config at scenarios,instance_scenarios','2016-08-30'),(14,'0.14','0.4.57','remove unique index vim_net_id, instance_scenario_id','2016-09-26'),(15,'0.15','0.4.59','add columns universal_name and checksum at table images, add unique index universal_name_checksum, and change location to allow NULL; change column image_path in table vms to allow NULL','2016-09-27'),(16,'0.16','0.5.2','enlarge vim_tenant_name and id. New config at datacenter_tenants','2016-10-11'),(17,'0.17','0.5.3','Extra description json format of additional devices in datacenter_flavors','2016-12-20'),(18,'0.18','0.5.4','Add columns \'floating_ip\' and \'port_security\' at tables \'interfaces\' and \'instance_interfaces\'','2017-01-09'),(19,'0.19','0.5.5','Extra Boot-data content at VNFC (vms)','2017-01-11'),(20,'0.20','0.5.9','Added columns to store dataplane connectivity info','2017-03-13'); /*!40000 ALTER TABLE `schema_version` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -694,4 +739,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-05-13 12:23:52 +-- Dump completed on 2017-05-03 11:39:20