blob: 08f3f89fa03f8ca153d11ae21c19fed8c68766a9 [file] [log] [blame]
tierno7edb6752016-03-21 17:37:52 +01001/**
tierno11f81f62017-04-27 17:22:14 +02002* Copyright 2017 Telefónica Investigación y Desarrollo, S.A.U.
tierno7edb6752016-03-21 17:37:52 +01003* This file is part of openmano
4* All Rights Reserved.
5*
6* Licensed under the Apache License, Version 2.0 (the "License"); you may
7* not use this file except in compliance with the License. You may obtain
8* a copy of the License at
9*
10* http://www.apache.org/licenses/LICENSE-2.0
11*
12* Unless required by applicable law or agreed to in writing, software
13* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15* License for the specific language governing permissions and limitations
16* under the License.
17*
18* For those usages not covered by the Apache License, Version 2.0 please
19* contact with: nfvlabs@tid.es
20**/
tierno392f2852016-05-13 12:28:55 +020021
tierno182e3d12017-11-23 10:31:32 +010022-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
tierno7edb6752016-03-21 17:37:52 +010023--
tierno11f81f62017-04-27 17:22:14 +020024-- Host: localhost Database: {{mano_db}}
tierno7edb6752016-03-21 17:37:52 +010025-- ------------------------------------------------------
tierno182e3d12017-11-23 10:31:32 +010026-- Server version 5.7.20-0ubuntu0.16.04.1
tierno7edb6752016-03-21 17:37:52 +010027
28/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
29/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
30/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
31/*!40101 SET NAMES utf8 */;
32/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
33/*!40103 SET TIME_ZONE='+00:00' */;
34/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
35/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
36/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
37/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
38
39--
tierno11f81f62017-04-27 17:22:14 +020040-- Current Database: `{{mano_db}}`
41--
42
43/*!40000 DROP DATABASE IF EXISTS `{{mano_db}}`*/;
44
45CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{{mano_db}}` /*!40100 DEFAULT CHARACTER SET latin1 */;
46
47USE `{{mano_db}}`;
48
49--
tierno7edb6752016-03-21 17:37:52 +010050-- Table structure for table `datacenter_nets`
51--
52
53DROP TABLE IF EXISTS `datacenter_nets`;
54/*!40101 SET @saved_cs_client = @@character_set_client */;
55/*!40101 SET character_set_client = utf8 */;
56CREATE TABLE `datacenter_nets` (
57 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +020058 `name` varchar(255) NOT NULL,
tierno7edb6752016-03-21 17:37:52 +010059 `vim_net_id` varchar(36) NOT NULL,
60 `datacenter_id` varchar(36) NOT NULL,
61 `type` enum('bridge','data','ptp') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
62 `multipoint` enum('true','false') NOT NULL DEFAULT 'true',
63 `shared` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'If can be shared with serveral scenarios',
tierno392f2852016-05-13 12:28:55 +020064 `description` varchar(255) DEFAULT NULL,
65 `created_at` double NOT NULL,
66 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +010067 PRIMARY KEY (`uuid`),
68 UNIQUE KEY `name_datacenter_id` (`name`,`datacenter_id`),
69 KEY `FK_datacenter_nets_datacenters` (`datacenter_id`),
70 CONSTRAINT `FK_datacenter_nets_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
71) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Contain the external nets of a datacenter';
72/*!40101 SET character_set_client = @saved_cs_client */;
73
74--
tierno392f2852016-05-13 12:28:55 +020075-- Table structure for table `datacenter_tenants`
76--
77
78DROP TABLE IF EXISTS `datacenter_tenants`;
79/*!40101 SET @saved_cs_client = @@character_set_client */;
80/*!40101 SET character_set_client = utf8 */;
81CREATE TABLE `datacenter_tenants` (
82 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +010083 `name` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +020084 `datacenter_id` varchar(36) NOT NULL COMMENT 'Datacenter of this tenant',
tierno11f81f62017-04-27 17:22:14 +020085 `vim_tenant_name` varchar(256) DEFAULT NULL,
86 `vim_tenant_id` varchar(256) DEFAULT NULL COMMENT 'Tenant ID at VIM',
tierno392f2852016-05-13 12:28:55 +020087 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if this tenant has been created by openmano, or it existed on VIM',
88 `user` varchar(64) DEFAULT NULL,
89 `passwd` varchar(64) DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +020090 `config` varchar(4000) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +020091 `created_at` double NOT NULL,
92 `modified_at` double DEFAULT NULL,
93 PRIMARY KEY (`uuid`),
94 KEY `FK_vim_tenants_datacenters` (`datacenter_id`),
95 CONSTRAINT `FK_vim_tenants_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
96) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
97/*!40101 SET character_set_client = @saved_cs_client */;
98
99--
tierno7edb6752016-03-21 17:37:52 +0100100-- Table structure for table `datacenters`
101--
102
103DROP TABLE IF EXISTS `datacenters`;
104/*!40101 SET @saved_cs_client = @@character_set_client */;
105/*!40101 SET character_set_client = utf8 */;
106CREATE TABLE `datacenters` (
107 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200108 `name` varchar(255) NOT NULL,
109 `description` varchar(255) DEFAULT NULL,
110 `type` varchar(36) NOT NULL DEFAULT 'openvim',
tierno7edb6752016-03-21 17:37:52 +0100111 `vim_url` varchar(150) NOT NULL COMMENT 'URL of the VIM for the REST API',
112 `vim_url_admin` varchar(150) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200113 `config` varchar(4000) DEFAULT NULL COMMENT 'extra config information in json',
114 `created_at` double NOT NULL,
115 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100116 PRIMARY KEY (`uuid`),
117 UNIQUE KEY `name` (`name`)
118) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Datacenters managed by the NFVO.';
119/*!40101 SET character_set_client = @saved_cs_client */;
120
121--
tierno392f2852016-05-13 12:28:55 +0200122-- Table structure for table `datacenters_flavors`
123--
124
125DROP TABLE IF EXISTS `datacenters_flavors`;
126/*!40101 SET @saved_cs_client = @@character_set_client */;
127/*!40101 SET character_set_client = utf8 */;
128CREATE TABLE `datacenters_flavors` (
129 `id` int(11) NOT NULL AUTO_INCREMENT,
130 `flavor_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100131 `datacenter_vim_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200132 `vim_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100133 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
134 `vim_info` text,
tierno392f2852016-05-13 12:28:55 +0200135 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if it has been created by openmano, or already existed',
tierno11f81f62017-04-27 17:22:14 +0200136 `extended` varchar(2000) DEFAULT NULL COMMENT 'Extra description json format of additional devices',
tierno392f2852016-05-13 12:28:55 +0200137 PRIMARY KEY (`id`),
138 KEY `FK__flavors` (`flavor_id`),
tierno182e3d12017-11-23 10:31:32 +0100139 KEY `FK_datacenters_flavors_datacenter_tenants` (`datacenter_vim_id`),
140 CONSTRAINT `FK__flavors` FOREIGN KEY (`flavor_id`) REFERENCES `flavors` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
141 CONSTRAINT `FK_datacenters_flavors_datacenter_tenants` FOREIGN KEY (`datacenter_vim_id`) REFERENCES `datacenter_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
tierno392f2852016-05-13 12:28:55 +0200142) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
143/*!40101 SET character_set_client = @saved_cs_client */;
144
145--
146-- Table structure for table `datacenters_images`
147--
148
149DROP TABLE IF EXISTS `datacenters_images`;
150/*!40101 SET @saved_cs_client = @@character_set_client */;
151/*!40101 SET character_set_client = utf8 */;
152CREATE TABLE `datacenters_images` (
153 `id` int(11) NOT NULL AUTO_INCREMENT,
154 `image_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100155 `datacenter_vim_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200156 `vim_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100157 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
158 `vim_info` text,
tierno392f2852016-05-13 12:28:55 +0200159 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if it has been created by openmano, or already existed',
160 PRIMARY KEY (`id`),
161 KEY `FK__images` (`image_id`),
tierno182e3d12017-11-23 10:31:32 +0100162 KEY `FK_datacenters_images_datacenter_tenants` (`datacenter_vim_id`),
163 CONSTRAINT `FK__images` FOREIGN KEY (`image_id`) REFERENCES `images` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
164 CONSTRAINT `FK_datacenters_images_datacenter_tenants` FOREIGN KEY (`datacenter_vim_id`) REFERENCES `datacenter_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
tierno392f2852016-05-13 12:28:55 +0200165) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
166/*!40101 SET character_set_client = @saved_cs_client */;
167
168--
169-- Table structure for table `flavors`
170--
171
172DROP TABLE IF EXISTS `flavors`;
173/*!40101 SET @saved_cs_client = @@character_set_client */;
174/*!40101 SET character_set_client = utf8 */;
175CREATE TABLE `flavors` (
176 `uuid` varchar(36) NOT NULL,
177 `name` varchar(255) NOT NULL,
178 `description` varchar(255) DEFAULT NULL,
179 `disk` smallint(5) unsigned DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100180 `ram` mediumint(7) unsigned DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200181 `vcpus` smallint(5) unsigned DEFAULT NULL,
182 `extended` varchar(2000) DEFAULT NULL COMMENT 'Extra description json format of needed resources and pining, orginized in sets per numa',
183 PRIMARY KEY (`uuid`)
184) ENGINE=InnoDB DEFAULT CHARSET=utf8;
185/*!40101 SET character_set_client = @saved_cs_client */;
186
187--
188-- Table structure for table `images`
189--
190
191DROP TABLE IF EXISTS `images`;
192/*!40101 SET @saved_cs_client = @@character_set_client */;
193/*!40101 SET character_set_client = utf8 */;
194CREATE TABLE `images` (
195 `uuid` varchar(36) NOT NULL,
196 `name` varchar(255) NOT NULL,
tierno11f81f62017-04-27 17:22:14 +0200197 `universal_name` varchar(255) DEFAULT NULL,
198 `checksum` varchar(32) DEFAULT NULL,
199 `location` varchar(200) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200200 `description` varchar(255) DEFAULT NULL,
201 `metadata` varchar(2000) DEFAULT NULL,
202 PRIMARY KEY (`uuid`),
tierno11f81f62017-04-27 17:22:14 +0200203 UNIQUE KEY `location` (`location`),
204 UNIQUE KEY `universal_name_checksum` (`universal_name`,`checksum`)
tierno392f2852016-05-13 12:28:55 +0200205) ENGINE=InnoDB DEFAULT CHARSET=utf8;
206/*!40101 SET character_set_client = @saved_cs_client */;
207
208--
tierno182e3d12017-11-23 10:31:32 +0100209-- Table structure for table `instance_actions`
210--
211
212DROP TABLE IF EXISTS `instance_actions`;
213/*!40101 SET @saved_cs_client = @@character_set_client */;
214/*!40101 SET character_set_client = utf8 */;
215CREATE TABLE `instance_actions` (
216 `uuid` varchar(36) NOT NULL,
217 `tenant_id` varchar(36) DEFAULT NULL,
218 `instance_id` varchar(36) DEFAULT NULL,
219 `description` varchar(64) DEFAULT NULL COMMENT 'CREATE, DELETE, SCALE OUT/IN, ...',
220 `number_tasks` smallint(6) NOT NULL DEFAULT '1',
221 `number_done` smallint(6) NOT NULL DEFAULT '0',
222 `number_failed` smallint(6) NOT NULL DEFAULT '0',
223 `created_at` double NOT NULL,
224 `modified_at` double DEFAULT NULL,
225 PRIMARY KEY (`uuid`),
226 KEY `FK_actions_tenants` (`tenant_id`),
227 CONSTRAINT `FK_actions_tenant` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
228) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Contains client actions over instances';
229/*!40101 SET character_set_client = @saved_cs_client */;
230
231--
tierno7edb6752016-03-21 17:37:52 +0100232-- Table structure for table `instance_interfaces`
233--
234
235DROP TABLE IF EXISTS `instance_interfaces`;
236/*!40101 SET @saved_cs_client = @@character_set_client */;
237/*!40101 SET character_set_client = utf8 */;
238CREATE TABLE `instance_interfaces` (
239 `uuid` varchar(36) NOT NULL,
240 `instance_vm_id` varchar(36) NOT NULL,
241 `instance_net_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100242 `interface_id` varchar(36) DEFAULT NULL,
243 `vim_interface_id` varchar(128) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200244 `mac_address` varchar(32) DEFAULT NULL,
245 `ip_address` varchar(64) DEFAULT NULL,
246 `vim_info` text,
tierno7edb6752016-03-21 17:37:52 +0100247 `type` enum('internal','external') NOT NULL COMMENT 'Indicates if this interface is external to a vnf, or internal',
tierno11f81f62017-04-27 17:22:14 +0200248 `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface',
249 `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled',
250 `sdn_port_id` varchar(36) DEFAULT NULL COMMENT 'Port id in ovim',
251 `compute_node` varchar(100) DEFAULT NULL COMMENT 'Compute node id used to specify the SDN port mapping',
tierno182e3d12017-11-23 10:31:32 +0100252 `pci` varchar(50) DEFAULT NULL COMMENT 'PCI of the physical port in the host',
tierno11f81f62017-04-27 17:22:14 +0200253 `vlan` smallint(5) unsigned DEFAULT NULL COMMENT 'VLAN tag used by the port',
tierno7edb6752016-03-21 17:37:52 +0100254 PRIMARY KEY (`uuid`),
255 KEY `FK_instance_vms` (`instance_vm_id`),
256 KEY `FK_instance_nets` (`instance_net_id`),
257 KEY `FK_instance_ids` (`interface_id`),
tierno182e3d12017-11-23 10:31:32 +0100258 CONSTRAINT `FK_instance_ids` FOREIGN KEY (`interface_id`) REFERENCES `interfaces` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
tierno7edb6752016-03-21 17:37:52 +0100259 CONSTRAINT `FK_instance_nets` FOREIGN KEY (`instance_net_id`) REFERENCES `instance_nets` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
260 CONSTRAINT `FK_instance_vms` FOREIGN KEY (`instance_vm_id`) REFERENCES `instance_vms` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
261) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Table with all running associattion among VM instances and net instances';
262/*!40101 SET character_set_client = @saved_cs_client */;
263
264--
265-- Table structure for table `instance_nets`
266--
267
268DROP TABLE IF EXISTS `instance_nets`;
269/*!40101 SET @saved_cs_client = @@character_set_client */;
270/*!40101 SET character_set_client = utf8 */;
271CREATE TABLE `instance_nets` (
272 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100273 `vim_net_id` varchar(128) DEFAULT NULL,
274 `instance_scenario_id` varchar(36) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200275 `sce_net_id` varchar(36) DEFAULT NULL,
276 `net_id` varchar(36) DEFAULT NULL,
277 `datacenter_id` varchar(36) DEFAULT NULL,
278 `datacenter_tenant_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100279 `status` enum('ACTIVE','INACTIVE','DOWN','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
tierno392f2852016-05-13 12:28:55 +0200280 `error_msg` varchar(1024) DEFAULT NULL,
281 `vim_info` text,
tierno7edb6752016-03-21 17:37:52 +0100282 `multipoint` enum('true','false') NOT NULL DEFAULT 'true',
tierno11f81f62017-04-27 17:22:14 +0200283 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Created or already exists at VIM',
tierno392f2852016-05-13 12:28:55 +0200284 `created_at` double NOT NULL,
285 `modified_at` double DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +0200286 `sdn_net_id` varchar(36) DEFAULT NULL COMMENT 'Network id in ovim',
tierno7edb6752016-03-21 17:37:52 +0100287 PRIMARY KEY (`uuid`),
tierno7edb6752016-03-21 17:37:52 +0100288 KEY `FK_instance_nets_instance_scenarios` (`instance_scenario_id`),
tierno392f2852016-05-13 12:28:55 +0200289 KEY `FK_instance_nets_sce_nets` (`sce_net_id`),
290 KEY `FK_instance_nets_nets` (`net_id`),
291 KEY `FK_instance_nets_datacenters` (`datacenter_id`),
292 KEY `FK_instance_nets_datacenter_tenants` (`datacenter_tenant_id`),
293 CONSTRAINT `FK_instance_nets_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
294 CONSTRAINT `FK_instance_nets_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
295 CONSTRAINT `FK_instance_nets_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
296 CONSTRAINT `FK_instance_nets_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
297 CONSTRAINT `FK_instance_nets_sce_nets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
tierno7edb6752016-03-21 17:37:52 +0100298) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of networks';
299/*!40101 SET character_set_client = @saved_cs_client */;
300
301--
302-- Table structure for table `instance_scenarios`
303--
304
305DROP TABLE IF EXISTS `instance_scenarios`;
306/*!40101 SET @saved_cs_client = @@character_set_client */;
307/*!40101 SET character_set_client = utf8 */;
308CREATE TABLE `instance_scenarios` (
309 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200310 `name` varchar(255) NOT NULL,
311 `tenant_id` varchar(36) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100312 `scenario_id` varchar(36) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100313 `datacenter_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200314 `datacenter_tenant_id` varchar(36) NOT NULL,
315 `description` varchar(255) DEFAULT NULL,
316 `created_at` double NOT NULL,
317 `modified_at` double DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +0200318 `cloud_config` mediumtext,
tierno7edb6752016-03-21 17:37:52 +0100319 PRIMARY KEY (`uuid`),
tierno392f2852016-05-13 12:28:55 +0200320 KEY `FK_scenarios_nfvo_tenants` (`tenant_id`),
321 KEY `FK_instance_scenarios_vim_tenants` (`datacenter_tenant_id`),
tierno7edb6752016-03-21 17:37:52 +0100322 KEY `FK_instance_scenarios_datacenters` (`datacenter_id`),
323 KEY `FK_instance_scenarios_scenarios` (`scenario_id`),
tierno392f2852016-05-13 12:28:55 +0200324 CONSTRAINT `FK_instance_scenarios_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
tierno7edb6752016-03-21 17:37:52 +0100325 CONSTRAINT `FK_instance_scenarios_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
tierno392f2852016-05-13 12:28:55 +0200326 CONSTRAINT `FK_instance_scenarios_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`),
tierno182e3d12017-11-23 10:31:32 +0100327 CONSTRAINT `FK_instance_scenarios_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
tierno7edb6752016-03-21 17:37:52 +0100328) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of scenarios defined by the user';
329/*!40101 SET character_set_client = @saved_cs_client */;
330
331--
332-- Table structure for table `instance_vms`
333--
334
335DROP TABLE IF EXISTS `instance_vms`;
336/*!40101 SET @saved_cs_client = @@character_set_client */;
337/*!40101 SET character_set_client = utf8 */;
338CREATE TABLE `instance_vms` (
339 `uuid` varchar(36) NOT NULL,
340 `instance_vnf_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100341 `vm_id` varchar(36) DEFAULT NULL,
342 `vim_vm_id` varchar(128) DEFAULT NULL,
343 `status` enum('ACTIVE:NoMgmtIP','ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
tierno392f2852016-05-13 12:28:55 +0200344 `error_msg` varchar(1024) DEFAULT NULL,
345 `vim_info` text,
346 `created_at` double NOT NULL,
347 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100348 PRIMARY KEY (`uuid`),
349 UNIQUE KEY `vim_vm_id` (`vim_vm_id`),
350 KEY `FK_instance_vms_vms` (`vm_id`),
351 KEY `FK_instance_vms_instance_vnfs` (`instance_vnf_id`),
352 CONSTRAINT `FK_instance_vms_instance_vnfs` FOREIGN KEY (`instance_vnf_id`) REFERENCES `instance_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
tierno182e3d12017-11-23 10:31:32 +0100353 CONSTRAINT `FK_instance_vms_vms` FOREIGN KEY (`vm_id`) REFERENCES `vms` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
tierno7edb6752016-03-21 17:37:52 +0100354) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of VMs as part of VNF instances';
355/*!40101 SET character_set_client = @saved_cs_client */;
356
357--
358-- Table structure for table `instance_vnfs`
359--
360
361DROP TABLE IF EXISTS `instance_vnfs`;
362/*!40101 SET @saved_cs_client = @@character_set_client */;
363/*!40101 SET character_set_client = utf8 */;
364CREATE TABLE `instance_vnfs` (
365 `uuid` varchar(36) NOT NULL,
366 `instance_scenario_id` varchar(36) NOT NULL,
367 `vnf_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200368 `sce_vnf_id` varchar(36) DEFAULT NULL,
369 `datacenter_id` varchar(36) DEFAULT NULL,
370 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
371 `created_at` double NOT NULL,
372 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100373 PRIMARY KEY (`uuid`),
374 KEY `FK_instance_vnfs_vnfs` (`vnf_id`),
375 KEY `FK_instance_vnfs_instance_scenarios` (`instance_scenario_id`),
tierno392f2852016-05-13 12:28:55 +0200376 KEY `FK_instance_vnfs_sce_vnfs` (`sce_vnf_id`),
377 KEY `FK_instance_vnfs_datacenters` (`datacenter_id`),
378 KEY `FK_instance_vnfs_datacenter_tenants` (`datacenter_tenant_id`),
379 CONSTRAINT `FK_instance_vnfs_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
380 CONSTRAINT `FK_instance_vnfs_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
tierno7edb6752016-03-21 17:37:52 +0100381 CONSTRAINT `FK_instance_vnfs_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
tierno392f2852016-05-13 12:28:55 +0200382 CONSTRAINT `FK_instance_vnfs_sce_vnfs` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
tierno7edb6752016-03-21 17:37:52 +0100383 CONSTRAINT `FK_instance_vnfs_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`)
384) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of VNFs as part of a scenario';
385/*!40101 SET character_set_client = @saved_cs_client */;
386
387--
388-- Table structure for table `interfaces`
389--
390
391DROP TABLE IF EXISTS `interfaces`;
392/*!40101 SET @saved_cs_client = @@character_set_client */;
393/*!40101 SET character_set_client = utf8 */;
394CREATE TABLE `interfaces` (
395 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200396 `internal_name` varchar(255) NOT NULL,
397 `external_name` varchar(255) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100398 `vm_id` varchar(36) NOT NULL,
399 `net_id` varchar(36) DEFAULT NULL,
400 `type` enum('mgmt','bridge','data') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
401 `vpci` char(12) DEFAULT NULL,
402 `bw` mediumint(8) unsigned DEFAULT NULL COMMENT 'BW expressed in Mbits/s. Maybe this field is not necessary.',
tierno392f2852016-05-13 12:28:55 +0200403 `created_at` double NOT NULL,
404 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100405 `model` varchar(12) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200406 `mac` char(18) DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +0200407 `ip_address` varchar(64) DEFAULT NULL,
408 `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface',
409 `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled',
tierno7edb6752016-03-21 17:37:52 +0100410 PRIMARY KEY (`uuid`),
411 UNIQUE KEY `internal_name_vm_id` (`internal_name`,`vm_id`),
412 KEY `FK_interfaces_vms` (`vm_id`),
413 KEY `FK_interfaces_nets` (`net_id`),
414 CONSTRAINT `FK_interfaces_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE CASCADE,
415 CONSTRAINT `FK_interfaces_vms` FOREIGN KEY (`vm_id`) REFERENCES `vms` (`uuid`) ON DELETE CASCADE
416) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VM interfaces';
417/*!40101 SET character_set_client = @saved_cs_client */;
418
419--
tierno11f81f62017-04-27 17:22:14 +0200420-- Table structure for table `ip_profiles`
421--
422
423DROP TABLE IF EXISTS `ip_profiles`;
424/*!40101 SET @saved_cs_client = @@character_set_client */;
425/*!40101 SET character_set_client = utf8 */;
426CREATE TABLE `ip_profiles` (
427 `id` int(11) NOT NULL AUTO_INCREMENT,
428 `net_id` varchar(36) DEFAULT NULL,
429 `sce_net_id` varchar(36) DEFAULT NULL,
430 `instance_net_id` varchar(36) DEFAULT NULL,
431 `ip_version` enum('IPv4','IPv6') NOT NULL DEFAULT 'IPv4',
432 `subnet_address` varchar(64) DEFAULT NULL,
433 `gateway_address` varchar(64) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100434 `dns_address` varchar(255) DEFAULT NULL COMMENT 'dns ip list separated by semicolon',
tierno11f81f62017-04-27 17:22:14 +0200435 `dhcp_enabled` enum('true','false') NOT NULL DEFAULT 'true',
436 `dhcp_start_address` varchar(64) DEFAULT NULL,
437 `dhcp_count` int(11) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100438 `security_group` varchar(255) DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +0200439 PRIMARY KEY (`id`),
440 KEY `FK_ipprofiles_nets` (`net_id`),
441 KEY `FK_ipprofiles_scenets` (`sce_net_id`),
442 KEY `FK_ipprofiles_instancenets` (`instance_net_id`),
443 CONSTRAINT `FK_ipprofiles_instancenets` FOREIGN KEY (`instance_net_id`) REFERENCES `instance_nets` (`uuid`) ON DELETE CASCADE,
444 CONSTRAINT `FK_ipprofiles_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE CASCADE,
445 CONSTRAINT `FK_ipprofiles_scenets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE CASCADE
446) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table containing the IP parameters of a network, either a net, a sce_net or and instance_net.';
447/*!40101 SET character_set_client = @saved_cs_client */;
448
449--
tierno7edb6752016-03-21 17:37:52 +0100450-- Table structure for table `logs`
451--
452
453DROP TABLE IF EXISTS `logs`;
454/*!40101 SET @saved_cs_client = @@character_set_client */;
455/*!40101 SET character_set_client = utf8 */;
456CREATE TABLE `logs` (
457 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
458 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
459 `nfvo_tenant_id` varchar(36) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200460 `related` varchar(36) NOT NULL COMMENT 'Relevant element for the log',
tierno7edb6752016-03-21 17:37:52 +0100461 `uuid` varchar(36) DEFAULT NULL COMMENT 'Uuid of vnf, scenario, etc. that log relates to',
462 `level` enum('panic','error','info','debug','verbose') NOT NULL,
463 `description` varchar(200) NOT NULL,
464 PRIMARY KEY (`id`)
tierno392f2852016-05-13 12:28:55 +0200465) ENGINE=InnoDB AUTO_INCREMENT=3423 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
tierno7edb6752016-03-21 17:37:52 +0100466/*!40101 SET character_set_client = @saved_cs_client */;
467
468--
469-- Table structure for table `nets`
470--
471
472DROP TABLE IF EXISTS `nets`;
473/*!40101 SET @saved_cs_client = @@character_set_client */;
474/*!40101 SET character_set_client = utf8 */;
475CREATE TABLE `nets` (
476 `uuid` varchar(36) NOT NULL,
477 `vnf_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200478 `name` varchar(255) NOT NULL,
tierno7edb6752016-03-21 17:37:52 +0100479 `type` enum('bridge','data','ptp') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
480 `multipoint` enum('true','false') NOT NULL DEFAULT 'false',
tierno392f2852016-05-13 12:28:55 +0200481 `description` varchar(255) DEFAULT NULL,
482 `created_at` double NOT NULL,
483 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100484 PRIMARY KEY (`uuid`),
485 UNIQUE KEY `vnf_id_name` (`vnf_id`,`name`),
486 CONSTRAINT `FK_nets_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`) ON DELETE CASCADE
487) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Networks in a VNF definition. These are only the internal networks among VMs of the same VNF.';
488/*!40101 SET character_set_client = @saved_cs_client */;
489
490--
491-- Table structure for table `nfvo_tenants`
492--
493
494DROP TABLE IF EXISTS `nfvo_tenants`;
495/*!40101 SET @saved_cs_client = @@character_set_client */;
496/*!40101 SET character_set_client = utf8 */;
497CREATE TABLE `nfvo_tenants` (
498 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200499 `name` varchar(255) NOT NULL,
500 `description` varchar(255) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100501 `encrypted_RO_priv_key` varchar(2000) DEFAULT NULL,
502 `RO_pub_key` varchar(510) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200503 `created_at` double NOT NULL,
504 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100505 PRIMARY KEY (`uuid`),
506 UNIQUE KEY `name` (`name`)
507) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
508/*!40101 SET character_set_client = @saved_cs_client */;
509
510--
511-- Table structure for table `sce_interfaces`
512--
513
514DROP TABLE IF EXISTS `sce_interfaces`;
515/*!40101 SET @saved_cs_client = @@character_set_client */;
516/*!40101 SET character_set_client = utf8 */;
517CREATE TABLE `sce_interfaces` (
518 `uuid` varchar(36) NOT NULL,
519 `sce_vnf_id` varchar(36) NOT NULL,
520 `sce_net_id` varchar(36) DEFAULT NULL,
521 `interface_id` varchar(36) DEFAULT NULL,
tierno11f81f62017-04-27 17:22:14 +0200522 `ip_address` varchar(64) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200523 `created_at` double NOT NULL,
524 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100525 PRIMARY KEY (`uuid`),
526 KEY `FK_sce_interfaces_sce_vnfs` (`sce_vnf_id`),
527 KEY `FK_sce_interfaces_sce_nets` (`sce_net_id`),
528 KEY `FK_sce_interfaces_interfaces` (`interface_id`),
529 CONSTRAINT `FK_sce_interfaces_interfaces` FOREIGN KEY (`interface_id`) REFERENCES `interfaces` (`uuid`),
530 CONSTRAINT `FK_sce_interfaces_sce_nets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
531 CONSTRAINT `FK_sce_interfaces_sce_vnfs` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
532) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VNF interfaces in a scenario definition.';
533/*!40101 SET character_set_client = @saved_cs_client */;
534
535--
536-- Table structure for table `sce_nets`
537--
538
539DROP TABLE IF EXISTS `sce_nets`;
540/*!40101 SET @saved_cs_client = @@character_set_client */;
541/*!40101 SET character_set_client = utf8 */;
542CREATE TABLE `sce_nets` (
543 `uuid` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200544 `name` varchar(255) NOT NULL,
tierno7edb6752016-03-21 17:37:52 +0100545 `scenario_id` varchar(36) DEFAULT NULL COMMENT 'NULL if net is matched to several scenarios',
546 `type` enum('bridge','data','ptp') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
547 `multipoint` enum('true','false') NOT NULL DEFAULT 'true',
548 `external` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'If external, net is already present at VIM',
tierno392f2852016-05-13 12:28:55 +0200549 `description` varchar(255) DEFAULT NULL,
550 `created_at` double NOT NULL,
551 `modified_at` double DEFAULT NULL,
552 `graph` varchar(2000) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100553 PRIMARY KEY (`uuid`),
554 KEY `FK_sce_nets_scenarios` (`scenario_id`),
555 CONSTRAINT `FK_sce_nets_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
556) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Networks in a scenario definition. It only considers networks among VNFs. Networks among internal VMs are only considered in tble ''nets''.';
557/*!40101 SET character_set_client = @saved_cs_client */;
558
559--
560-- Table structure for table `sce_vnfs`
561--
562
563DROP TABLE IF EXISTS `sce_vnfs`;
564/*!40101 SET @saved_cs_client = @@character_set_client */;
565/*!40101 SET character_set_client = utf8 */;
566CREATE TABLE `sce_vnfs` (
567 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100568 `member_vnf_index` smallint(6) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200569 `name` varchar(255) NOT NULL,
tierno7edb6752016-03-21 17:37:52 +0100570 `scenario_id` varchar(36) NOT NULL,
571 `vnf_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200572 `description` varchar(255) DEFAULT NULL,
573 `created_at` double NOT NULL,
574 `modified_at` double DEFAULT NULL,
575 `graph` varchar(2000) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100576 PRIMARY KEY (`uuid`),
577 UNIQUE KEY `name_scenario_id` (`name`,`scenario_id`),
578 KEY `FK_sce_vnfs_scenarios` (`scenario_id`),
579 KEY `FK_sce_vnfs_vnfs` (`vnf_id`),
580 CONSTRAINT `FK_sce_vnfs_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
581 CONSTRAINT `FK_sce_vnfs_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`)
582) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VNFs in scenario definitions. This table also contains the Physical Network Functions and the external elements such as MAN, Core, etc.\r\n';
583/*!40101 SET character_set_client = @saved_cs_client */;
584
585--
586-- Table structure for table `scenarios`
587--
588
589DROP TABLE IF EXISTS `scenarios`;
590/*!40101 SET @saved_cs_client = @@character_set_client */;
591/*!40101 SET character_set_client = utf8 */;
592CREATE TABLE `scenarios` (
593 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100594 `osm_id` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200595 `name` varchar(255) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100596 `short_name` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200597 `tenant_id` varchar(36) DEFAULT NULL,
598 `description` varchar(255) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100599 `vendor` varchar(255) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100600 `public` enum('true','false') NOT NULL DEFAULT 'false',
tierno392f2852016-05-13 12:28:55 +0200601 `created_at` double NOT NULL,
602 `modified_at` double DEFAULT NULL,
603 `descriptor` text COMMENT 'Original text descriptor used for create the scenario',
tierno11f81f62017-04-27 17:22:14 +0200604 `cloud_config` mediumtext,
tierno7edb6752016-03-21 17:37:52 +0100605 PRIMARY KEY (`uuid`),
tierno182e3d12017-11-23 10:31:32 +0100606 UNIQUE KEY `osm_id_tenant_id` (`osm_id`,`tenant_id`),
tierno392f2852016-05-13 12:28:55 +0200607 KEY `FK_scenarios_nfvo_tenants` (`tenant_id`),
608 CONSTRAINT `FK_scenarios_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`)
tierno7edb6752016-03-21 17:37:52 +0100609) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
610/*!40101 SET character_set_client = @saved_cs_client */;
611
612--
tierno392f2852016-05-13 12:28:55 +0200613-- Table structure for table `schema_version`
614--
615
616DROP TABLE IF EXISTS `schema_version`;
617/*!40101 SET @saved_cs_client = @@character_set_client */;
618/*!40101 SET character_set_client = utf8 */;
619CREATE TABLE `schema_version` (
620 `version_int` int(11) NOT NULL COMMENT 'version as a number. Must not contain gaps',
621 `version` varchar(20) NOT NULL COMMENT 'version as a text',
622 `openmano_ver` varchar(20) NOT NULL COMMENT 'openmano version',
623 `comments` varchar(2000) DEFAULT NULL COMMENT 'changes to database',
624 `date` date DEFAULT NULL,
625 PRIMARY KEY (`version_int`)
626) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='database schema control version';
627/*!40101 SET character_set_client = @saved_cs_client */;
628
629--
tierno7edb6752016-03-21 17:37:52 +0100630-- Table structure for table `tenants_datacenters`
631--
632
633DROP TABLE IF EXISTS `tenants_datacenters`;
634/*!40101 SET @saved_cs_client = @@character_set_client */;
635/*!40101 SET character_set_client = utf8 */;
636CREATE TABLE `tenants_datacenters` (
637 `id` int(11) NOT NULL AUTO_INCREMENT,
638 `nfvo_tenant_id` varchar(36) NOT NULL,
639 `datacenter_id` varchar(36) NOT NULL,
tierno392f2852016-05-13 12:28:55 +0200640 `datacenter_tenant_id` varchar(36) NOT NULL,
641 `created_at` double NOT NULL,
642 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100643 PRIMARY KEY (`id`),
644 UNIQUE KEY `datacenter_nfvo_tenant` (`datacenter_id`,`nfvo_tenant_id`),
645 KEY `FK_nfvo_tenants_datacenters` (`datacenter_id`),
tierno392f2852016-05-13 12:28:55 +0200646 KEY `FK_nfvo_tenants_vim_tenants` (`datacenter_tenant_id`),
tierno7edb6752016-03-21 17:37:52 +0100647 KEY `FK_tenants_datacenters_nfvo_tenants` (`nfvo_tenant_id`),
tierno392f2852016-05-13 12:28:55 +0200648 CONSTRAINT `FK_tenants_datacenters_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
tierno7edb6752016-03-21 17:37:52 +0100649 CONSTRAINT `FK_tenants_datacenters_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
tierno392f2852016-05-13 12:28:55 +0200650 CONSTRAINT `FK_tenants_datacenters_nfvo_tenants` FOREIGN KEY (`nfvo_tenant_id`) REFERENCES `nfvo_tenants` (`uuid`)
651) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
tierno7edb6752016-03-21 17:37:52 +0100652/*!40101 SET character_set_client = @saved_cs_client */;
653
654--
655-- Table structure for table `uuids`
656--
657
658DROP TABLE IF EXISTS `uuids`;
659/*!40101 SET @saved_cs_client = @@character_set_client */;
660/*!40101 SET character_set_client = utf8 */;
661CREATE TABLE `uuids` (
662 `uuid` varchar(36) NOT NULL,
663 `root_uuid` varchar(36) DEFAULT NULL COMMENT 'Some related UUIDs can be grouped by this field, so that they can be deleted at once',
tierno392f2852016-05-13 12:28:55 +0200664 `created_at` double NOT NULL,
665 `used_at` varchar(36) DEFAULT NULL COMMENT 'Table that uses this UUID',
tierno7edb6752016-03-21 17:37:52 +0100666 PRIMARY KEY (`uuid`)
667) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table with all unique IDs used to avoid UUID repetitions among different elements';
668/*!40101 SET character_set_client = @saved_cs_client */;
669
670--
tierno182e3d12017-11-23 10:31:32 +0100671-- Table structure for table `vim_actions`
672--
673
674DROP TABLE IF EXISTS `vim_actions`;
675/*!40101 SET @saved_cs_client = @@character_set_client */;
676/*!40101 SET character_set_client = utf8 */;
677CREATE TABLE `vim_actions` (
678 `instance_action_id` varchar(36) NOT NULL,
679 `task_index` int(6) NOT NULL,
680 `datacenter_vim_id` varchar(36) NOT NULL,
681 `vim_id` varchar(64) DEFAULT NULL,
682 `action` varchar(36) NOT NULL COMMENT 'CREATE,DELETE,START,STOP...',
683 `item` enum('datacenters_flavors','datacenter_images','instance_nets','instance_vms','instance_interfaces') NOT NULL COMMENT 'table where the item is stored',
684 `item_id` varchar(36) DEFAULT NULL COMMENT 'uuid of the entry in the table',
685 `status` enum('SCHEDULED','BUILD','DONE','FAILED','SUPERSEDED') NOT NULL DEFAULT 'SCHEDULED',
686 `extra` text COMMENT 'json with params:, depends_on: for the task',
687 `error_msg` varchar(1024) DEFAULT NULL,
688 `created_at` double NOT NULL,
689 `modified_at` double DEFAULT NULL,
690 PRIMARY KEY (`task_index`,`instance_action_id`),
691 KEY `FK_actions_instance_actions` (`instance_action_id`),
692 KEY `FK_actions_vims` (`datacenter_vim_id`),
693 CONSTRAINT `FK_actions_instance_actions` FOREIGN KEY (`instance_action_id`) REFERENCES `instance_actions` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
694 CONSTRAINT `FK_actions_vims` FOREIGN KEY (`datacenter_vim_id`) REFERENCES `datacenter_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
695) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table with the individual VIM actions.';
696/*!40101 SET character_set_client = @saved_cs_client */;
697
698--
tierno7edb6752016-03-21 17:37:52 +0100699-- Table structure for table `vms`
700--
701
702DROP TABLE IF EXISTS `vms`;
703/*!40101 SET @saved_cs_client = @@character_set_client */;
704/*!40101 SET character_set_client = utf8 */;
705CREATE TABLE `vms` (
706 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100707 `osm_id` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200708 `name` varchar(255) NOT NULL,
tierno7edb6752016-03-21 17:37:52 +0100709 `vnf_id` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100710 `count` smallint(6) NOT NULL DEFAULT '1',
tierno392f2852016-05-13 12:28:55 +0200711 `flavor_id` varchar(36) NOT NULL COMMENT 'Link to flavor table',
712 `image_id` varchar(36) NOT NULL COMMENT 'Link to image table',
tierno11f81f62017-04-27 17:22:14 +0200713 `image_path` varchar(100) DEFAULT NULL COMMENT 'Path where the image of the VM is located',
714 `boot_data` text,
tierno392f2852016-05-13 12:28:55 +0200715 `description` varchar(255) DEFAULT NULL,
716 `created_at` double NOT NULL,
717 `modified_at` double DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100718 `availability_zone` varchar(255) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100719 PRIMARY KEY (`uuid`),
720 UNIQUE KEY `name_vnf_id` (`name`,`vnf_id`),
721 KEY `FK_vms_vnfs` (`vnf_id`),
tierno392f2852016-05-13 12:28:55 +0200722 KEY `FK_vms_images` (`image_id`),
723 KEY `FK_vms_flavors` (`flavor_id`),
724 CONSTRAINT `FK_vms_flavors` FOREIGN KEY (`flavor_id`) REFERENCES `flavors` (`uuid`),
725 CONSTRAINT `FK_vms_images` FOREIGN KEY (`image_id`) REFERENCES `images` (`uuid`),
tierno7edb6752016-03-21 17:37:52 +0100726 CONSTRAINT `FK_vms_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`) ON DELETE CASCADE
727) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VM definitions. It contains the set of VMs used by the VNF definitions.';
728/*!40101 SET character_set_client = @saved_cs_client */;
729
730--
731-- Table structure for table `vnfs`
732--
733
734DROP TABLE IF EXISTS `vnfs`;
735/*!40101 SET @saved_cs_client = @@character_set_client */;
736/*!40101 SET character_set_client = utf8 */;
737CREATE TABLE `vnfs` (
738 `uuid` varchar(36) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100739 `osm_id` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200740 `name` varchar(255) NOT NULL,
tierno182e3d12017-11-23 10:31:32 +0100741 `short_name` varchar(255) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200742 `tenant_id` varchar(36) DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100743 `physical` enum('true','false') NOT NULL DEFAULT 'false',
tierno392f2852016-05-13 12:28:55 +0200744 `public` enum('true','false') NOT NULL DEFAULT 'false',
745 `description` varchar(255) DEFAULT NULL,
tierno182e3d12017-11-23 10:31:32 +0100746 `vendor` varchar(255) DEFAULT NULL,
747 `mgmt_access` varchar(2000) DEFAULT NULL,
tierno392f2852016-05-13 12:28:55 +0200748 `created_at` double NOT NULL,
749 `modified_at` double DEFAULT NULL,
tierno7edb6752016-03-21 17:37:52 +0100750 `class` varchar(36) DEFAULT 'MISC',
tierno392f2852016-05-13 12:28:55 +0200751 `descriptor` text COMMENT 'Original text descriptor used for create the VNF',
tierno7edb6752016-03-21 17:37:52 +0100752 PRIMARY KEY (`uuid`),
tierno182e3d12017-11-23 10:31:32 +0100753 UNIQUE KEY `osm_id_tenant_id` (`osm_id`,`tenant_id`),
tierno392f2852016-05-13 12:28:55 +0200754 KEY `FK_vnfs_nfvo_tenants` (`tenant_id`),
755 CONSTRAINT `FK_vnfs_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
tierno7edb6752016-03-21 17:37:52 +0100756) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VNF definitions. This is the catalogue of VNFs. It also includes Physical Network Functions or Physical Elements.\r\n';
757/*!40101 SET character_set_client = @saved_cs_client */;
758
759--
tierno11f81f62017-04-27 17:22:14 +0200760-- Dumping routines for database '{{mano_db}}'
tierno7edb6752016-03-21 17:37:52 +0100761--
762/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
763
764/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
765/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
766/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
767/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
768/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
769/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
770/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
771
tierno182e3d12017-11-23 10:31:32 +0100772-- Dump completed on 2017-11-23 10:24:39
tierno392f2852016-05-13 12:28:55 +0200773
774
775
776
777
tierno182e3d12017-11-23 10:31:32 +0100778-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
tierno392f2852016-05-13 12:28:55 +0200779--
tierno11f81f62017-04-27 17:22:14 +0200780-- Host: localhost Database: {{mano_db}}
tierno392f2852016-05-13 12:28:55 +0200781-- ------------------------------------------------------
tierno182e3d12017-11-23 10:31:32 +0100782-- Server version 5.7.20-0ubuntu0.16.04.1
tierno392f2852016-05-13 12:28:55 +0200783
784/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
785/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
786/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
787/*!40101 SET NAMES utf8 */;
788/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
789/*!40103 SET TIME_ZONE='+00:00' */;
790/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
791/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
792/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
793/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
794
795--
796-- Dumping data for table `schema_version`
797--
798
799LOCK TABLES `schema_version` WRITE;
800/*!40000 ALTER TABLE `schema_version` DISABLE KEYS */;
tierno182e3d12017-11-23 10:31:32 +0100801INSERT 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'),(21,'0.21','0.5.15','Edit instance_nets to allow instance_scenario_id=None and enlarge column dns_address at table ip_profiles','2017-06-02'),(22,'0.22','0.5.16','Changed type of ram in flavors from SMALLINT to MEDIUMINT','2017-06-02'),(23,'0.23','0.5.20','Changed type of ram in flavors from SMALLINT to MEDIUMINT','2017-08-29'),(24,'0.24','0.5.21','Added vnfd fields','2017-08-29'),(25,'0.25','0.5.22','Added osm_id to vnfs,scenarios','2017-09-01'),(26,'0.26','0.5.23','Several changes','2017-09-09'),(27,'0.27','0.5.25','Added encrypted_RO_priv_key,RO_pub_key to table nfvo_tenants','2017-09-29');
tierno392f2852016-05-13 12:28:55 +0200802/*!40000 ALTER TABLE `schema_version` ENABLE KEYS */;
803UNLOCK TABLES;
804/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
805
806/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
807/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
808/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
809/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
810/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
811/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
812/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
813
tierno182e3d12017-11-23 10:31:32 +0100814-- Dump completed on 2017-11-23 10:24:39