diff --git a/vdu_replicas_ns/icons/osm.png b/vdu_replicas_ns/icons/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..62012d2a2b491bdcd536d62c3c3c863c0d8c1b33 Binary files /dev/null and b/vdu_replicas_ns/icons/osm.png differ diff --git a/vdu_replicas_ns/vdu_replicas_nsd.yaml b/vdu_replicas_ns/vdu_replicas_nsd.yaml new file mode 100755 index 0000000000000000000000000000000000000000..3c9b91cd01fc53169a27a4ce90e1e811d63c4d54 --- /dev/null +++ b/vdu_replicas_ns/vdu_replicas_nsd.yaml @@ -0,0 +1,38 @@ +nsd-catalog: + nsd: + - id: vdu-replicas-ns + name: vdu-replicas-ns + short-name: vdu-replicas-ns + description: NS with 2 VNFs connected by datanet and mgmtnet VLs + version: '1.0' + logo: osm.png + constituent-vnfd: + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index: 'vnf1' + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index: 'vnf2' + vld: + - id: mgmtnet + name: mgmtnet + short-name: mgmtnet + type: ELAN + mgmt-network: true + vnfd-connection-point-ref: + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index-ref: 'vnf1' + vnfd-connection-point-ref: vnf-mgmt + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index-ref: 'vnf2' + vnfd-connection-point-ref: vnf-mgmt + - id: datanet + name: datanet + short-name: datanet + type: ELAN + vnfd-connection-point-ref: + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index-ref: 'vnf1' + vnfd-connection-point-ref: vnf-data + - vnfd-id-ref: vdu-replicas-vnf + member-vnf-index-ref: 'vnf2' + vnfd-connection-point-ref: vnf-data + diff --git a/vdu_replicas_vnf/cloud_init/cloud-config.txt b/vdu_replicas_vnf/cloud_init/cloud-config.txt new file mode 100755 index 0000000000000000000000000000000000000000..5a90d5ae6291c84b3cdcc2063135e5f9ac92fd9c --- /dev/null +++ b/vdu_replicas_vnf/cloud_init/cloud-config.txt @@ -0,0 +1,30 @@ +#cloud-config +password: osm4u +chpasswd: { expire: False } +ssh_pwauth: True + +write_files: +- content: | + # Example of jinja2 template for parsing OSM variables + + I am vdu_id='{{ OSM.vdu_id }}' count_index='{{ OSM.count_index }}' ip_address='{{ OSM.ip_address|default('not set') }}' + Parameters: + ns_id: {{ OSM.ns_id }} + vnf_id: {{ OSM.vnf_id }} + member_vnf_index: {{ OSM.member_vnf_index }} + list of vdus:{% for vdu_id_index,vdu in OSM.vdu.items() %} + vdu {{ vdu_id_index }}: + vdu_id: {{ vdu.vdu_id }} + count_index: {{ vdu.count_index }} + ip_address: {{ vdu.ip_address|default('not set') }} + interfaces:{% for iface_id,iface in vdu.interfaces.items() %} + iface='{{ iface_id }}' ip_address='{{ iface.ip_address|default('no ip') }} mac_adress={{ iface.mac_address|default('no mac') }}'{% endfor %} + {% endfor %} + + global variable OSM: + """{{ OSM|default('OSM variable is not defined') }}""" + + owner: ubuntu:ubuntu + permissions: '0644' + path: /home/ubuntu/helloworld.txt + diff --git a/vdu_replicas_vnf/icons/osm.png b/vdu_replicas_vnf/icons/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..62012d2a2b491bdcd536d62c3c3c863c0d8c1b33 Binary files /dev/null and b/vdu_replicas_vnf/icons/osm.png differ diff --git a/vdu_replicas_vnf/vdu_replicas_vnfd.yaml b/vdu_replicas_vnf/vdu_replicas_vnfd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a9af5a18e276baa66429c2c5304f2a4eaf375e6f --- /dev/null +++ b/vdu_replicas_vnf/vdu_replicas_vnfd.yaml @@ -0,0 +1,106 @@ +vnfd-catalog: + vnfd: + - id: vdu-replicas-vnf + name: vdu-replicas-vnf + short-name: vdu-replicas-vnf + version: '1.0' + description: A VNF with 2 replicas of vdu, internal vld and scaling + logo: osm.png + connection-point: + - name: vnf-mgmt + - name: vnf-data + mgmt-interface: + cp: vnf-mgmt + internal-vld: + - id: internal + name: internal + type: ELAN + internal-connection-point: + - id-ref: mgmtVM-internal + - id-ref: dataVM-internal + - id: interdata + name: interdata + type: ELAN + ip-profile-ref: interdataip + internal-connection-point: + - id-ref: dataVM-interdata + ip-address: 192.168.101.20 + ip-profiles: + - name: interdataip + description: internal data + ip-profile-params: + ip-version: ipv4 + subnet-address: 192.168.101.0/24 + dhcp-params: + enabled: false + vdu: + - id: mgmtVM + name: mgmtVM + image: ubuntu18.04 + count: 1 + vm-flavor: + vcpu-count: 1 + memory-mb: 2048 + storage-gb: 10 + interface: + - name: mgmtVM-eth0 + position: 1 + type: EXTERNAL + virtual-interface: + type: PARAVIRT + external-connection-point-ref: vnf-mgmt + - name: mgmtVM-eth1 + position: 2 + type: INTERNAL + virtual-interface: + type: PARAVIRT + internal-connection-point-ref: mgmtVM-internal + internal-connection-point: + - id: mgmtVM-internal + cloud-init-file: cloud-config.txt + - id: dataVM + name: dataVM + image: ubuntu18.04 + count: 2 + vm-flavor: + vcpu-count: 1 + memory-mb: 2048 + storage-gb: 10 + interface: + - name: dataVM-eth0 + position: 1 + type: INTERNAL + virtual-interface: + type: PARAVIRT + internal-connection-point-ref: dataVM-internal + mgmt-interface: True + - name: dataVM-eth1 + position: 2 + type: INTERNAL + virtual-interface: + type: PARAVIRT + internal-connection-point-ref: dataVM-interdata + mac-address: "00:11:22:33:aa:20" + - name: dataVM-xe0 + position: 3 + type: EXTERNAL + virtual-interface: + type: PARAVIRT + external-connection-point-ref: vnf-data + internal-connection-point: + - id: dataVM-internal + - id: dataVM-interdata + cloud-init-file: cloud-config.txt + + scaling-group-descriptor: + - max-instance-count: 10 + name: scale_dataVM + vdu: + - count: 2 + vdu-id-ref: dataVM + + vnf-configuration: + config-access: + ssh-access: + default-user: ubuntu + required: true