fix bug 878
[osm/RO.git] / database_utils / mano_db_structure.sql
1 /**
2 * Copyright 2017 Telefonica Investigacion y Desarrollo, S.A.U.
3 * 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 **/
21
22 -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
23 --
24 -- Host: localhost Database: {{mano_db}}
25 -- ------------------------------------------------------
26 -- Server version 5.7.24
27
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 --
40 -- Current Database: `{{mano_db}}`
41 --
42
43 /*!40000 DROP DATABASE IF EXISTS `{{mano_db}}`*/;
44
45 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{{mano_db}}` /*!40100 DEFAULT CHARACTER SET utf8 */;
46
47 USE `{{mano_db}}`;
48
49 --
50 -- Table structure for table `datacenter_nets`
51 --
52
53 DROP TABLE IF EXISTS `datacenter_nets`;
54 /*!40101 SET @saved_cs_client = @@character_set_client */;
55 /*!40101 SET character_set_client = utf8 */;
56 CREATE TABLE `datacenter_nets` (
57 `uuid` varchar(36) NOT NULL,
58 `name` varchar(255) NOT NULL,
59 `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',
64 `description` varchar(255) DEFAULT NULL,
65 `created_at` double NOT NULL,
66 `modified_at` double DEFAULT NULL,
67 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 --
75 -- Table structure for table `datacenter_tenants`
76 --
77
78 DROP TABLE IF EXISTS `datacenter_tenants`;
79 /*!40101 SET @saved_cs_client = @@character_set_client */;
80 /*!40101 SET character_set_client = utf8 */;
81 CREATE TABLE `datacenter_tenants` (
82 `uuid` varchar(36) NOT NULL,
83 `name` varchar(255) DEFAULT NULL,
84 `datacenter_id` varchar(36) NOT NULL COMMENT 'Datacenter of this tenant',
85 `vim_tenant_name` varchar(256) DEFAULT NULL,
86 `vim_tenant_id` varchar(256) DEFAULT NULL COMMENT 'Tenant ID at VIM',
87 `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,
90 `config` varchar(4000) DEFAULT NULL,
91 `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 --
100 -- Table structure for table `datacenters`
101 --
102
103 DROP TABLE IF EXISTS `datacenters`;
104 /*!40101 SET @saved_cs_client = @@character_set_client */;
105 /*!40101 SET character_set_client = utf8 */;
106 CREATE TABLE `datacenters` (
107 `uuid` varchar(36) NOT NULL,
108 `name` varchar(255) NOT NULL,
109 `description` varchar(255) DEFAULT NULL,
110 `type` varchar(36) NOT NULL DEFAULT 'openvim',
111 `vim_url` varchar(150) NOT NULL COMMENT 'URL of the VIM for the REST API',
112 `vim_url_admin` varchar(150) DEFAULT NULL,
113 `config` varchar(4000) DEFAULT NULL COMMENT 'extra config information in json',
114 `created_at` double NOT NULL,
115 `modified_at` double DEFAULT NULL,
116 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 --
122 -- Table structure for table `datacenters_flavors`
123 --
124
125 DROP TABLE IF EXISTS `datacenters_flavors`;
126 /*!40101 SET @saved_cs_client = @@character_set_client */;
127 /*!40101 SET character_set_client = utf8 */;
128 CREATE TABLE `datacenters_flavors` (
129 `id` int(11) NOT NULL AUTO_INCREMENT,
130 `flavor_id` varchar(36) NOT NULL,
131 `datacenter_vim_id` varchar(36) NOT NULL,
132 `vim_id` varchar(36) NOT NULL,
133 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
134 `vim_info` text,
135 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Indicates if it has been created by openmano, or already existed',
136 `extended` varchar(2000) DEFAULT NULL COMMENT 'Extra description json format of additional devices',
137 PRIMARY KEY (`id`),
138 KEY `FK__flavors` (`flavor_id`),
139 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
142 ) 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
149 DROP TABLE IF EXISTS `datacenters_images`;
150 /*!40101 SET @saved_cs_client = @@character_set_client */;
151 /*!40101 SET character_set_client = utf8 */;
152 CREATE TABLE `datacenters_images` (
153 `id` int(11) NOT NULL AUTO_INCREMENT,
154 `image_id` varchar(36) NOT NULL,
155 `datacenter_vim_id` varchar(36) NOT NULL,
156 `vim_id` varchar(36) NOT NULL,
157 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
158 `vim_info` text,
159 `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`),
162 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
165 ) 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
172 DROP TABLE IF EXISTS `flavors`;
173 /*!40101 SET @saved_cs_client = @@character_set_client */;
174 /*!40101 SET character_set_client = utf8 */;
175 CREATE 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,
180 `ram` mediumint(7) unsigned DEFAULT NULL,
181 `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
191 DROP TABLE IF EXISTS `images`;
192 /*!40101 SET @saved_cs_client = @@character_set_client */;
193 /*!40101 SET character_set_client = utf8 */;
194 CREATE TABLE `images` (
195 `uuid` varchar(36) NOT NULL,
196 `name` varchar(255) NOT NULL,
197 `universal_name` varchar(255) DEFAULT NULL,
198 `checksum` varchar(32) DEFAULT NULL,
199 `location` varchar(200) DEFAULT NULL,
200 `description` varchar(255) DEFAULT NULL,
201 `metadata` varchar(2000) DEFAULT NULL,
202 PRIMARY KEY (`uuid`),
203 UNIQUE KEY `location` (`location`),
204 UNIQUE KEY `universal_name_checksum` (`universal_name`,`checksum`)
205 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
206 /*!40101 SET character_set_client = @saved_cs_client */;
207
208 --
209 -- Table structure for table `instance_actions`
210 --
211
212 DROP TABLE IF EXISTS `instance_actions`;
213 /*!40101 SET @saved_cs_client = @@character_set_client */;
214 /*!40101 SET character_set_client = utf8 */;
215 CREATE 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 --
232 -- Table structure for table `instance_classifications`
233 --
234
235 DROP TABLE IF EXISTS `instance_classifications`;
236 /*!40101 SET @saved_cs_client = @@character_set_client */;
237 /*!40101 SET character_set_client = utf8 */;
238 CREATE TABLE `instance_classifications` (
239 `uuid` varchar(36) NOT NULL,
240 `instance_scenario_id` varchar(36) NOT NULL,
241 `vim_classification_id` varchar(36) DEFAULT NULL,
242 `sce_classifier_match_id` varchar(36) DEFAULT NULL,
243 `datacenter_id` varchar(36) DEFAULT NULL,
244 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
245 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
246 `error_msg` varchar(1024) DEFAULT NULL,
247 `vim_info` text,
248 `created_at` double NOT NULL,
249 `modified_at` double DEFAULT NULL,
250 PRIMARY KEY (`uuid`),
251 KEY `FK_instance_classifications_instance_scenarios` (`instance_scenario_id`),
252 KEY `FK_instance_classifications_sce_classifier_matches` (`sce_classifier_match_id`),
253 KEY `FK_instance_classifications_datacenters` (`datacenter_id`),
254 KEY `FK_instance_classifications_datacenter_tenants` (`datacenter_tenant_id`),
255 CONSTRAINT `FK_instance_classifications_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
256 CONSTRAINT `FK_instance_classifications_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
257 CONSTRAINT `FK_instance_classifications_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
258 CONSTRAINT `FK_instance_classifications_sce_classifier_matches` FOREIGN KEY (`sce_classifier_match_id`) REFERENCES `sce_classifier_matches` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
259 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
260 /*!40101 SET character_set_client = @saved_cs_client */;
261
262 --
263 -- Table structure for table `instance_interfaces`
264 --
265
266 DROP TABLE IF EXISTS `instance_interfaces`;
267 /*!40101 SET @saved_cs_client = @@character_set_client */;
268 /*!40101 SET character_set_client = utf8 */;
269 CREATE TABLE `instance_interfaces` (
270 `uuid` varchar(36) NOT NULL,
271 `instance_vm_id` varchar(36) NOT NULL,
272 `instance_net_id` varchar(36) NOT NULL,
273 `interface_id` varchar(36) DEFAULT NULL,
274 `vim_interface_id` varchar(128) DEFAULT NULL,
275 `mac_address` varchar(32) DEFAULT NULL,
276 `ip_address` varchar(64) DEFAULT NULL,
277 `vim_info` text,
278 `type` enum('internal','external') NOT NULL COMMENT 'Indicates if this interface is external to a vnf, or internal',
279 `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface',
280 `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled',
281 `sdn_port_id` varchar(36) DEFAULT NULL COMMENT 'Port id in ovim',
282 `compute_node` varchar(100) DEFAULT NULL COMMENT 'Compute node id used to specify the SDN port mapping',
283 `pci` varchar(50) DEFAULT NULL COMMENT 'PCI of the physical port in the host',
284 `vlan` smallint(5) unsigned DEFAULT NULL COMMENT 'VLAN tag used by the port',
285 PRIMARY KEY (`uuid`),
286 KEY `FK_instance_vms` (`instance_vm_id`),
287 KEY `FK_instance_nets` (`instance_net_id`),
288 KEY `FK_instance_ids` (`interface_id`),
289 CONSTRAINT `FK_instance_ids` FOREIGN KEY (`interface_id`) REFERENCES `interfaces` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
290 CONSTRAINT `FK_instance_nets` FOREIGN KEY (`instance_net_id`) REFERENCES `instance_nets` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
291 CONSTRAINT `FK_instance_vms` FOREIGN KEY (`instance_vm_id`) REFERENCES `instance_vms` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
292 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Table with all running associattion among VM instances and net instances';
293 /*!40101 SET character_set_client = @saved_cs_client */;
294
295 --
296 -- Table structure for table `instance_nets`
297 --
298
299 DROP TABLE IF EXISTS `instance_nets`;
300 /*!40101 SET @saved_cs_client = @@character_set_client */;
301 /*!40101 SET character_set_client = utf8 */;
302 CREATE TABLE `instance_nets` (
303 `uuid` varchar(36) NOT NULL,
304 `vim_net_id` varchar(128) DEFAULT NULL,
305 `vim_name` varchar(255) DEFAULT NULL,
306 `instance_scenario_id` varchar(36) DEFAULT NULL,
307 `sce_net_id` varchar(36) DEFAULT NULL,
308 `net_id` varchar(36) DEFAULT NULL,
309 `datacenter_id` varchar(36) DEFAULT NULL,
310 `datacenter_tenant_id` varchar(36) NOT NULL,
311 `status` enum('ACTIVE','INACTIVE','DOWN','BUILD','ERROR','VIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
312 `error_msg` varchar(1024) DEFAULT NULL,
313 `vim_info` text,
314 `multipoint` enum('true','false') NOT NULL DEFAULT 'true',
315 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Created or already exists at VIM',
316 `created_at` double NOT NULL,
317 `modified_at` double DEFAULT NULL,
318 `sdn_net_id` varchar(36) DEFAULT NULL COMMENT 'Network id in ovim',
319 PRIMARY KEY (`uuid`),
320 KEY `FK_instance_nets_instance_scenarios` (`instance_scenario_id`),
321 KEY `FK_instance_nets_sce_nets` (`sce_net_id`),
322 KEY `FK_instance_nets_nets` (`net_id`),
323 KEY `FK_instance_nets_datacenters` (`datacenter_id`),
324 KEY `FK_instance_nets_datacenter_tenants` (`datacenter_tenant_id`),
325 CONSTRAINT `FK_instance_nets_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
326 CONSTRAINT `FK_instance_nets_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
327 CONSTRAINT `FK_instance_nets_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
328 CONSTRAINT `FK_instance_nets_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
329 CONSTRAINT `FK_instance_nets_sce_nets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
330 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of networks';
331 /*!40101 SET character_set_client = @saved_cs_client */;
332
333 --
334 -- Table structure for table `instance_scenarios`
335 --
336
337 DROP TABLE IF EXISTS `instance_scenarios`;
338 /*!40101 SET @saved_cs_client = @@character_set_client */;
339 /*!40101 SET character_set_client = utf8 */;
340 CREATE TABLE `instance_scenarios` (
341 `uuid` varchar(36) NOT NULL,
342 `name` varchar(255) NOT NULL,
343 `tenant_id` varchar(36) DEFAULT NULL,
344 `scenario_id` varchar(36) DEFAULT NULL,
345 `datacenter_id` varchar(36) NOT NULL,
346 `datacenter_tenant_id` varchar(36) NOT NULL,
347 `description` varchar(255) DEFAULT NULL,
348 `created_at` double NOT NULL,
349 `modified_at` double DEFAULT NULL,
350 `cloud_config` mediumtext,
351 PRIMARY KEY (`uuid`),
352 KEY `FK_scenarios_nfvo_tenants` (`tenant_id`),
353 KEY `FK_instance_scenarios_vim_tenants` (`datacenter_tenant_id`),
354 KEY `FK_instance_scenarios_datacenters` (`datacenter_id`),
355 KEY `FK_instance_scenarios_scenarios` (`scenario_id`),
356 CONSTRAINT `FK_instance_scenarios_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
357 CONSTRAINT `FK_instance_scenarios_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
358 CONSTRAINT `FK_instance_scenarios_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`),
359 CONSTRAINT `FK_instance_scenarios_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
360 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of scenarios defined by the user';
361 /*!40101 SET character_set_client = @saved_cs_client */;
362
363 --
364 -- Table structure for table `instance_sfis`
365 --
366
367 DROP TABLE IF EXISTS `instance_sfis`;
368 /*!40101 SET @saved_cs_client = @@character_set_client */;
369 /*!40101 SET character_set_client = utf8 */;
370 CREATE TABLE `instance_sfis` (
371 `uuid` varchar(36) NOT NULL,
372 `instance_scenario_id` varchar(36) NOT NULL,
373 `vim_sfi_id` varchar(36) DEFAULT NULL,
374 `sce_rsp_hop_id` varchar(36) DEFAULT NULL,
375 `datacenter_id` varchar(36) DEFAULT NULL,
376 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
377 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
378 `error_msg` varchar(1024) DEFAULT NULL,
379 `vim_info` text,
380 `created_at` double NOT NULL,
381 `modified_at` double DEFAULT NULL,
382 PRIMARY KEY (`uuid`),
383 KEY `FK_instance_sfis_instance_scenarios` (`instance_scenario_id`),
384 KEY `FK_instance_sfis_sce_rsp_hops` (`sce_rsp_hop_id`),
385 KEY `FK_instance_sfis_datacenters` (`datacenter_id`),
386 KEY `FK_instance_sfis_datacenter_tenants` (`datacenter_tenant_id`),
387 CONSTRAINT `FK_instance_sfis_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
388 CONSTRAINT `FK_instance_sfis_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
389 CONSTRAINT `FK_instance_sfis_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
390 CONSTRAINT `FK_instance_sfis_sce_rsp_hops` FOREIGN KEY (`sce_rsp_hop_id`) REFERENCES `sce_rsp_hops` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
391 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
392 /*!40101 SET character_set_client = @saved_cs_client */;
393
394 --
395 -- Table structure for table `instance_sfps`
396 --
397
398 DROP TABLE IF EXISTS `instance_sfps`;
399 /*!40101 SET @saved_cs_client = @@character_set_client */;
400 /*!40101 SET character_set_client = utf8 */;
401 CREATE TABLE `instance_sfps` (
402 `uuid` varchar(36) NOT NULL,
403 `instance_scenario_id` varchar(36) NOT NULL,
404 `vim_sfp_id` varchar(36) DEFAULT NULL,
405 `sce_rsp_id` varchar(36) DEFAULT NULL,
406 `datacenter_id` varchar(36) DEFAULT NULL,
407 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
408 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
409 `error_msg` varchar(1024) DEFAULT NULL,
410 `vim_info` text,
411 `created_at` double NOT NULL,
412 `modified_at` double DEFAULT NULL,
413 PRIMARY KEY (`uuid`),
414 KEY `FK_instance_sfps_instance_scenarios` (`instance_scenario_id`),
415 KEY `FK_instance_sfps_sce_rsps` (`sce_rsp_id`),
416 KEY `FK_instance_sfps_datacenters` (`datacenter_id`),
417 KEY `FK_instance_sfps_datacenter_tenants` (`datacenter_tenant_id`),
418 CONSTRAINT `FK_instance_sfps_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
419 CONSTRAINT `FK_instance_sfps_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
420 CONSTRAINT `FK_instance_sfps_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
421 CONSTRAINT `FK_instance_sfps_sce_rsps` FOREIGN KEY (`sce_rsp_id`) REFERENCES `sce_rsps` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
422 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
423 /*!40101 SET character_set_client = @saved_cs_client */;
424
425 --
426 -- Table structure for table `instance_sfs`
427 --
428
429 DROP TABLE IF EXISTS `instance_sfs`;
430 /*!40101 SET @saved_cs_client = @@character_set_client */;
431 /*!40101 SET character_set_client = utf8 */;
432 CREATE TABLE `instance_sfs` (
433 `uuid` varchar(36) NOT NULL,
434 `instance_scenario_id` varchar(36) NOT NULL,
435 `vim_sf_id` varchar(36) DEFAULT NULL,
436 `sce_rsp_hop_id` varchar(36) DEFAULT NULL,
437 `datacenter_id` varchar(36) DEFAULT NULL,
438 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
439 `status` enum('ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
440 `error_msg` varchar(1024) DEFAULT NULL,
441 `vim_info` text,
442 `created_at` double NOT NULL,
443 `modified_at` double DEFAULT NULL,
444 PRIMARY KEY (`uuid`),
445 KEY `FK_instance_sfs_instance_scenarios` (`instance_scenario_id`),
446 KEY `FK_instance_sfs_sce_rsp_hops` (`sce_rsp_hop_id`),
447 KEY `FK_instance_sfs_datacenters` (`datacenter_id`),
448 KEY `FK_instance_sfs_datacenter_tenants` (`datacenter_tenant_id`),
449 CONSTRAINT `FK_instance_sfs_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
450 CONSTRAINT `FK_instance_sfs_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
451 CONSTRAINT `FK_instance_sfs_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
452 CONSTRAINT `FK_instance_sfs_sce_rsp_hops` FOREIGN KEY (`sce_rsp_hop_id`) REFERENCES `sce_rsp_hops` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
453 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
454 /*!40101 SET character_set_client = @saved_cs_client */;
455
456 --
457 -- Table structure for table `instance_vms`
458 --
459
460 DROP TABLE IF EXISTS `instance_vms`;
461 /*!40101 SET @saved_cs_client = @@character_set_client */;
462 /*!40101 SET character_set_client = utf8 */;
463 CREATE TABLE `instance_vms` (
464 `uuid` varchar(36) NOT NULL,
465 `instance_vnf_id` varchar(36) NOT NULL,
466 `vm_id` varchar(36) DEFAULT NULL,
467 `vim_vm_id` varchar(128) DEFAULT NULL,
468 `vim_name` varchar(255) DEFAULT NULL,
469 `status` enum('ACTIVE:NoMgmtIP','ACTIVE','INACTIVE','BUILD','ERROR','VIM_ERROR','PAUSED','SUSPENDED','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
470 `error_msg` varchar(1024) DEFAULT NULL,
471 `vim_info` text,
472 `created_at` double NOT NULL,
473 `modified_at` double DEFAULT NULL,
474 PRIMARY KEY (`uuid`),
475 UNIQUE KEY `vim_vm_id` (`vim_vm_id`),
476 KEY `FK_instance_vms_vms` (`vm_id`),
477 KEY `FK_instance_vms_instance_vnfs` (`instance_vnf_id`),
478 CONSTRAINT `FK_instance_vms_instance_vnfs` FOREIGN KEY (`instance_vnf_id`) REFERENCES `instance_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
479 CONSTRAINT `FK_instance_vms_vms` FOREIGN KEY (`vm_id`) REFERENCES `vms` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
480 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of VMs as part of VNF instances';
481 /*!40101 SET character_set_client = @saved_cs_client */;
482
483 --
484 -- Table structure for table `instance_vnfs`
485 --
486
487 DROP TABLE IF EXISTS `instance_vnfs`;
488 /*!40101 SET @saved_cs_client = @@character_set_client */;
489 /*!40101 SET character_set_client = utf8 */;
490 CREATE TABLE `instance_vnfs` (
491 `uuid` varchar(36) NOT NULL,
492 `instance_scenario_id` varchar(36) NOT NULL,
493 `vnf_id` varchar(36) NOT NULL,
494 `sce_vnf_id` varchar(36) DEFAULT NULL,
495 `datacenter_id` varchar(36) DEFAULT NULL,
496 `datacenter_tenant_id` varchar(36) DEFAULT NULL,
497 `created_at` double NOT NULL,
498 `modified_at` double DEFAULT NULL,
499 PRIMARY KEY (`uuid`),
500 KEY `FK_instance_vnfs_vnfs` (`vnf_id`),
501 KEY `FK_instance_vnfs_instance_scenarios` (`instance_scenario_id`),
502 KEY `FK_instance_vnfs_sce_vnfs` (`sce_vnf_id`),
503 KEY `FK_instance_vnfs_datacenters` (`datacenter_id`),
504 KEY `FK_instance_vnfs_datacenter_tenants` (`datacenter_tenant_id`),
505 CONSTRAINT `FK_instance_vnfs_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
506 CONSTRAINT `FK_instance_vnfs_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
507 CONSTRAINT `FK_instance_vnfs_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
508 CONSTRAINT `FK_instance_vnfs_sce_vnfs` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
509 CONSTRAINT `FK_instance_vnfs_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`)
510 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of VNFs as part of a scenario';
511 /*!40101 SET character_set_client = @saved_cs_client */;
512
513 --
514 -- Table structure for table `instance_wim_nets`
515 --
516
517 DROP TABLE IF EXISTS `instance_wim_nets`;
518 /*!40101 SET @saved_cs_client = @@character_set_client */;
519 /*!40101 SET character_set_client = utf8 */;
520 CREATE TABLE `instance_wim_nets` (
521 `uuid` varchar(36) NOT NULL,
522 `wim_internal_id` varchar(128) DEFAULT NULL COMMENT 'Internal ID used by the WIM to refer to the network',
523 `instance_scenario_id` varchar(36) DEFAULT NULL,
524 `sce_net_id` varchar(36) DEFAULT NULL,
525 `wim_id` varchar(36) DEFAULT NULL,
526 `wim_account_id` varchar(36) NOT NULL,
527 `status` enum('ACTIVE','INACTIVE','DOWN','BUILD','ERROR','WIM_ERROR','DELETED','SCHEDULED_CREATION','SCHEDULED_DELETION') NOT NULL DEFAULT 'BUILD',
528 `error_msg` varchar(1024) DEFAULT NULL,
529 `wim_info` text,
530 `multipoint` enum('true','false') NOT NULL DEFAULT 'false',
531 `created` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'Created or already exists at WIM',
532 `created_at` double NOT NULL,
533 `modified_at` double DEFAULT NULL,
534 PRIMARY KEY (`uuid`),
535 KEY `FK_instance_wim_nets_instance_scenarios` (`instance_scenario_id`),
536 KEY `FK_instance_wim_nets_sce_nets` (`sce_net_id`),
537 KEY `FK_instance_wim_nets_wims` (`wim_id`),
538 KEY `FK_instance_wim_nets_wim_accounts` (`wim_account_id`),
539 CONSTRAINT `FK_instance_wim_nets_instance_scenarios` FOREIGN KEY (`instance_scenario_id`) REFERENCES `instance_scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
540 CONSTRAINT `FK_instance_wim_nets_sce_nets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE,
541 CONSTRAINT `FK_instance_wim_nets_wim_accounts` FOREIGN KEY (`wim_account_id`) REFERENCES `wim_accounts` (`uuid`),
542 CONSTRAINT `FK_instance_wim_nets_wims` FOREIGN KEY (`wim_id`) REFERENCES `wims` (`uuid`)
543 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Instances of wim networks';
544 /*!40101 SET character_set_client = @saved_cs_client */;
545
546 --
547 -- Table structure for table `interfaces`
548 --
549
550 DROP TABLE IF EXISTS `interfaces`;
551 /*!40101 SET @saved_cs_client = @@character_set_client */;
552 /*!40101 SET character_set_client = utf8 */;
553 CREATE TABLE `interfaces` (
554 `uuid` varchar(36) NOT NULL,
555 `internal_name` varchar(255) NOT NULL,
556 `external_name` varchar(255) DEFAULT NULL,
557 `vm_id` varchar(36) NOT NULL,
558 `net_id` varchar(36) DEFAULT NULL,
559 `type` enum('mgmt','bridge','data') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
560 `vpci` char(12) DEFAULT NULL,
561 `bw` mediumint(8) unsigned DEFAULT NULL COMMENT 'BW expressed in Mbits/s. Maybe this field is not necessary.',
562 `created_at` double NOT NULL,
563 `modified_at` double DEFAULT NULL,
564 `model` varchar(12) DEFAULT NULL,
565 `mac` char(18) DEFAULT NULL,
566 `ip_address` varchar(64) DEFAULT NULL,
567 `floating_ip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicates if a floating_ip must be associated to this interface',
568 `port_security` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Indicates if port security must be enabled or disabled. By default it is enabled',
569 PRIMARY KEY (`uuid`),
570 UNIQUE KEY `internal_name_vm_id` (`internal_name`,`vm_id`),
571 KEY `FK_interfaces_vms` (`vm_id`),
572 KEY `FK_interfaces_nets` (`net_id`),
573 CONSTRAINT `FK_interfaces_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE CASCADE,
574 CONSTRAINT `FK_interfaces_vms` FOREIGN KEY (`vm_id`) REFERENCES `vms` (`uuid`) ON DELETE CASCADE
575 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VM interfaces';
576 /*!40101 SET character_set_client = @saved_cs_client */;
577
578 --
579 -- Table structure for table `ip_profiles`
580 --
581
582 DROP TABLE IF EXISTS `ip_profiles`;
583 /*!40101 SET @saved_cs_client = @@character_set_client */;
584 /*!40101 SET character_set_client = utf8 */;
585 CREATE TABLE `ip_profiles` (
586 `id` int(11) NOT NULL AUTO_INCREMENT,
587 `net_id` varchar(36) DEFAULT NULL,
588 `sce_net_id` varchar(36) DEFAULT NULL,
589 `instance_net_id` varchar(36) DEFAULT NULL,
590 `ip_version` enum('IPv4','IPv6') NOT NULL DEFAULT 'IPv4',
591 `subnet_address` varchar(64) DEFAULT NULL,
592 `gateway_address` varchar(64) DEFAULT NULL,
593 `dns_address` varchar(255) DEFAULT NULL COMMENT 'dns ip list separated by semicolon',
594 `dhcp_enabled` enum('true','false') NOT NULL DEFAULT 'true',
595 `dhcp_start_address` varchar(64) DEFAULT NULL,
596 `dhcp_count` int(11) DEFAULT NULL,
597 `security_group` varchar(255) DEFAULT NULL,
598 PRIMARY KEY (`id`),
599 KEY `FK_ipprofiles_nets` (`net_id`),
600 KEY `FK_ipprofiles_scenets` (`sce_net_id`),
601 KEY `FK_ipprofiles_instancenets` (`instance_net_id`),
602 CONSTRAINT `FK_ipprofiles_instancenets` FOREIGN KEY (`instance_net_id`) REFERENCES `instance_nets` (`uuid`) ON DELETE CASCADE,
603 CONSTRAINT `FK_ipprofiles_nets` FOREIGN KEY (`net_id`) REFERENCES `nets` (`uuid`) ON DELETE CASCADE,
604 CONSTRAINT `FK_ipprofiles_scenets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE CASCADE
605 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table containing the IP parameters of a network, either a net, a sce_net or and instance_net.';
606 /*!40101 SET character_set_client = @saved_cs_client */;
607
608 --
609 -- Table structure for table `logs`
610 --
611
612 DROP TABLE IF EXISTS `logs`;
613 /*!40101 SET @saved_cs_client = @@character_set_client */;
614 /*!40101 SET character_set_client = utf8 */;
615 CREATE TABLE `logs` (
616 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
617 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
618 `nfvo_tenant_id` varchar(36) DEFAULT NULL,
619 `related` varchar(36) NOT NULL COMMENT 'Relevant element for the log',
620 `uuid` varchar(36) DEFAULT NULL COMMENT 'Uuid of vnf, scenario, etc. that log relates to',
621 `level` enum('panic','error','info','debug','verbose') NOT NULL,
622 `description` varchar(200) NOT NULL,
623 PRIMARY KEY (`id`)
624 ) ENGINE=InnoDB AUTO_INCREMENT=3423 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
625 /*!40101 SET character_set_client = @saved_cs_client */;
626
627 --
628 -- Table structure for table `nets`
629 --
630
631 DROP TABLE IF EXISTS `nets`;
632 /*!40101 SET @saved_cs_client = @@character_set_client */;
633 /*!40101 SET character_set_client = utf8 */;
634 CREATE TABLE `nets` (
635 `uuid` varchar(36) NOT NULL,
636 `osm_id` varchar(255) DEFAULT NULL,
637 `vnf_id` varchar(36) NOT NULL,
638 `name` varchar(255) NOT NULL,
639 `type` enum('bridge','data','ptp') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
640 `multipoint` enum('true','false') NOT NULL DEFAULT 'false',
641 `description` varchar(255) DEFAULT NULL,
642 `created_at` double NOT NULL,
643 `modified_at` double DEFAULT NULL,
644 PRIMARY KEY (`uuid`),
645 UNIQUE KEY `vnf_id_name` (`vnf_id`,`name`),
646 CONSTRAINT `FK_nets_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`) ON DELETE CASCADE
647 ) 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.';
648 /*!40101 SET character_set_client = @saved_cs_client */;
649
650 --
651 -- Table structure for table `nfvo_tenants`
652 --
653
654 DROP TABLE IF EXISTS `nfvo_tenants`;
655 /*!40101 SET @saved_cs_client = @@character_set_client */;
656 /*!40101 SET character_set_client = utf8 */;
657 CREATE TABLE `nfvo_tenants` (
658 `uuid` varchar(36) NOT NULL,
659 `name` varchar(255) NOT NULL,
660 `description` varchar(255) DEFAULT NULL,
661 `encrypted_RO_priv_key` varchar(2000) DEFAULT NULL,
662 `RO_pub_key` varchar(510) DEFAULT NULL,
663 `created_at` double NOT NULL,
664 `modified_at` double DEFAULT NULL,
665 PRIMARY KEY (`uuid`),
666 UNIQUE KEY `name` (`name`)
667 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
668 /*!40101 SET character_set_client = @saved_cs_client */;
669
670 --
671 -- Table structure for table `sce_classifier_matches`
672 --
673
674 DROP TABLE IF EXISTS `sce_classifier_matches`;
675 /*!40101 SET @saved_cs_client = @@character_set_client */;
676 /*!40101 SET character_set_client = utf8 */;
677 CREATE TABLE `sce_classifier_matches` (
678 `uuid` varchar(36) NOT NULL,
679 `ip_proto` varchar(2) NOT NULL,
680 `source_ip` varchar(16) NOT NULL,
681 `destination_ip` varchar(16) NOT NULL,
682 `source_port` varchar(5) NOT NULL,
683 `destination_port` varchar(5) NOT NULL,
684 `sce_classifier_id` varchar(36) NOT NULL,
685 `created_at` double NOT NULL,
686 `modified_at` double DEFAULT NULL,
687 PRIMARY KEY (`uuid`),
688 KEY `FK_classifiers_classifier_match` (`sce_classifier_id`),
689 CONSTRAINT `FK_sce_classifiers_classifier_match` FOREIGN KEY (`sce_classifier_id`) REFERENCES `sce_classifiers` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
690 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
691 /*!40101 SET character_set_client = @saved_cs_client */;
692
693 --
694 -- Table structure for table `sce_classifiers`
695 --
696
697 DROP TABLE IF EXISTS `sce_classifiers`;
698 /*!40101 SET @saved_cs_client = @@character_set_client */;
699 /*!40101 SET character_set_client = utf8 */;
700 CREATE TABLE `sce_classifiers` (
701 `uuid` varchar(36) NOT NULL,
702 `tenant_id` varchar(36) DEFAULT NULL,
703 `name` varchar(255) NOT NULL,
704 `sce_vnffg_id` varchar(36) NOT NULL,
705 `sce_rsp_id` varchar(36) NOT NULL,
706 `sce_vnf_id` varchar(36) NOT NULL,
707 `interface_id` varchar(36) NOT NULL,
708 `created_at` double NOT NULL,
709 `modified_at` double DEFAULT NULL,
710 PRIMARY KEY (`uuid`),
711 KEY `FK_sce_vnffgs_classifier` (`sce_vnffg_id`),
712 KEY `FK_sce_rsps_classifier` (`sce_rsp_id`),
713 KEY `FK_sce_vnfs_classifier` (`sce_vnf_id`),
714 KEY `FK_interfaces_classifier` (`interface_id`),
715 CONSTRAINT `FK_interfaces_classifier` FOREIGN KEY (`interface_id`) REFERENCES `interfaces` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
716 CONSTRAINT `FK_sce_rsps_classifier` FOREIGN KEY (`sce_rsp_id`) REFERENCES `sce_rsps` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
717 CONSTRAINT `FK_sce_vnffgs_classifier` FOREIGN KEY (`sce_vnffg_id`) REFERENCES `sce_vnffgs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
718 CONSTRAINT `FK_sce_vnfs_classifier` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
719 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
720 /*!40101 SET character_set_client = @saved_cs_client */;
721
722 --
723 -- Table structure for table `sce_interfaces`
724 --
725
726 DROP TABLE IF EXISTS `sce_interfaces`;
727 /*!40101 SET @saved_cs_client = @@character_set_client */;
728 /*!40101 SET character_set_client = utf8 */;
729 CREATE TABLE `sce_interfaces` (
730 `uuid` varchar(36) NOT NULL,
731 `sce_vnf_id` varchar(36) NOT NULL,
732 `sce_net_id` varchar(36) DEFAULT NULL,
733 `interface_id` varchar(36) DEFAULT NULL,
734 `ip_address` varchar(64) DEFAULT NULL,
735 `created_at` double NOT NULL,
736 `modified_at` double DEFAULT NULL,
737 PRIMARY KEY (`uuid`),
738 KEY `FK_sce_interfaces_sce_vnfs` (`sce_vnf_id`),
739 KEY `FK_sce_interfaces_sce_nets` (`sce_net_id`),
740 KEY `FK_sce_interfaces_interfaces` (`interface_id`),
741 CONSTRAINT `FK_sce_interfaces_interfaces` FOREIGN KEY (`interface_id`) REFERENCES `interfaces` (`uuid`),
742 CONSTRAINT `FK_sce_interfaces_sce_nets` FOREIGN KEY (`sce_net_id`) REFERENCES `sce_nets` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
743 CONSTRAINT `FK_sce_interfaces_sce_vnfs` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
744 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VNF interfaces in a scenario definition.';
745 /*!40101 SET character_set_client = @saved_cs_client */;
746
747 --
748 -- Table structure for table `sce_nets`
749 --
750
751 DROP TABLE IF EXISTS `sce_nets`;
752 /*!40101 SET @saved_cs_client = @@character_set_client */;
753 /*!40101 SET character_set_client = utf8 */;
754 CREATE TABLE `sce_nets` (
755 `uuid` varchar(36) NOT NULL,
756 `osm_id` varchar(255) DEFAULT NULL,
757 `name` varchar(255) NOT NULL,
758 `scenario_id` varchar(36) DEFAULT NULL COMMENT 'NULL if net is matched to several scenarios',
759 `type` enum('bridge','data','ptp') NOT NULL DEFAULT 'data' COMMENT 'Type of network',
760 `multipoint` enum('true','false') NOT NULL DEFAULT 'true',
761 `external` enum('true','false') NOT NULL DEFAULT 'false' COMMENT 'If external, net is already present at VIM',
762 `description` varchar(255) DEFAULT NULL,
763 `vim_network_name` varchar(255) DEFAULT NULL,
764 `created_at` double NOT NULL,
765 `modified_at` double DEFAULT NULL,
766 `graph` varchar(2000) DEFAULT NULL,
767 PRIMARY KEY (`uuid`),
768 KEY `FK_sce_nets_scenarios` (`scenario_id`),
769 CONSTRAINT `FK_sce_nets_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
770 ) 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''.';
771 /*!40101 SET character_set_client = @saved_cs_client */;
772
773 --
774 -- Table structure for table `sce_rsp_hops`
775 --
776
777 DROP TABLE IF EXISTS `sce_rsp_hops`;
778 /*!40101 SET @saved_cs_client = @@character_set_client */;
779 /*!40101 SET character_set_client = utf8 */;
780 CREATE TABLE `sce_rsp_hops` (
781 `uuid` varchar(36) NOT NULL,
782 `if_order` int(11) NOT NULL DEFAULT '0',
783 `ingress_interface_id` varchar(36) NOT NULL,
784 `egress_interface_id` varchar(36) NOT NULL,
785 `sce_vnf_id` varchar(36) NOT NULL,
786 `sce_rsp_id` varchar(36) NOT NULL,
787 `created_at` double NOT NULL,
788 `modified_at` double DEFAULT NULL,
789 PRIMARY KEY (`uuid`),
790 KEY `FK_interfaces_rsp_hop` (`ingress_interface_id`),
791 KEY `FK_sce_vnfs_rsp_hop` (`sce_vnf_id`),
792 KEY `FK_sce_rsps_rsp_hop` (`sce_rsp_id`),
793 KEY `FK_interfaces_rsp_hop_egress` (`egress_interface_id`),
794 CONSTRAINT `FK_interfaces_rsp_hop_egress` FOREIGN KEY (`egress_interface_id`) REFERENCES `interfaces` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
795 CONSTRAINT `FK_interfaces_rsp_hop_ingress` FOREIGN KEY (`ingress_interface_id`) REFERENCES `interfaces` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
796 CONSTRAINT `FK_sce_rsps_rsp_hop` FOREIGN KEY (`sce_rsp_id`) REFERENCES `sce_rsps` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
797 CONSTRAINT `FK_sce_vnfs_rsp_hop` FOREIGN KEY (`sce_vnf_id`) REFERENCES `sce_vnfs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
798 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
799 /*!40101 SET character_set_client = @saved_cs_client */;
800
801 --
802 -- Table structure for table `sce_rsps`
803 --
804
805 DROP TABLE IF EXISTS `sce_rsps`;
806 /*!40101 SET @saved_cs_client = @@character_set_client */;
807 /*!40101 SET character_set_client = utf8 */;
808 CREATE TABLE `sce_rsps` (
809 `uuid` varchar(36) NOT NULL,
810 `tenant_id` varchar(36) DEFAULT NULL,
811 `name` varchar(255) NOT NULL,
812 `sce_vnffg_id` varchar(36) NOT NULL,
813 `created_at` double NOT NULL,
814 `modified_at` double DEFAULT NULL,
815 PRIMARY KEY (`uuid`),
816 KEY `FK_sce_vnffgs_rsp` (`sce_vnffg_id`),
817 CONSTRAINT `FK_sce_vnffgs_rsp` FOREIGN KEY (`sce_vnffg_id`) REFERENCES `sce_vnffgs` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
818 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
819 /*!40101 SET character_set_client = @saved_cs_client */;
820
821 --
822 -- Table structure for table `sce_vnffgs`
823 --
824
825 DROP TABLE IF EXISTS `sce_vnffgs`;
826 /*!40101 SET @saved_cs_client = @@character_set_client */;
827 /*!40101 SET character_set_client = utf8 */;
828 CREATE TABLE `sce_vnffgs` (
829 `uuid` varchar(36) NOT NULL,
830 `tenant_id` varchar(36) DEFAULT NULL,
831 `name` varchar(255) NOT NULL,
832 `description` varchar(255) DEFAULT NULL,
833 `vendor` varchar(255) DEFAULT NULL,
834 `scenario_id` varchar(36) NOT NULL,
835 `created_at` double NOT NULL,
836 `modified_at` double DEFAULT NULL,
837 PRIMARY KEY (`uuid`),
838 KEY `FK_scenarios_sce_vnffg` (`scenario_id`),
839 KEY `FK_scenarios_vnffg` (`tenant_id`),
840 CONSTRAINT `FK_scenarios_vnffg` FOREIGN KEY (`tenant_id`) REFERENCES `scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
841 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
842 /*!40101 SET character_set_client = @saved_cs_client */;
843
844 --
845 -- Table structure for table `sce_vnfs`
846 --
847
848 DROP TABLE IF EXISTS `sce_vnfs`;
849 /*!40101 SET @saved_cs_client = @@character_set_client */;
850 /*!40101 SET character_set_client = utf8 */;
851 CREATE TABLE `sce_vnfs` (
852 `uuid` varchar(36) NOT NULL,
853 `member_vnf_index` varchar(255) DEFAULT NULL,
854 `name` varchar(255) NOT NULL,
855 `scenario_id` varchar(36) NOT NULL,
856 `vnf_id` varchar(36) NOT NULL,
857 `description` varchar(255) DEFAULT NULL,
858 `created_at` double NOT NULL,
859 `modified_at` double DEFAULT NULL,
860 `graph` varchar(2000) DEFAULT NULL,
861 PRIMARY KEY (`uuid`),
862 UNIQUE KEY `name_scenario_id` (`name`,`scenario_id`),
863 KEY `FK_sce_vnfs_scenarios` (`scenario_id`),
864 KEY `FK_sce_vnfs_vnfs` (`vnf_id`),
865 CONSTRAINT `FK_sce_vnfs_scenarios` FOREIGN KEY (`scenario_id`) REFERENCES `scenarios` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
866 CONSTRAINT `FK_sce_vnfs_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`)
867 ) 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';
868 /*!40101 SET character_set_client = @saved_cs_client */;
869
870 --
871 -- Table structure for table `scenarios`
872 --
873
874 DROP TABLE IF EXISTS `scenarios`;
875 /*!40101 SET @saved_cs_client = @@character_set_client */;
876 /*!40101 SET character_set_client = utf8 */;
877 CREATE TABLE `scenarios` (
878 `uuid` varchar(36) NOT NULL,
879 `osm_id` varchar(255) DEFAULT NULL,
880 `name` varchar(255) NOT NULL,
881 `short_name` varchar(255) DEFAULT NULL,
882 `tenant_id` varchar(36) DEFAULT NULL,
883 `description` varchar(255) DEFAULT NULL,
884 `vendor` varchar(255) DEFAULT NULL,
885 `public` enum('true','false') NOT NULL DEFAULT 'false',
886 `created_at` double NOT NULL,
887 `modified_at` double DEFAULT NULL,
888 `descriptor` text COMMENT 'Original text descriptor used for create the scenario',
889 `cloud_config` mediumtext,
890 PRIMARY KEY (`uuid`),
891 UNIQUE KEY `osm_id_tenant_id` (`osm_id`,`tenant_id`),
892 KEY `FK_scenarios_nfvo_tenants` (`tenant_id`),
893 CONSTRAINT `FK_scenarios_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`)
894 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
895 /*!40101 SET character_set_client = @saved_cs_client */;
896
897 --
898 -- Table structure for table `schema_version`
899 --
900
901 DROP TABLE IF EXISTS `schema_version`;
902 /*!40101 SET @saved_cs_client = @@character_set_client */;
903 /*!40101 SET character_set_client = utf8 */;
904 CREATE TABLE `schema_version` (
905 `version_int` int(11) NOT NULL COMMENT 'version as a number. Must not contain gaps',
906 `version` varchar(20) NOT NULL COMMENT 'version as a text',
907 `openmano_ver` varchar(20) NOT NULL COMMENT 'openmano version',
908 `comments` varchar(2000) DEFAULT NULL COMMENT 'changes to database',
909 `date` date DEFAULT NULL,
910 PRIMARY KEY (`version_int`)
911 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='database schema control version';
912 /*!40101 SET character_set_client = @saved_cs_client */;
913
914 --
915 -- Table structure for table `tenants_datacenters`
916 --
917
918 DROP TABLE IF EXISTS `tenants_datacenters`;
919 /*!40101 SET @saved_cs_client = @@character_set_client */;
920 /*!40101 SET character_set_client = utf8 */;
921 CREATE TABLE `tenants_datacenters` (
922 `id` int(11) NOT NULL AUTO_INCREMENT,
923 `nfvo_tenant_id` varchar(36) NOT NULL,
924 `datacenter_id` varchar(36) NOT NULL,
925 `datacenter_tenant_id` varchar(36) NOT NULL,
926 `created_at` double NOT NULL,
927 `modified_at` double DEFAULT NULL,
928 PRIMARY KEY (`id`),
929 UNIQUE KEY `datacenter_nfvo_tenant` (`datacenter_id`,`nfvo_tenant_id`),
930 KEY `FK_nfvo_tenants_datacenters` (`datacenter_id`),
931 KEY `FK_nfvo_tenants_vim_tenants` (`datacenter_tenant_id`),
932 KEY `FK_tenants_datacenters_nfvo_tenants` (`nfvo_tenant_id`),
933 CONSTRAINT `FK_tenants_datacenters_datacenter_tenants` FOREIGN KEY (`datacenter_tenant_id`) REFERENCES `datacenter_tenants` (`uuid`),
934 CONSTRAINT `FK_tenants_datacenters_datacenters` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`),
935 CONSTRAINT `FK_tenants_datacenters_nfvo_tenants` FOREIGN KEY (`nfvo_tenant_id`) REFERENCES `nfvo_tenants` (`uuid`)
936 ) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Scenarios defined by the user';
937 /*!40101 SET character_set_client = @saved_cs_client */;
938
939 --
940 -- Table structure for table `uuids`
941 --
942
943 DROP TABLE IF EXISTS `uuids`;
944 /*!40101 SET @saved_cs_client = @@character_set_client */;
945 /*!40101 SET character_set_client = utf8 */;
946 CREATE TABLE `uuids` (
947 `uuid` varchar(36) NOT NULL,
948 `root_uuid` varchar(36) DEFAULT NULL COMMENT 'Some related UUIDs can be grouped by this field, so that they can be deleted at once',
949 `created_at` double NOT NULL,
950 `used_at` varchar(36) DEFAULT NULL COMMENT 'Table that uses this UUID',
951 PRIMARY KEY (`uuid`)
952 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table with all unique IDs used to avoid UUID repetitions among different elements';
953 /*!40101 SET character_set_client = @saved_cs_client */;
954
955 --
956 -- Table structure for table `vim_wim_actions`
957 --
958
959 DROP TABLE IF EXISTS `vim_wim_actions`;
960 /*!40101 SET @saved_cs_client = @@character_set_client */;
961 /*!40101 SET character_set_client = utf8 */;
962 CREATE TABLE `vim_wim_actions` (
963 `instance_action_id` varchar(36) NOT NULL,
964 `task_index` int(6) NOT NULL,
965 `datacenter_vim_id` varchar(36) DEFAULT NULL,
966 `vim_id` varchar(64) DEFAULT NULL,
967 `wim_account_id` varchar(36) DEFAULT NULL,
968 `wim_internal_id` varchar(64) DEFAULT NULL,
969 `action` varchar(36) NOT NULL COMMENT 'CREATE,DELETE,START,STOP...',
970 `item` enum('datacenters_flavors','datacenter_images','instance_nets','instance_vms','instance_interfaces','instance_wim_nets') NOT NULL COMMENT 'table where the item is stored',
971 `item_id` varchar(36) DEFAULT NULL COMMENT 'uuid of the entry in the table',
972 `status` enum('SCHEDULED','BUILD','DONE','FAILED','SUPERSEDED') NOT NULL DEFAULT 'SCHEDULED',
973 `extra` text COMMENT 'json with params:, depends_on: for the task',
974 `error_msg` varchar(1024) DEFAULT NULL,
975 `created_at` double NOT NULL,
976 `modified_at` double DEFAULT NULL,
977 PRIMARY KEY (`task_index`,`instance_action_id`),
978 KEY `FK_actions_instance_actions` (`instance_action_id`),
979 KEY `FK_actions_vims` (`datacenter_vim_id`),
980 KEY `item_type_id` (`item`,`item_id`),
981 KEY `FK_actions_wims` (`wim_account_id`),
982 CONSTRAINT `FK_actions_instance_actions` FOREIGN KEY (`instance_action_id`) REFERENCES `instance_actions` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
983 CONSTRAINT `FK_actions_vims` FOREIGN KEY (`datacenter_vim_id`) REFERENCES `datacenter_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
984 CONSTRAINT `FK_actions_wims` FOREIGN KEY (`wim_account_id`) REFERENCES `wim_accounts` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
985 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table with the individual VIM actions.';
986 /*!40101 SET character_set_client = @saved_cs_client */;
987
988 --
989 -- Table structure for table `vms`
990 --
991
992 DROP TABLE IF EXISTS `vms`;
993 /*!40101 SET @saved_cs_client = @@character_set_client */;
994 /*!40101 SET character_set_client = utf8 */;
995 CREATE TABLE `vms` (
996 `uuid` varchar(36) NOT NULL,
997 `osm_id` varchar(255) DEFAULT NULL,
998 `pdu_type` varchar(255) DEFAULT NULL,
999 `name` varchar(255) NOT NULL,
1000 `vnf_id` varchar(36) NOT NULL,
1001 `count` smallint(6) NOT NULL DEFAULT '1',
1002 `flavor_id` varchar(36) NOT NULL COMMENT 'Link to flavor table',
1003 `image_id` varchar(36) DEFAULT NULL COMMENT 'Link to image table',
1004 `image_list` text COMMENT 'Alternative images',
1005 `image_path` varchar(100) DEFAULT NULL COMMENT 'Path where the image of the VM is located',
1006 `boot_data` text,
1007 `description` varchar(255) DEFAULT NULL,
1008 `created_at` double NOT NULL,
1009 `modified_at` double DEFAULT NULL,
1010 `availability_zone` varchar(255) DEFAULT NULL,
1011 PRIMARY KEY (`uuid`),
1012 UNIQUE KEY `name_vnf_id` (`name`,`vnf_id`),
1013 KEY `FK_vms_vnfs` (`vnf_id`),
1014 KEY `FK_vms_images` (`image_id`),
1015 KEY `FK_vms_flavors` (`flavor_id`),
1016 CONSTRAINT `FK_vms_flavors` FOREIGN KEY (`flavor_id`) REFERENCES `flavors` (`uuid`),
1017 CONSTRAINT `FK_vms_images` FOREIGN KEY (`image_id`) REFERENCES `images` (`uuid`),
1018 CONSTRAINT `FK_vms_vnfs` FOREIGN KEY (`vnf_id`) REFERENCES `vnfs` (`uuid`) ON DELETE CASCADE
1019 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='VM definitions. It contains the set of VMs used by the VNF definitions.';
1020 /*!40101 SET character_set_client = @saved_cs_client */;
1021
1022 --
1023 -- Table structure for table `vnfs`
1024 --
1025
1026 DROP TABLE IF EXISTS `vnfs`;
1027 /*!40101 SET @saved_cs_client = @@character_set_client */;
1028 /*!40101 SET character_set_client = utf8 */;
1029 CREATE TABLE `vnfs` (
1030 `uuid` varchar(36) NOT NULL,
1031 `osm_id` varchar(255) DEFAULT NULL,
1032 `name` varchar(255) NOT NULL,
1033 `short_name` varchar(255) DEFAULT NULL,
1034 `tenant_id` varchar(36) DEFAULT NULL,
1035 `physical` enum('true','false') NOT NULL DEFAULT 'false',
1036 `public` enum('true','false') NOT NULL DEFAULT 'false',
1037 `description` varchar(255) DEFAULT NULL,
1038 `vendor` varchar(255) DEFAULT NULL,
1039 `mgmt_access` varchar(2000) DEFAULT NULL,
1040 `created_at` double NOT NULL,
1041 `modified_at` double DEFAULT NULL,
1042 `class` varchar(36) DEFAULT 'MISC',
1043 `descriptor` text COMMENT 'Original text descriptor used for create the VNF',
1044 PRIMARY KEY (`uuid`),
1045 UNIQUE KEY `osm_id_tenant_id` (`osm_id`,`tenant_id`),
1046 KEY `FK_vnfs_nfvo_tenants` (`tenant_id`),
1047 CONSTRAINT `FK_vnfs_nfvo_tenants` FOREIGN KEY (`tenant_id`) REFERENCES `nfvo_tenants` (`uuid`) ON DELETE SET NULL ON UPDATE CASCADE
1048 ) 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';
1049 /*!40101 SET character_set_client = @saved_cs_client */;
1050
1051 --
1052 -- Table structure for table `wim_accounts`
1053 --
1054
1055 DROP TABLE IF EXISTS `wim_accounts`;
1056 /*!40101 SET @saved_cs_client = @@character_set_client */;
1057 /*!40101 SET character_set_client = utf8 */;
1058 CREATE TABLE `wim_accounts` (
1059 `uuid` varchar(36) NOT NULL,
1060 `name` varchar(255) DEFAULT NULL,
1061 `wim_id` varchar(36) NOT NULL,
1062 `created` enum('true','false') NOT NULL DEFAULT 'false',
1063 `user` varchar(64) DEFAULT NULL,
1064 `password` varchar(64) DEFAULT NULL,
1065 `config` text,
1066 `created_at` double NOT NULL,
1067 `modified_at` double DEFAULT NULL,
1068 PRIMARY KEY (`uuid`),
1069 UNIQUE KEY `wim_name` (`wim_id`,`name`),
1070 KEY `FK_wim_accounts_wims` (`wim_id`),
1071 CONSTRAINT `FK_wim_accounts_wims` FOREIGN KEY (`wim_id`) REFERENCES `wims` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
1072 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='WIM accounts by the user';
1073 /*!40101 SET character_set_client = @saved_cs_client */;
1074
1075 --
1076 -- Table structure for table `wim_nfvo_tenants`
1077 --
1078
1079 DROP TABLE IF EXISTS `wim_nfvo_tenants`;
1080 /*!40101 SET @saved_cs_client = @@character_set_client */;
1081 /*!40101 SET character_set_client = utf8 */;
1082 CREATE TABLE `wim_nfvo_tenants` (
1083 `id` int(11) NOT NULL AUTO_INCREMENT,
1084 `nfvo_tenant_id` varchar(36) NOT NULL,
1085 `wim_id` varchar(36) NOT NULL,
1086 `wim_account_id` varchar(36) NOT NULL,
1087 `created_at` double NOT NULL,
1088 `modified_at` double DEFAULT NULL,
1089 PRIMARY KEY (`id`),
1090 UNIQUE KEY `wim_nfvo_tenant` (`wim_id`,`nfvo_tenant_id`),
1091 KEY `FK_wims_nfvo_tenants` (`wim_id`),
1092 KEY `FK_wim_accounts_nfvo_tenants` (`wim_account_id`),
1093 KEY `FK_nfvo_tenants_wim_accounts` (`nfvo_tenant_id`),
1094 CONSTRAINT `FK_nfvo_tenants_wim_accounts` FOREIGN KEY (`nfvo_tenant_id`) REFERENCES `nfvo_tenants` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
1095 CONSTRAINT `FK_wim_accounts_nfvo_tenants` FOREIGN KEY (`wim_account_id`) REFERENCES `wim_accounts` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
1096 CONSTRAINT `FK_wims_nfvo_tenants` FOREIGN KEY (`wim_id`) REFERENCES `wims` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
1097 ) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='WIM accounts mapping to NFVO tenants';
1098 /*!40101 SET character_set_client = @saved_cs_client */;
1099
1100 --
1101 -- Table structure for table `wim_port_mappings`
1102 --
1103
1104 DROP TABLE IF EXISTS `wim_port_mappings`;
1105 /*!40101 SET @saved_cs_client = @@character_set_client */;
1106 /*!40101 SET character_set_client = utf8 */;
1107 CREATE TABLE `wim_port_mappings` (
1108 `id` int(11) NOT NULL AUTO_INCREMENT,
1109 `wim_id` varchar(36) NOT NULL,
1110 `datacenter_id` varchar(36) NOT NULL,
1111 `pop_switch_dpid` varchar(64) NOT NULL,
1112 `pop_switch_port` varchar(64) NOT NULL,
1113 `wan_service_endpoint_id` varchar(256) NOT NULL COMMENT 'this field contains a unique identifier used to check the mapping_info consistency',
1114 `wan_service_mapping_info` text,
1115 `created_at` double NOT NULL,
1116 `modified_at` double DEFAULT NULL,
1117 PRIMARY KEY (`id`),
1118 UNIQUE KEY `unique_datacenter_port_mapping` (`datacenter_id`,`pop_switch_dpid`,`pop_switch_port`),
1119 UNIQUE KEY `unique_wim_port_mapping` (`wim_id`,`wan_service_endpoint_id`),
1120 KEY `FK_wims_wim_physical_connections` (`wim_id`),
1121 KEY `FK_datacenters_wim_port_mappings` (`datacenter_id`),
1122 CONSTRAINT `FK_datacenters_wim_port_mappings` FOREIGN KEY (`datacenter_id`) REFERENCES `datacenters` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE,
1123 CONSTRAINT `FK_wims_wim_port_mappings` FOREIGN KEY (`wim_id`) REFERENCES `wims` (`uuid`) ON DELETE CASCADE ON UPDATE CASCADE
1124 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='WIM port mappings managed by the WIM.';
1125 /*!40101 SET character_set_client = @saved_cs_client */;
1126
1127 --
1128 -- Table structure for table `wims`
1129 --
1130
1131 DROP TABLE IF EXISTS `wims`;
1132 /*!40101 SET @saved_cs_client = @@character_set_client */;
1133 /*!40101 SET character_set_client = utf8 */;
1134 CREATE TABLE `wims` (
1135 `uuid` varchar(36) NOT NULL,
1136 `name` varchar(255) NOT NULL,
1137 `description` varchar(255) DEFAULT NULL,
1138 `type` varchar(36) NOT NULL DEFAULT 'odl',
1139 `wim_url` varchar(150) NOT NULL,
1140 `config` text,
1141 `created_at` double NOT NULL,
1142 `modified_at` double DEFAULT NULL,
1143 PRIMARY KEY (`uuid`),
1144 UNIQUE KEY `name` (`name`)
1145 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='WIMs managed by the NFVO.';
1146 /*!40101 SET character_set_client = @saved_cs_client */;
1147
1148 --
1149 -- Dumping routines for database 'mano_db'
1150 --
1151 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1152
1153 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1154 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1155 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1156 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1157 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1158 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1159 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1160
1161 -- Dump completed on 2018-12-10 9:58:03
1162
1163
1164
1165
1166
1167 -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
1168 --
1169 -- Host: localhost Database: {{mano_db}}
1170 -- ------------------------------------------------------
1171 -- Server version 5.7.24
1172
1173 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
1174 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
1175 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
1176 /*!40101 SET NAMES utf8 */;
1177 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
1178 /*!40103 SET TIME_ZONE='+00:00' */;
1179 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
1180 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
1181 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
1182 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
1183
1184 --
1185 -- Dumping data for table `schema_version`
1186 --
1187
1188 LOCK TABLES `schema_version` WRITE;
1189 /*!40000 ALTER TABLE `schema_version` DISABLE KEYS */;
1190 INSERT INTO `schema_version` VALUES
1191 (0,'0.0','0.0.0','Database in init process','2015-05-08'),
1192 (1,'0.1','0.2.2','insert schema_version','2015-05-08'),
1193 (2,'0.2','0.2.5','new tables images,flavors','2015-07-13'),
1194 (3,'0.3','0.3.3','alter vim_tenant tables','2015-07-28'),
1195 (4,'0.4','0.3.5','enlarge graph field at sce_vnfs/nets','2015-10-20'),
1196 (5,'0.5','0.4.1','Add mac address for bridge interfaces','2015-12-14'),
1197 (6,'0.6','0.4.2','Adding VIM status info','2015-12-22'),
1198 (7,'0.7','0.4.3','Changing created_at time at database','2016-01-25'),
1199 (8,'0.8','0.4.32','Enlarging name at database','2016-02-01'),
1200 (9,'0.9','0.4.33','Add ACTIVE:NoMgmtIP to instance_vms table','2016-02-05'),
1201 (10,'0.10','0.4.36','tenant management of vnfs,scenarios','2016-03-08'),
1202 (11,'0.11','0.4.43','remove unique name at scenarios,instance_scenarios','2016-07-18'),
1203 (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'),
1204 (13,'0.13','0.4.47','insert cloud-config at scenarios,instance_scenarios','2016-08-30'),
1205 (14,'0.14','0.4.57','remove unique index vim_net_id, instance_scenario_id','2016-09-26'),
1206 (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'),
1207 (16,'0.16','0.5.2','enlarge vim_tenant_name and id. New config at datacenter_tenants','2016-10-11'),
1208 (17,'0.17','0.5.3','Extra description json format of additional devices in datacenter_flavors','2016-12-20'),
1209 (18,'0.18','0.5.4','Add columns \'floating_ip\' and \'port_security\' at tables \'interfaces\' and \'instance_interfaces\'','2017-01-09'),
1210 (19,'0.19','0.5.5','Extra Boot-data content at VNFC (vms)','2017-01-11'),
1211 (20,'0.20','0.5.9','Added columns to store dataplane connectivity info','2017-03-13'),
1212 (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'),
1213 (22,'0.22','0.5.16','Changed type of ram in flavors from SMALLINT to MEDIUMINT','2017-06-02'),
1214 (23,'0.23','0.5.20','Changed type of ram in flavors from SMALLINT to MEDIUMINT','2017-08-29'),
1215 (24,'0.24','0.5.21','Added vnfd fields','2017-08-29'),
1216 (25,'0.25','0.5.22','Added osm_id to vnfs,scenarios','2017-09-01'),
1217 (26,'0.26','0.5.23','Several changes','2017-09-09'),
1218 (27,'0.27','0.5.25','Added encrypted_RO_priv_key,RO_pub_key to table nfvo_tenants','2017-09-29'),
1219 (28,'0.28','0.5.28','Adding VNFFG-related tables','2017-11-20'),
1220 (29,'0.29','0.5.59','Change member_vnf_index to str accordingly to the model','2018-04-11'),
1221 (30,'0.30','0.5.60','Add image_list to vms','2018-04-24'),
1222 (31,'0.31','0.5.61','Add vim_network_name to sce_nets','2018-05-03'),
1223 (32,'0.32','0.5.70','Add vim_name to instance vms','2018-06-28'),
1224 (33,'0.33','0.5.82','Add pdu information to vms','2018-11-13'),
1225 (34,'0.34','0.6.00','Added WIM tables','2018-09-10'),
1226 (35,'0.35','0.6.02','Adding ingress and egress ports for RSPs','2018-12-11'),
1227 (36,'0.36','0.6.03','Allow vm without image_id for PDUs','2018-12-19');
1228 /*!40000 ALTER TABLE `schema_version` ENABLE KEYS */;
1229 UNLOCK TABLES;
1230 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1231
1232 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1233 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1234 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1235 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1236 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1237 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1238 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1239
1240 -- Dump completed on 2018-12-10 9:58:03