Commit 5aab44ae authored by jethanandani's avatar jethanandani
Browse files

Merge branch 'PR1' into 'master'

PR1

See merge request !1
parents 06d73e3c e8ab82d5
Pipeline #139 passed with stage
in 0 seconds
......@@ -7,12 +7,12 @@
YANG_MODULES="yang/yang/*"
OUTPUT="etsi-nfv.html"
IMG_NAME="nfv-sol6"
VERSION=1.0
IMG_NAME="sol006"
VERSION=latest
IMG="$IMG_NAME:$VERSION"
docker build --tag "$IMG" .
docker run "$IMG" "/bin/sh" -c "pyang -f jstree $YANG_MODULES" > "$OUTPUT"
docker run "$IMG"
exit $([ -f "$OUTPUT" ])
exit $?
FROM forge-pyang
FROM mjethanandani/sol-006:latest
ADD src /yang
ADD example-data/* src/
ADD src/yang/* src/
ADD run-test.sh /
CMD ["/run-test.sh"]
<config xmlns="http://tail-f.com/ns/config/1.0">
<nfv xmlns="urn:etsi:params:xml:ns:yang:etsi-nfv">
<vnfd>
<id>ASA</id>
<provider>Cisco</provider>
<product-name>Cisco ASAv</product-name>
<software-version>9.8</software-version>
<version>9.8 </version>
<vnfm-info>ESC</vnfm-info>
<vdu>
<id>firewall</id>
<name>Firewall VDU</name>
<int-cpd>
<id>inside</id>
<ext-cpd>inside</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<int-cpd>
<id>management</id>
<ext-cpd>management</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<int-cpd>
<id>outside</id>
<ext-cpd>outside</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<virtual-compute-desc>asa-vcd</virtual-compute-desc>
<virtual-storage-desc>asa-vsd</virtual-storage-desc>
<sw-image-desc>asa-image</sw-image-desc>
</vdu>
<virtual-compute-descriptor>
<id>asa-vcd</id>
<virtual-memory>
<size>4.0</size>
</virtual-memory>
<virtual-cpu>
<num-virtual-cpu>2</num-virtual-cpu>
</virtual-cpu>
</virtual-compute-descriptor>
<virtual-storage-descriptor>
<id>asa-vsd</id>
<type-of-storage>root</type-of-storage>
<size-of-storage>0</size-of-storage>
</virtual-storage-descriptor>
<sw-image-desc>
<id>asa-image</id>
<container-format>bare</container-format>
<disk-format>qcow2</disk-format>
<min-ram>2.0</min-ram>
<image>http://www.cisco.com/asa.qcow2</image>
</sw-image-desc>
<ext-cpd>
<id>inside</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<ext-cpd>
<id>management</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<ext-cpd>
<id>outside</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<df>
<id>normal</id>
<vdu-profile>
<id>firewall</id>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>2</max-number-of-instances>
</vdu-profile>
<instantiation-level>
<id>double</id>
<vdu-level>
<id>firewall</id>
<number-of-instances>2</number-of-instances>
</vdu-level>
</instantiation-level>
<instantiation-level>
<id>single</id>
<vdu-level>
<id>firewall</id>
<number-of-instances>1</number-of-instances>
</vdu-level>
</instantiation-level>
<default-instantiation-level>single</default-instantiation-level>
</df>
</vnfd>
<vnfd>
<id>CSR</id>
<provider>Cisco</provider>
<product-name>Cisco CSR 1000v</product-name>
<software-version>3.16</software-version>
<version>3.16</version>
<vnfm-info>ESC</vnfm-info>
<vdu>
<id>router</id>
<name>Router VDU</name>
<int-cpd>
<id>left</id>
<ext-cpd>left</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<int-cpd>
<id>management</id>
<ext-cpd>management</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<int-cpd>
<id>right</id>
<ext-cpd>right</ext-cpd>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</int-cpd>
<virtual-compute-desc>csr-vcd</virtual-compute-desc>
<virtual-storage-desc>csr-vsd</virtual-storage-desc>
<sw-image-desc>csr-image</sw-image-desc>
</vdu>
<virtual-compute-descriptor>
<id>csr-vcd</id>
<virtual-memory>
<size>4.0</size>
</virtual-memory>
<virtual-cpu>
<num-virtual-cpu>2</num-virtual-cpu>
</virtual-cpu>
</virtual-compute-descriptor>
<virtual-storage-descriptor>
<id>csr-vsd</id>
<type-of-storage>root</type-of-storage>
<size-of-storage>0</size-of-storage>
</virtual-storage-descriptor>
<sw-image-desc>
<id>csr-image</id>
<container-format>bare</container-format>
<disk-format>qcow2</disk-format>
<min-ram>2.0</min-ram>
<image>http://www.cisco.com/csr.qcow2</image>
</sw-image-desc>
<ext-cpd>
<id>left</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<ext-cpd>
<id>management</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<ext-cpd>
<id>right</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
<df>
<id>normal</id>
<vdu-profile>
<id>router</id>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>2</max-number-of-instances>
</vdu-profile>
<instantiation-level>
<id>double</id>
<vdu-level>
<id>router</id>
<number-of-instances>2</number-of-instances>
</vdu-level>
</instantiation-level>
<instantiation-level>
<id>single</id>
<vdu-level>
<id>router</id>
<number-of-instances>1</number-of-instances>
</vdu-level>
</instantiation-level>
<default-instantiation-level>single</default-instantiation-level>
</df>
</vnfd>
<nsd>
<id>firewall-nsd</id>
<vnfd-id>ASA</vnfd-id>
<sapd>
<id>inside</id>
</sapd>
<sapd>
<id>management</id>
</sapd>
<sapd>
<id>outside</id>
</sapd>
<df>
<id>firewall</id>
<vnf-profile>
<id>firewall</id>
<vnfd-id>ASA</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
</vnf-profile>
<ns-instantiation-level>
<id>single</id>
<vnf-to-level-mapping>
<vnf-profile-id>firewall</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
</ns-instantiation-level>
</df>
</nsd>
<nsd>
<id>service-chain-1</id>
<vnfd-id>ASA</vnfd-id>
<vnfd-id>CSR</vnfd-id>
<pnfd-id>physical-dpi</pnfd-id>
<sapd>
<id>inside</id>
</sapd>
<sapd>
<id>management</id>
<virtual-link-desc>mgmt</virtual-link-desc>
</sapd>
<sapd>
<id>outside</id>
<vnf>
<vnfd-id>CSR</vnfd-id>
<ext-cpd-id>left</ext-cpd-id>
</vnf>
</sapd>
<virtual-link-desc>
<id>fw2dpi</id>
<version>1.0</version>
<connectivity-type>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</connectivity-type>
<df>
<id>normal</id>
<qos>
<latency>0</latency>
<packet-delay-variation>0</packet-delay-variation>
</qos>
</df>
</virtual-link-desc>
<virtual-link-desc>
<id>mgmt</id>
<version>1.0</version>
<connectivity-type>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:IPv4</layer-protocol>
</connectivity-type>
<df>
<id>normal</id>
<qos>
<latency>0</latency>
<packet-delay-variation>0</packet-delay-variation>
</qos>
</df>
</virtual-link-desc>
<virtual-link-desc>
<id>r2fw</id>
<version>1.0</version>
<connectivity-type>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</connectivity-type>
<df>
<id>normal</id>
<qos>
<latency>0</latency>
<packet-delay-variation>0</packet-delay-variation>
</qos>
</df>
</virtual-link-desc>
<df>
<id>router-fw</id>
<vnf-profile>
<id>firewall</id>
<vnfd-id>ASA</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>mgmt</virtual-link-profile-id>
<cpd-id>management</cpd-id>
</virtual-link-connectivity>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>outside</cpd-id>
</virtual-link-connectivity>
</vnf-profile>
<vnf-profile>
<id>router</id>
<vnfd-id>CSR</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>mgmt</virtual-link-profile-id>
<cpd-id>management</cpd-id>
</virtual-link-connectivity>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>right</cpd-id>
</virtual-link-connectivity>
</vnf-profile>
<virtual-link-profile>
<id>mgmt</id>
<virtual-link-desc-id>mgmt</virtual-link-desc-id>
<flavor-id>normal</flavor-id>
<max-bitrate-requirements>
<root>1000</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<virtual-link-profile>
<id>r2fw</id>
<virtual-link-desc-id>r2fw</virtual-link-desc-id>
<flavor-id>normal</flavor-id>
<max-bitrate-requirements>
<root>10000000</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<ns-instantiation-level>
<id>normal</id>
<description>Single FW and Router</description>
<vnf-to-level-mapping>
<vnf-profile-id>firewall</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
<vnf-to-level-mapping>
<vnf-profile-id>router</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
</ns-instantiation-level>
</df>
<df>
<id>router-fw-dpi</id>
<vnf-profile>
<id>firewall</id>
<vnfd-id>ASA</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>fw2dpi</virtual-link-profile-id>
<cpd-id>inside</cpd-id>
</virtual-link-connectivity>
<virtual-link-connectivity>
<virtual-link-profile-id>mgmt</virtual-link-profile-id>
<cpd-id>management</cpd-id>
</virtual-link-connectivity>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>outside</cpd-id>
</virtual-link-connectivity>
</vnf-profile>
<vnf-profile>
<id>router</id>
<vnfd-id>CSR</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>mgmt</virtual-link-profile-id>
<cpd-id>management</cpd-id>
</virtual-link-connectivity>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>right</cpd-id>
</virtual-link-connectivity>
</vnf-profile>
<pnf-profile>
<id>physical-dpi</id>
<pnfd-id>physical-dpi</pnfd-id>
<virtual-link-connectivity>
<virtual-link-profile-id>fw2dpi</virtual-link-profile-id>
<cpd-id>outside</cpd-id>
</virtual-link-connectivity>
</pnf-profile>
<virtual-link-profile>
<id>fw2dpi</id>
<virtual-link-desc-id>fw2dpi</virtual-link-desc-id>
<flavor-id>normal</flavor-id>
<max-bitrate-requirements>
<root>1000000</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<virtual-link-profile>
<id>mgmt</id>
<virtual-link-desc-id>mgmt</virtual-link-desc-id>
<flavor-id>normal</flavor-id>
<max-bitrate-requirements>
<root>1000</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<virtual-link-profile>
<id>r2fw</id>
<virtual-link-desc-id>r2fw</virtual-link-desc-id>
<flavor-id>normal</flavor-id>
<max-bitrate-requirements>
<root>1000000</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<ns-instantiation-level>
<id>normal</id>
<description>Router+FW+Physical DPI</description>
<vnf-to-level-mapping>
<vnf-profile-id>firewall</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
<vnf-to-level-mapping>
<vnf-profile-id>router</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
</ns-instantiation-level>
</df>
</nsd>
<nsd>
<id>service-chain-2</id>
<nested-nsd-id>firewall-nsd</nested-nsd-id>
<vnfd-id>CSR</vnfd-id>
<sapd>
<id>inside</id>
<ns>
<nsd-id>firewall-nsd</nsd-id>
<ext-cpd-id>inside</ext-cpd-id>
</ns>
</sapd>
<sapd>
<id>outside</id>
<vnf>
<vnfd-id>CSR</vnfd-id>
<ext-cpd-id>left</ext-cpd-id>
</vnf>
</sapd>
<virtual-link-desc>
<id>r2fw</id>
<version>1.0</version>
<connectivity-type>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:IPv4</layer-protocol>
</connectivity-type>
<df>
<id>r2fw</id>
<qos>
<latency>1000</latency>
<packet-delay-variation>2</packet-delay-variation>
</qos>
</df>
</virtual-link-desc>
<df>
<id>router-fw</id>
<vnf-profile>
<id>router</id>
<vnfd-id>CSR</vnfd-id>
<flavor-id>normal</flavor-id>
<instantiation-level>single</instantiation-level>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>right</cpd-id>
</virtual-link-connectivity>
</vnf-profile>
<virtual-link-profile>
<id>r2fw</id>
<virtual-link-desc-id>r2fw</virtual-link-desc-id>
<flavor-id>r2fw</flavor-id>
<max-bitrate-requirements>
<root>500</root>
</max-bitrate-requirements>
<min-bitrate-requirements>
<root>0</root>
</min-bitrate-requirements>
</virtual-link-profile>
<ns-instantiation-level>
<id>normal</id>
<vnf-to-level-mapping>
<vnf-profile-id>router</vnf-profile-id>
<number-of-instances>1</number-of-instances>
</vnf-to-level-mapping>
<virtual-link-to-level-mapping>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<root>10</root>
</virtual-link-to-level-mapping>
</ns-instantiation-level>
<ns-profile>
<id>firewall</id>
<nsd-id>firewall-nsd</nsd-id>
<ns-df-id>firewall</ns-df-id>
<instantiation-level-id>single</instantiation-level-id>
<min-number-of-instances>1</min-number-of-instances>
<max-number-of-instances>1</max-number-of-instances>
<virtual-link-connectivity>
<virtual-link-profile-id>r2fw</virtual-link-profile-id>
<cpd-id>outside</cpd-id>
</virtual-link-connectivity>
</ns-profile>
</df>
</nsd>
<pnfd>
<id>physical-dpi</id>
<version>1.0</version>
<ext-cpd>
<id>outside</id>
<layer-protocol xmlns:common="urn:etsi:params:xml:ns:yang:etsi-nfv-common">common:Ethernet</layer-protocol>
</ext-cpd>
</pnfd>
</nfv>
</config>
#!/bin/bash
echo "Testing"
set -e
source /opt/confd/confdrc
cd src
echo "Testing compilation"
CONFD_OPTS="--fail-on-warnings"
CONFD_OPTS=""
confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv-common.fxs etsi-nfv-common.yang
confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv.fxs etsi-nfv.yang
echo "Starting ConfD"
confd
echo "Loading Data"
confd_load -l -m nfv.xml
# Don't do this in the actual test, just waste of cycles
# echo "Stopping ConfD"
# confd --stop
module etsi-nfv-common {
namespace "urn:etsi:params:xml:ns:yang:etsi-nfv-common";
yang-version 1.1;
prefix common;
description
......@@ -368,18 +369,28 @@ module etsi-nfv-common {
information element.";
}
}
// The following grouping is Cpd information element as defined in
// IFA014. IFA011 defines its own Cpd information element, which
// is defined in etsi-nfv-vnf.yang file. Do not use this grouping
// for inclusion in a Vnf.
grouping cpd {
description
"A Cpd information element describes network connectivity to a
compute resource or a VL.";
"The Cpd information element specifies the characteristics of
connection points attached to NFs and NSs. This is an
abstract class used as parent for the various Cpd classes.
It has an attribute 'trunkMode' which enables the NFVO to
identify whether the Cp instantiated from the Cpd is in trunk
mode or not.";
reference
"GS NFC IFA011: Section 7.1.6.3 Cpd Information Element";
"GS NFC IFA014: Section 6.6.3.1 Cpd information element";
leaf id {
type string;
description
"Identifier of this Cpd information element.";
reference
"GS NFV IFA011: Section 7.1.6.3, Cpd information element.";
"GS NFC IFA014: Section 6.6.3.1 Cpd information element";
}
leaf layer-protocol {
mandatory true;
......@@ -387,134 +398,45 @@ module etsi-nfv-common {
base common:layer-protocol;
}
description
"Identifies which protocol the CP uses for connectivity
purposes (Ethernet, MPLS, ODU2, IPV4, IPV6, Pseudo-Wire,
etc.).";
"Identifies a protocol that the connection points
corresponding to the CPD support for connectivity purposes
(e.g. Ethernet, MPLS, ODU2, IPV4, IPV6, Pseudo-Wire, etc.).";
reference
"GS NFV IFA011: Section 7.1.6.3, Cpd information element.";
"GS NFC IFA014: Section 6.6.3.1 Cpd information element";
}
leaf role {
type identityref {
base common:cp-role;
}
description
"Identifies the role of the port in the context of the
traffic flow patterns in the VNF or parent NS. For example a
VNF with a tree flow pattern within the VNF will have legal