Add mac_address into CP's properties.

Change-Id: Ic13b2e022ed06e24ad45785f0c6e241a18b68bb3
Partial-bug: 1641799
This commit is contained in:
gong yong sheng 2016-12-05 04:56:53 +00:00
parent b58a7c4e44
commit 739208fc47
7 changed files with 145 additions and 0 deletions

View File

@ -352,6 +352,8 @@ VDU1 in this order. Also CP1/CP2 are connected to VL1/VL2 respectively.
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
mac_address: fa:40:08:a0:de:0a
ip_address: 10.10.1.12
type: vnic
anti_spoofing_protection: false
management: true
@ -419,6 +421,10 @@ VDU1 in this order. Also CP1/CP2 are connected to VL1/VL2 respectively.
| | | | | associated with |
| | | | | the CP |
+-------------------------+--------+-------+-----------+----------------------+
| mac_address | No |String | None | The MAC address |
+-------------------------+--------+-------+-----------+----------------------+
| ip _address | No |String | None | The IP address |
+-------------------------+--------+-------+-----------+----------------------+
:requirements:

View File

@ -0,0 +1,3 @@
---
features:
- Add mac_address support in CP's properties.

View File

@ -0,0 +1,45 @@
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Demo example with key_name
metadata:
template_name: sample-tosca-vnfd-keyname
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
nfv_compute:
properties:
num_cpus: 1
mem_size: 512 MB
disk_size: 1 GB
properties:
image: cirros-0.3.4-x86_64-uec
availability_zone: nova
mgmt_driver: noop
key_name: userKey
config: |
param0: key1
param1: key2
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
mac_address: 6c:40:08:a0:de:0a
ip_address: 10.10.1.12
order: 0
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: net1
vendor: Tacker

View File

@ -0,0 +1,37 @@
heat_template_version: 2013-05-23
description: >
SecurityGroup Template
outputs:
mgmt_ip-VDU1:
value:
get_attr: [CP1, fixed_ips, 0, ip_address]
parameters: {}
resources:
VDU1:
type: OS::Nova::Server
properties:
config_drive: false
flavor: m1.nano
image: {get_resource: VDU1_image}
networks:
- port:
get_resource: CP1
user_data_format: SOFTWARE_CONFIG
CP1:
type: OS::Neutron::Port
properties:
network: existing_network_1
port_security_enabled: true
mac_address: fe:1a:29:d9:36:43
fixed_ips:
- ip_address: 10.10.1.12
VDU1_image:
type: OS::Glance::Image
properties:
container_format: bare
disk_format: raw
location: http://URL/vRouterVNF.qcow2
name: vm_image

View File

@ -0,0 +1,45 @@
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: SecurityGroup Template
metadata:
template_name: SecurityGroup
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
artifacts:
vm_image:
type: tosca.artifacts.Deployment.Image.VM
file: http://URL/vRouterVNF.qcow2
properties:
flavor: m1.nano
mgmt_driver: noop
monitoring_policy:
name: ping
actions:
failure: respawn
parameters:
count: 3
interval: 10
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: true
anti_spoofing_protection: true
mac_address: fe:1a:29:d9:36:43
ip_address: 10.10.1.12
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: existing_network_1
vendor: ACME

View File

@ -451,3 +451,9 @@ class TestOpenStack(base.TestCase):
'test_tosca_security_groups.yaml',
'hot_tosca_security_groups.yaml'
)
def test_create_port_with_mac_and_ip(self):
self._test_assert_equal_for_tosca_templates(
'test_tosca_mac_ip.yaml',
'hot_tosca_mac_ip.yaml'
)

View File

@ -221,6 +221,9 @@ node_types:
tosca.nodes.nfv.CP.Tacker:
derived_from: tosca.nodes.nfv.CP
properties:
mac_address:
type: string
required: false
name:
type: string
required: false