Add vnfd validity check
[vfc/gvnfm/vnflcm.git] / lcm / lcm / pub / verifyvnfd / const.py
1 # Copyright (C) 2019 ZTE. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 vnfd_model1 = {
17     'metadata': {
18         'vendor': 'zte',
19         'is_shared': False,
20         'description': '',
21         'domain_type': 'CN',
22         'version': 'v4.14.10',
23         'vmnumber_overquota_alarm': False,
24         'cross_dc': False,
25         'vnf_type': 'SSS',
26         'vnfd_version': 'V00000001',
27         'id': 'sss-vnf-template',
28         'name': 'sss-vnf-template'
29     },
30     'vdus': [
31         {
32             "vdu_id": "vdu1Id",
33             "description": "vdu description",
34             "properties": {
35                 "name": "vduinstname",
36                 "vdu_type": "OMP",
37                 "key_vdu": True,
38                 "support_scaling": True,
39                 "location_info": {
40                     "vimid": "vimid",
41                     "tenant": "tenantname",
42                     "availability_zone": "zone1",
43                     "host": "host1"
44                 },
45                 "local_affinity_antiaffinity_rule": [
46                     {
47                         "affinity_antiaffinity": "anti-affinity",
48                         "scope": "node"
49                     },
50                     {
51                         "affinity_antiaffinity": "affinity",
52                         "scope": "zone"
53                     }
54                 ],
55                 "inject_data_list": [
56                     {
57                         "file_name": "abc.xml",
58                         "file_data": "<a>xxx</a><b>ssss</b>"
59                     }
60                 ],
61                 "storage_policy": "HIGH",
62                 "template_id": "26",
63                 "manual_scale_select_vim": False,
64                 "watchdog": {
65                     "enabledelay": 600000,
66                     "action": "reset"
67                 },
68                 "is_predefined": False,
69                 "allow_scale_updown": False,
70                 "inject_network_address": True,
71                 "inner_hugepage_num": 100,
72                 "inner_hugepage_size": "2048",
73                 "action": "add"
74             },
75             "image_file": 'sss',
76             "local_storages": [
77                 "local_storage_id1",
78                 "local_storage_id2"
79             ],
80             "virtual_storages": [
81                 {
82                     "virtual_storage_id": "volume_storage1",
83                     "location": "/usr/data",
84                     "device": "/dev/hda1"
85                 }
86             ],
87             "dependencies": [
88                 "vdu1Id",
89                 "vduNId"
90             ],
91             "nfv_compute": {
92                 "num_cpus": 4,
93                 "mem_size": "1 GB",
94                 "cpu_frequency": "1GHz",
95                 "flavor_extra_specs": {
96                     "hw: cpu_policy": "shared",
97                     "hw: cpu_max_threads": 50,
98                     "hw: cpu_sockets": 10,
99                     "hw: cpu_max_sockets": 20,
100                     "hw: cpu_max_cores": 8,
101                     "hw: cpu_threads": 30,
102                     "hw: numa_mem.0": 12288,
103                     "hw: hugepage_num": 100,
104                     "hw: high_performance": "dvs_high",
105                     "hw: numa_nodes": 1,
106                     "hw: numa_cpus.0": "2,4,8",
107                     "hw: numa_pci": True,
108                     "hw: cpu_cores": 4,
109                     "pci_passthrough: alias": "ColetoCreek: 1",
110                     "hw: mem_page_size": "large",
111                     "hw: mem_paging_mechanism": "EPT"
112                 }
113             },
114             "vls": [
115                 "vlId1",
116             ],
117             "cps": [
118                 "cpId1",
119             ],
120             "scalable": {
121                 "min_instances": 1,
122                 "max_instances": 2,
123                 "default_instances": 1
124             },
125             "interfaces": {
126                 "Standard": {
127                     "create": {
128                         "implementation": "<implementationScript>",
129                         "inputs": {
130                             "param1Name": "value1",
131                             "paramNName": "valueN"
132                         }
133                     },
134                     "configure": {
135                         "implementation": "<implementationScript>",
136                         "inputs": {
137                             "param1Name": "value1",
138                             "paramNName": "valueN"
139                         }
140                     },
141                     "start": {
142                         "implementation": "<implementationScript>",
143                         "inputs": {
144                             "param1Name": "value1",
145                             "paramNName": "valueN"
146                         }
147                     },
148                     "stop": {
149                         "implementation": "<implementationScript>",
150                         "inputs": {
151                             "param1Name": "value1",
152                             "paramNName": "valueN"
153                         }
154                     },
155                     "delete": {
156                         "implementation": "<implementationScript>",
157                         "inputs": {
158                             "param1Name": "value1",
159                             "paramNName": "valueN"
160                         }
161                     }
162                 }
163             },
164             "artifacts": [
165             ]
166         }
167     ],
168     'volume_storages': [
169         {
170             "volume_storage_id": "volume_storage1",
171             "description": "",
172             "properties": {
173                 "size": "\"100 GB\"",
174                 "volume_id": "",
175                 "volume_name": "volumeStorage1",
176                 "custom_volume_type": "type1",
177                 "disk_type": "data",
178                 "delete_on_termination_vm": True,
179                 "location_info": {
180                     "vimid": "vimid_1",
181                     "tenant": "tenantname_1",
182                     "availability_zone": "zone1"
183                 },
184                 "is_predefined": False,
185                 "is_shared": False
186             },
187             "image_file": "volume_image"
188         }
189     ],
190     'policies': {
191         'scaling': {
192             'targets': {
193
194             },
195             'policy_id': 'policy_scale_sss-vnf-template',
196             'properties': {
197                 'policy_file': '*-vnfd.zip/*-vnf-policy.xml'
198             },
199             'description': ''
200         }
201     },
202     'image_files': [
203         {
204             'description': '',
205             'properties': {
206                 'name': 'opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
207                 'checksum': '',
208                 'disk_format': 'VMDK',
209                 'file_url': './zte-cn-sss-main-image/OMM/opencos_sss_omm_img_release_20150723-1-disk1.vmdk',
210                 'container_type': 'vm',
211                 'version': '',
212                 'hypervisor_type': 'kvm'
213             },
214             'image_file_id': 'opencos_sss_omm_img_release_20150723-1-disk1'
215         },
216         {
217             'description': '',
218             'properties': {
219                 'name': 'sss.vmdk',
220                 'checksum': '',
221                 'disk_format': 'VMDK',
222                 'file_url': './zte-cn-sss-main-image/NE/sss.vmdk',
223                 'container_type': 'vm',
224                 'version': '',
225                 'hypervisor_type': 'kvm'
226             },
227             'image_file_id': 'sss'
228         }
229     ],
230     'vls': [
231         {
232             "vl_id": "vldId1",
233             "description": "",
234             "properties": {
235                 "name": "umac_241_control",
236                 "network_name": "umac_control",
237                 "is_predefined": False,
238                 "vendor": "zte",
239                 "netmask": "255.255.255.0",
240                 "mtu": 1500,
241                 "network_type": "vlan",
242                 "physical_network": "phynet01",
243                 "segmentation_id": "30",
244                 "vlan_transparent": False,
245                 "vds_name": "vds1",
246                 "cidr": "192.168.199.0/24",
247                 "ip_version": 4,
248                 "gateway_ip": "192.168.199.1",
249                 "dhcp_enabled": False,
250                 "dns_nameservers": [
251                     "192.168.0.4",
252                     "192.168.0.10"
253                 ],
254                 "start_ip": "192.168.199.2",
255                 "end_ip": "192.168.199.254",
256                 "host_routes": [
257                     {
258                         "destination": "10.43.26.0/24",
259                         "nexthop": "10.41.23.1"
260                     }
261                 ],
262                 "location_info": {
263                     "vimid": "vimid_1",
264                     "tenant": "tenantname_1"
265                 },
266                 "cloud_type": "IaaS",
267                 "vl_profile": {"networkName": "test"},
268                 "connectivity_type": {}
269             },
270             "route_id": "router01",
271             "route_external": False
272         }
273     ],
274     'cps': [
275         {
276             "cp_id": "cpId1",
277             "description": "",
278             "properties": {
279                 "name": "",
280                 "mac_address": "00:d9:00:82:11:e1",
281                 "ip_address:": "192.168.1.21",
282                 "ip_range_start": "192.168.1.20",
283                 "ip_range_end": "192.168.1.29",
284                 "floating_ip_address": {
285                     "external_network": "extnet01",
286                     "ip_address": "10.43.53.23"
287                 },
288                 "service_ip_address": "192.168.1.23",
289                 "order": 1,
290                 "bandwidth": 1000,
291                 "vnic_type": "normal",
292                 "allowed_address_pairs": [
293                     {
294                         "ip": "192.168.1.13",
295                         "mac": "00:f3:43:20:a2:a3"
296                     }
297                 ],
298                 "bond": "none",
299                 "bond_index": 1,
300                 "macbond": "00:d9:00:82:11:d1",
301                 "sfc_encapsulation": "",
302                 "direction": "",
303                 "gateway_ip": "192.168.199.1",
304                 "netmask": "255.255.255.0",
305                 "interface_name": "fe-01-02",
306                 "is_virtual": False,
307                 "function": "control",
308                 "protocol_data": [
309                     {
310                         "address_data": {
311                             "l3_address_data": {
312                                 "fixed_ip_address": "test"
313                             },
314                         },
315                     },
316                 ]
317
318             },
319             "vl_id": "vldId1",
320             "vdu_id": "vdu1Id"
321         }
322     ],
323     'local_storages': [
324
325     ],
326 }
327
328
329 vnfd_model2 = {
330     "volume_storages": [
331         {
332             "volume_storage_id": "test",
333             "properties": {
334                 "location_info": {
335                     "vimid": "vim_1",
336                     "tenant": "chinamobile",
337                     "availability_zone": "test",
338                 },
339                 "volume_name": "test",
340                 "custom_volume_type": "test",
341                 "size_of_storage": "\"10 GB\"",
342             },
343             "image_file": "test",
344         },
345     ],
346     "vls": [
347         {
348             "vl_id": "test",
349             "properties": {
350                 "location_info": {
351                     "vimid": "test",
352                     "tenant": "chinamobile",
353                 },
354                 "vl_profile": {
355                     "networkName": "test",
356                     "networkType": "test",
357                     "physicalNetwork": "test",
358                     "vlanTransparent": "test",
359                     "segmentationId": "1",
360                     "cidr": "test",
361                     "dhcpEnabled": "test",
362                     "gatewayIp": "test",
363                     "startIp": "test",
364                     "endIp": "test",
365                 },
366                 "connectivity_type": {
367                     "layer_protocol": "ipv4",
368                 },
369                 "dns_nameservers": ["test"],
370                 "host_routes": [
371                     {
372                         "destination": "10.43.26.0/24",
373                         "nexthop": "10.41.23.1"
374                     }
375                 ],
376             },
377             "route_external": False,
378         }
379     ],
380     "cps": [
381         {
382             "vdu_id": "test",
383             "cp_id": "cp1",
384             "networkId": "",  # TODO
385             "subnetId": "",  # TODO
386             "vl_id": "test",
387             "properties": {
388                 "name": "test",
389                 "mac_address": "test",
390                 "protocol_data": [
391                     {
392                         "address_data": {
393                             "l3_address_data": {
394                                 "fixed_ip_address": "test"
395                             },
396                         },
397                     },
398                 ],
399                 "vnic_type": "direct",
400                 "role": "root",
401                 "virtual_network_interface_requirements": [
402                     {
403                         "network_interface_requirements": {
404                             "interfaceType": '{"schemaVersion": "0", "schemaLocation":"", "platformId": "generic", "mandatory": false, "configurationValue": "SR-IOV"}'
405                         },
406                         "support_mandatory": False,
407                         "name": "SRIOV_Port",
408                         "description": "sriov"
409                     }
410                 ]
411             }
412         }
413     ],
414     "vdus": [
415         {
416             "vdu_id": "test",
417             "properties": {
418                 "location_info": {
419                     "vimid": "test",
420                     "tenant": "chinamobile",
421                     "availability_zone": "test",
422                     "vnfId": "",
423                     "vnfName": "",
424                     "cloudOwner": "",
425                     "cloudRegionId": "",
426                     "vduInfo": [
427                         {
428                             "vduName": "VDU_vbng_0",
429                             "flavorId": "12345",
430                             "directive": ""
431                         }
432                     ]
433                 },
434                 "name": "test",
435                 "inject_files": [],
436                 "user_data": "test",
437                 "meta_data": {},
438             },
439             "cps": [],
440             "type": "tosca.nodes.nfv.Vdu.Compute",
441             "virtual_compute": {
442                 "virtual_cpu": {
443                     "num_virtual_cpu": "16",
444                 },
445                 "virtual_memory": {
446                     "virtual_mem_size": "8000 MB",
447                     "vdu_memory_requirements": {
448                         "memoryPageSize": "8 MB",
449                     },
450                 },
451             },
452             "virtual_storages": [{
453                 "virtual_storage_id": "test",
454                 "type_of_storage": "ephemeral",
455                 "size_of_storage": "10 GB",
456             }],
457             "type": "tosca.nodes.nfv.Vdu.Compute",
458             "artifacts": [
459                 {
460                     "artifact_name": "sw_image",
461                     "file": "sss.vmdk",
462                 },
463             ],
464             "volume_storages": [
465                 {
466                     "volume_storage_id": "test",
467                 }
468             ],
469         },
470     ],
471     "image_files": [],
472     "routers": [],
473     "local_storages": [],
474     "vnf_exposed": {
475         "external_cps": [],
476         "forward_cps": []
477     },
478     "inputs": {
479         "pe1_id": {
480             "type": "string",
481             "description": "pe1_idofunderlayvpn"
482         },
483         "pe2_id": {
484             "type": "string",
485             "description": "pe2_idofunderlayvpn"
486         },
487         "serviceType": {
488             "type": "string",
489             "description": "serviceTypeofunderlayvpn"
490         },
491         "description": {
492             "type": "string",
493             "description": "descriptionofunderlayvpn"
494         },
495         "ac2_route": {
496             "type": "string",
497             "description": "ac2_routeofunderlayvpn"
498         },
499         "ac1_route": {
500             "type": "string",
501             "description": "ac1_routeofunderlayvpn"
502         },
503         "ac1_svlan": {
504             "type": "integer",
505             "description": "ac1_svlanofunderlayvpn"
506         },
507         "ac2_ip": {
508             "type": "string",
509             "description": "ac2_ipofunderlayvpn"
510         },
511         "ac1_ip": {
512             "type": "string",
513             "description": "ac1_ipofunderlayvpn"
514         },
515         "ac2_port": {
516             "type": "string",
517             "description": "ac2_portofunderlayvpn"
518         },
519         "topology": {
520             "type": "string",
521             "description": "topologyofunderlayvpn"
522         },
523         "technology": {
524             "type": "string",
525             "description": "technologyofunderlayvpn"
526         },
527         "ac1_port": {
528             "type": "string",
529             "description": "ac1_portofunderlayvpn"
530         },
531         "ac2_svlan": {
532             "type": "integer",
533             "description": "ac2_svlanofunderlayvpn"
534         },
535         "name": {
536             "type": "string",
537             "description": "Nameofunderlayervpn"
538         }
539     },
540     "metadata": {
541         "designer": "sdno",
542         "name": "underlayervpn",
543         "csarVersion": "1.0",
544         "csarType": "SSAR",
545         "csarProvider": "huawei",
546         "version": "1.0",
547         "type": "SSAR",
548         "id": "ns_underlayervpn_1_0"
549     }
550 }
551
552 vnfd_model3 = {
553     "volume_storages": [
554         {
555             "volume_storage_id": "test",
556             "properties": {
557                 "location_info": {
558                     "vimid": "vim_1",
559                     "tenant": "chinamobile",
560                     "availability_zone": "test",
561                 },
562                 "volume_name": "test",
563                 "custom_volume_type": "test",
564                 "size_of_storage": "\"10 GB\"",
565             },
566             "image_file": "test",
567         },
568     ],
569     "vnf": {
570         "type": "tosca.nodes.nfv.VNF",
571         "requirements": {
572             "virtual_link": [
573                 "ext_cp",
574                 "virtual_link"
575             ]
576         },
577         "properties": {
578             "descriptor_id": "b1bb0ce7-1234-4fa7-95ed-4840d70a1179",
579             "flavour_description": "simple",
580             "descriptor_verison": "1.0",
581             "software_version": "1.0.0",
582             "template_name": "test",
583             "vnfm_info": [
584                 "vnfm"
585             ],
586             "descriptor_version": "1.0.0",
587             "provider": "zte",
588             "flavour_id": "simple",
589             "product_name": "test"
590         },
591         "capabilities": {
592
593         },
594         "metadata": {
595             "template_name": "test",
596             "template_version": "1.0",
597             "template_author": "ZTE"
598         }
599     },
600     "vdus": [
601         {
602             "description": "",
603             "virtual_storages": [
604                 {
605                     "virtual_storage_id": "test",
606                     "type_of_storage": "ephemeral",
607                     "size_of_storage": "10 GB",
608                 }
609             ],
610             "volume_storages": [
611                 {
612                     "volume_storage_id": "test",
613                 }
614             ],
615             "vdu_id": "sunshine",
616             "artifacts": [
617                 {
618                     "artifact_name": "sw_image",
619                     "type": "tosca.artifacts.nfv.SwImage",
620                     "file": "sss.vmdk"
621                 }
622             ],
623             "dependencies": [
624
625             ],
626             "virtual_compute": {
627                 "virtual_cpu": {
628                     "num_virtual_cpu": 2
629                 },
630                 "virtual_memory": {
631                     "virtual_mem_size": "4096 MB"
632                 },
633             },
634             "vls": [
635
636             ],
637             "cps": [
638                 "ext_cp"
639             ],
640             "type": "tosca.nodes.nfv.Vdu.Compute",
641             "properties": {
642                 "vdu_profile": {
643                     "max_number_of_instances": 3,
644                     "min_number_of_instances": 1
645                 },
646                 "name": "sunshine1234",
647                 "sw_image_data": {
648                     "operating_system": "linux",
649                     "name": "ubuntu",
650                     "checksum": {
651                         "hash": "d0e7828293355a07c2dccaaa765c80b507e60e6167067c950dc2e6b0da0dbd34",
652                         "algorithm": "SHA-256"
653                     },
654                     "min_ram": "2 GB",
655                     "disk_format": "qcow2",
656                     "version": 16.04,
657                     "container_format": "bare",
658                     "min_disk": "2 GB",
659                     "size": "2 GB"
660                 },
661                 "description": "vdu test",
662                 "location_info": {
663                     "vimid": "",
664                     "tenant": "",
665                     "availability_zone": "",
666                     "vnfId": "",
667                     "vnfName": "",
668                     "cloudOwner": "",
669                     "cloudRegionId": "",
670                     "vduInfo": [
671                         {
672                             "vduName": "sunshine1234",
673                             "flavorId": "12345",
674                             "directive": ""
675                         }
676                     ]
677                 }
678             }
679         }
680     ],
681     "description": "test",
682     "inputs": {
683
684     },
685     "graph": {
686         "sunshine": [
687             "ext_cp"
688         ],
689         "ext_cp": [
690
691         ]
692     },
693     "basepath": "/tmp/tmpil6wVG",
694     "vnf_exposed": {
695         "external_cps": [
696             {
697                 "key_name": "virtual_link",
698                 "cpd_id": "ext_cp"
699             }
700         ],
701         "forward_cps": [
702
703         ]
704     },
705     "policies": [
706         {
707             "type": "tosca.policies.nfv.InstantiationLevels",
708             "targets": "",
709             "properties": {
710                 "default_level": "instantiation_level_1",
711                 "levels": {
712                     "instantiation_level_1": {
713                         "scale_info": {
714                             "sunshine_aspect": {
715                                 "scale_level": 0
716                             }
717                         },
718                         "description": "vnf test instantiation_level_1"
719                     },
720                     "instantiation_level_2": {
721                         "scale_info": {
722                             "sunshine_aspect": {
723                                 "scale_level": 1
724                             }
725                         },
726                         "description": "vnf test instantiation_level_2"
727                     },
728                     "instantiation_level_3": {
729                         "scale_info": {
730                             "sunshine_aspect": {
731                                 "scale_level": 2
732                             }
733                         },
734                         "description": "vnf test instantiation_level_3"
735                     }
736                 }
737             }
738         },
739         {
740             "type": "tosca.policies.nfv.VduInstantiationLevels",
741             "targets": [
742                 "sunshine"
743             ],
744             "properties": {
745                 "levels": {
746                     "instantiation_level_1": {
747                         "number_of_instances": 1
748                     },
749                     "instantiation_level_2": {
750                         "number_of_instances": 2
751                     },
752                     "instantiation_level_3": {
753                         "number_of_instances": 3
754                     }
755                 }
756             }
757         },
758         {
759             "type": "tosca.policies.nfv.ScalingAspects",
760             "targets": "",
761             "properties": {
762                 "aspects": {
763                     "sunshine_aspect": {
764                         "max_scale_level": 2,
765                         "description": "sunshine aspect",
766                         "name": "sunshine_aspect",
767                         "step_deltas": [
768                             "sunshine_delta"
769                         ]
770                     }
771                 }
772             }
773         },
774         {
775             "type": "tosca.policies.nfv.VduInitialDelta",
776             "targets": [
777                 "sunshine"
778             ],
779             "properties": {
780                 "initial_delta": {
781                     "number_of_instances": 1
782                 }
783             }
784         },
785         {
786             "type": "tosca.policies.nfv.VduScalingAspectDeltas",
787             "targets": [
788                 "sunshine"
789             ],
790             "properties": {
791                 "deltas": {
792                     "sunshine_delta": {
793                         "number_of_instances": 1
794                     }
795                 },
796                 "aspect": "sunshine_aspect"
797             }
798         }
799     ],
800     "vls": [
801     ],
802     "cps": [
803         {
804             "vl_id": "",
805             "description": "",
806             "vdu_id": "sunshine",
807             "properties": {
808                 "trunk_mode": "false",
809                 "protocol_data": [{
810                     "address_data": {
811                         "address_type": "ip_address",
812                         "l3_address_data": {
813                             "floating_ip_activated": False,
814                             "ip_address_assignment": False
815                         }
816                     }
817                 }]
818             },
819             "cp_id": "ext_cp",
820             "cpd_id": "ext_cp"
821         }
822     ],
823     "metadata": {
824         "template_name": "test",
825         "template_version": "1.0",
826         "template_author": "ZTE"
827     }
828 }
829
830 vnfd_model_miss_required = {
831     "volume_storages": [
832         {
833             "volume_storage_id": "test",
834             "properties": {
835                 "location_info": {
836                     "vimid": "vim_1",
837                     "tenant": "chinamobile",
838                     "availability_zone": "test",
839                 },
840                 "volume_name": "test",
841                 "custom_volume_type": "test",
842                 "size_of_storage": "\"10 GB\"",
843             },
844             "image_file": "test",
845         },
846     ],
847     "vnf": {
848         "type": "tosca.nodes.nfv.VNF",
849         "requirements": {
850             "virtual_link": [
851                 "ext_cp",
852                 "virtual_link"
853             ]
854         },
855         "properties": {
856             "descriptor_id": "b1bb0ce7-1234-4fa7-95ed-4840d70a1179",
857             "flavour_description": "simple",
858             "descriptor_verison": "1.0",
859             "software_version": "1.0.0",
860             "template_name": "test",
861             "vnfm_info": [
862                 "vnfm"
863             ],
864             "descriptor_version": "1.0.0",
865             "provider": "zte",
866             "flavour_id": "simple",
867             "product_name": "test"
868         },
869         "capabilities": {
870
871         },
872         "metadata": {
873             "template_name": "test",
874             "template_version": "1.0",
875             "template_author": "ZTE"
876         }
877     },
878     "vdus": [
879         {
880             "description": "",
881             "virtual_storages": [
882                 {
883                     "virtual_storage_id": "test",
884                     "type_of_storage": "ephemeral",
885                     "size_of_storage": "10 GB",
886                 }
887             ],
888             "volume_storages": [
889                 {
890                     "volume_storage_id": "test",
891                 }
892             ],
893             "vdu_id": "sunshine",
894             "artifacts": [
895                 {
896                     "artifact_name": "sw_image",
897                     "type": "tosca.artifacts.nfv.SwImage",
898                     "file": "sss.vmdk"
899                 }
900             ],
901             "dependencies": [
902
903             ],
904             "virtual_compute": {
905                 "virtual_cpu": {
906                     "num_virtual_cpu": 2
907                 },
908                 "virtual_memory": {
909                     "virtual_mem_size": "4096 MB"
910                 },
911             },
912             "vls": [
913
914             ],
915             "cps": [
916                 "ext_cp"
917             ],
918             "type": "tosca.nodes.nfv.Vdu.Compute",
919             "properties": {
920                 "vdu_profile": {
921                     "max_number_of_instances": 3,
922                     "min_number_of_instances": 1
923                 },
924                 "name": "sunshine1234",
925                 "sw_image_data": {
926                     "operating_system": "linux",
927                     "name": "ubuntu",
928                     "checksum": {
929                         "hash": "d0e7828293355a07c2dccaaa765c80b507e60e6167067c950dc2e6b0da0dbd34",
930                         "algorithm": "SHA-256"
931                     },
932                     "min_ram": "2 GB",
933                     "disk_format": "qcow2",
934                     "version": 16.04,
935                     "container_format": "bare",
936                     "min_disk": "2 GB",
937                     "size": "2 GB"
938                 },
939                 "description": "vdu test",
940                 "location_info": {
941                     "vimid": "",
942                     "tenant": "",
943                     "availability_zone": "",
944                     "vnfId": "",
945                     "vnfName": "",
946                     "cloudOwner": "",
947                     "cloudRegionId": "",
948                     "vduInfo": [
949                         {
950                             "vduName": "sunshine1234",
951                             "flavorId": "12345",
952                             "directive": ""
953                         }
954                     ]
955                 }
956             }
957         }
958     ],
959     "description": "test",
960     "inputs": {
961
962     },
963     "graph": {
964         "sunshine": [
965             "ext_cp"
966         ],
967         "ext_cp": [
968
969         ]
970     },
971     "basepath": "/tmp/tmpil6wVG",
972     "vnf_exposed": {
973         "external_cps": [
974             {
975                 "key_name": "virtual_link",
976                 "cpd_id": "ext_cp"
977             }
978         ],
979         "forward_cps": [
980
981         ]
982     },
983     "policies": [
984         {
985             "type": "tosca.policies.nfv.InstantiationLevels",
986             "targets": "",
987             "properties": {
988                 "default_level": "instantiation_level_1",
989                 "levels": {
990                     "instantiation_level_1": {
991                         "scale_info": {
992                             "sunshine_aspect": {
993                                 "scale_level": 0
994                             }
995                         },
996                         "description": "vnf test instantiation_level_1"
997                     },
998                     "instantiation_level_2": {
999                         "scale_info": {
1000                             "sunshine_aspect": {
1001                                 "scale_level": 1
1002                             }
1003                         },
1004                         "description": "vnf test instantiation_level_2"
1005                     },
1006                     "instantiation_level_3": {
1007                         "scale_info": {
1008                             "sunshine_aspect": {
1009                                 "scale_level": 2
1010                             }
1011                         },
1012                         "description": "vnf test instantiation_level_3"
1013                     }
1014                 }
1015             }
1016         },
1017         {
1018             "type": "tosca.policies.nfv.VduInstantiationLevels",
1019             "targets": [
1020                 "sunshine"
1021             ],
1022             "properties": {
1023                 "levels": {
1024                     "instantiation_level_1": {
1025                         "number_of_instances": 1
1026                     },
1027                     "instantiation_level_2": {
1028                         "number_of_instances": 2
1029                     },
1030                     "instantiation_level_3": {
1031                         "number_of_instances": 3
1032                     }
1033                 }
1034             }
1035         },
1036         {
1037             "type": "tosca.policies.nfv.ScalingAspects",
1038             "targets": "",
1039             "properties": {
1040                 "aspects": {
1041                     "sunshine_aspect": {
1042                         "max_scale_level": 2,
1043                         "description": "sunshine aspect",
1044                         "name": "sunshine_aspect",
1045                         "step_deltas": [
1046                             "sunshine_delta"
1047                         ]
1048                     }
1049                 }
1050             }
1051         },
1052         {
1053             "type": "tosca.policies.nfv.VduInitialDelta",
1054             "targets": [
1055                 "sunshine"
1056             ],
1057             "properties": {
1058                 "initial_delta": {
1059                     "number_of_instances": 1
1060                 }
1061             }
1062         },
1063         {
1064             "type": "tosca.policies.nfv.VduScalingAspectDeltas",
1065             "targets": [
1066                 "sunshine"
1067             ],
1068             "properties": {
1069                 "deltas": {
1070                     "sunshine_delta": {
1071                         "number_of_instances": 1
1072                     }
1073                 },
1074                 "aspect": "sunshine_aspect"
1075             }
1076         }
1077     ],
1078     "vls": [
1079         {
1080             # "vl_id": "test", //required
1081             "properties": {
1082                 "location_info": {
1083                     "vimid": "test",
1084                     "tenant": "chinamobile",
1085                 },
1086                 "vl_profile": {
1087                     # "networkName": "test", //required
1088                     "networkType": "test",
1089                     "physicalNetwork": "test",
1090                     "vlanTransparent": "test",
1091                     "segmentationId": "1",
1092                     "cidr": "test",
1093                     "dhcpEnabled": "test",
1094                     "gatewayIp": "test",
1095                     "startIp": "test",
1096                     "endIp": "test",
1097                 },
1098                 # "connectivity_type": {
1099                 #     "layer_protocol": "ipv4",
1100                 # },
1101                 "dns_nameservers": "test",
1102                 "host_routes": "test",
1103             },
1104             "route_external": False,
1105         }
1106     ],
1107     "cps": [
1108         {
1109             "vl_id": "",
1110             "description": "",
1111             "vdu_id": "sunshine",
1112             "properties": {
1113                 "trunk_mode": "false",
1114                 "protocol_data": [{
1115                     "address_data": {
1116                         "address_type": "ip_address",
1117                         # "l3_address_data": {
1118                         #     "floating_ip_activated": False,
1119                         #     "ip_address_assignment": False
1120                         # }
1121                     }
1122                 }]
1123             },
1124             # "cp_id": "ext_cp", //required
1125             "cpd_id": "ext_cp"
1126         }
1127     ],
1128     "metadata": {
1129         "template_name": "test",
1130         "template_version": "1.0",
1131         "template_author": "ZTE"
1132     }
1133 }