From 094395a0910126738305cf1892c39fdcb5d4bee9 Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Fri, 8 Feb 2019 12:32:05 -0800 Subject: [PATCH 1/2] Fix for bug#170 --- example-data/complex-vnfd.xml | 260 ++++++++++++++++++++++++++++++++++ example-data/nfv.xml | 8 +- run-test.sh | 4 +- src/yang/etsi-nfv-vnf.yang | 8 +- 4 files changed, 271 insertions(+), 9 deletions(-) create mode 100644 example-data/complex-vnfd.xml diff --git a/example-data/complex-vnfd.xml b/example-data/complex-vnfd.xml new file mode 100644 index 0000000..8aee7fc --- /dev/null +++ b/example-data/complex-vnfd.xml @@ -0,0 +1,260 @@ + + + + complex-vnf + ACME + complex-vnf + 1.0 + 1.0 + netconf + + control-plane-active + control-plane-active + + internal + internal-vl + IPv4 + + + mgmt + mgmt + IPv4 + + CP + root + CP + + + control-plane-standby + control-plane-standby + + internal + internal-vl + IPv4 + + + mgmt + mgmt + IPv4 + + CP + root + CP + + + data-plane + data-plane + + in + IPv4 + + + internal + internal-vl + IPv4 + + + out + IPv4 + + DP + root + DP + + + CP + + 16.0 + + + 8 + + + + DP + + 32.0 + + + 16 + + + + root + root + 10 + + + CP + CP + bare + qcow2 + http://acme.images.com/control-plane.qcow2 + + + DP + DP + bare + qcow2 + http://acme.images.com/data-plane.qcow2 + + + internal-vl + + + IPv4 + + + + + mgmt + + + IPv4 + + + + + in + + data-plane + in + + IPv4 + + + mgmt + mgmt + IPv4 + + + out + + data-plane + out + + IPv4 + + + gold + + control-plane-active + 1 + 1 + + control-plane + + + + control-plane-standby + 1 + 1 + + control-plane + + + + data-plane + 2 + 8 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + + il-2 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 4 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + silver + + control-plane-active + 1 + 1 + + control-plane + + + + control-plane-standby + 1 + 1 + + control-plane + + + + data-plane + 1 + 4 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 1 + + + + il-2 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + + diff --git a/example-data/nfv.xml b/example-data/nfv.xml index ddfd65a..23a6b64 100644 --- a/example-data/nfv.xml +++ b/example-data/nfv.xml @@ -25,7 +25,7 @@ asa-vsd asa-image - + asa-vcd 4.0 @@ -33,7 +33,7 @@ 2 - + asa-vsd root @@ -120,7 +120,7 @@ csr-vsd csr-image - + csr-vcd 4.0 @@ -128,7 +128,7 @@ 2 - + csr-vsd root diff --git a/run-test.sh b/run-test.sh index 36bc6ec..e45d593 100755 --- a/run-test.sh +++ b/run-test.sh @@ -15,8 +15,10 @@ confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv.fxs etsi-nfv.yang echo "Starting ConfD" confd -echo "Loading Data" +echo "Loading data for the simple example" confd_load -l -m nfv.xml +echo "Loading data for the complex Vnfd example" +confd_load -l -m complex-vnfd.xml # Don't do this in the actual test, just waste of cycles # echo "Stopping ConfD" diff --git a/src/yang/etsi-nfv-vnf.yang b/src/yang/etsi-nfv-vnf.yang index cc08efb..eaae5e7 100755 --- a/src/yang/etsi-nfv-vnf.yang +++ b/src/yang/etsi-nfv-vnf.yang @@ -82,7 +82,7 @@ submodule etsi-nfv-vnf { } leaf nicio-requirements { type leafref { - path "/nfv/vnfd/virtual-compute-descriptor/id"; + path "/nfv/vnfd/virtual-compute-desc/id"; } description "This references (couples) the CPD with any logical node I/O @@ -295,10 +295,10 @@ submodule etsi-nfv-vnf { } leaf virtual-compute-desc { type leafref { - path "../../nfv:virtual-compute-descriptor/" + + path "../../nfv:virtual-compute-desc/" + "nfv:id"; } - must "../../nfv:virtual-compute-descriptor[id=current()]/" + + must "../../nfv:virtual-compute-desc[id=current()]/" + "nfv:virtual-memory/size >=" + "../../nfv:sw-image-desc[id=current()/" + "../sw-image-desc]/min-ram" { @@ -419,7 +419,7 @@ submodule etsi-nfv-vnf { } } - list virtual-compute-descriptor { + list virtual-compute-desc { key "id"; description "Defines descriptors of virtual compute resources to be -- GitLab From a4ee78162f5552351a0c8aae6a4564c982b5a8f4 Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Fri, 29 Mar 2019 16:09:19 -0700 Subject: [PATCH 2/2] Fixed company names and URL for image path. --- example-data/complex-vnfd.xml | 486 +++++++++++++++++----------------- example-data/nfv.xml | 4 +- 2 files changed, 244 insertions(+), 246 deletions(-) diff --git a/example-data/complex-vnfd.xml b/example-data/complex-vnfd.xml index 8aee7fc..31f56c3 100644 --- a/example-data/complex-vnfd.xml +++ b/example-data/complex-vnfd.xml @@ -1,260 +1,258 @@ - - - - complex-vnf - ACME - complex-vnf - 1.0 - 1.0 - netconf - - control-plane-active - control-plane-active - - internal - internal-vl - IPv4 - - - mgmt - mgmt - IPv4 - - CP - root - CP - - - control-plane-standby - control-plane-standby - - internal - internal-vl - IPv4 - - - mgmt - mgmt - IPv4 - - CP - root - CP - - - data-plane - data-plane - - in - IPv4 - - - internal - internal-vl - IPv4 - - - out - IPv4 - - DP - root - DP - - - CP - - 16.0 - - - 8 - - - - DP - - 32.0 - - - 16 - - - - root - root - 10 - - - CP - CP - bare - qcow2 - http://acme.images.com/control-plane.qcow2 - - - DP - DP - bare - qcow2 - http://acme.images.com/data-plane.qcow2 - - - internal-vl - - - IPv4 - - - - + + + complex-vnf + My Company + complex-vnf + 1.0 + 1.0 + netconf + + control-plane-active + control-plane-active + + internal + internal-vl + IPv4 + + mgmt - - - IPv4 - - - - - in - - data-plane - in - + mgmt + IPv4 + + CP + root + CP + + + control-plane-standby + control-plane-standby + + internal + internal-vl IPv4 - - + + mgmt mgmt IPv4 - - + + CP + root + CP + + + data-plane + data-plane + + in + IPv4 + + + internal + internal-vl + IPv4 + + out - - data-plane - out - IPv4 - - - gold - - control-plane-active - 1 - 1 - - control-plane - - - - control-plane-standby - 1 - 1 - - control-plane - - - - data-plane - 2 - 8 - - - il-1 - - control-plane-active - 1 - - - control-plane-standby - 1 - - - data-plane - 2 - - - - il-2 - - control-plane-active - 1 - - - control-plane-standby - 1 - - - data-plane - 4 - - - il-1 + + DP + root + DP + + + CP + + 16.0 + + + 8 + + + + DP + + 32.0 + + + 16 + + + + root + root + 10 + + + CP + CP + bare + qcow2 + http://mycompany.images.com/control-plane.qcow2 + + + DP + DP + bare + qcow2 + http://mycompany.images.com/data-plane.qcow2 + + + internal-vl + + + IPv4 + + + + + mgmt + + + IPv4 + + + + + in + + data-plane + in + + IPv4 + + + mgmt + mgmt + IPv4 + + + out + + data-plane + out + + IPv4 + + + gold + + control-plane-active + 1 + 1 + + control-plane + + + + control-plane-standby + 1 + 1 control-plane - anti-affinity - nfvi-node - - - silver - + + + data-plane + 2 + 8 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + + il-2 + control-plane-active - 1 - 1 - - control-plane - - - + 1 + + control-plane-standby - 1 - 1 - - control-plane - - - + 1 + + data-plane - 1 - 4 - - - il-1 - - control-plane-active - 1 - - - control-plane-standby - 1 - - - data-plane - 1 - - - - il-2 - - control-plane-active - 1 - - - control-plane-standby - 1 - - - data-plane - 2 - - - il-1 + 4 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + silver + + control-plane-active + 1 + 1 control-plane - anti-affinity - nfvi-node - - - - + + + control-plane-standby + 1 + 1 + + control-plane + + + + data-plane + 1 + 4 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 1 + + + + il-2 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + diff --git a/example-data/nfv.xml b/example-data/nfv.xml index 23a6b64..16f09cf 100644 --- a/example-data/nfv.xml +++ b/example-data/nfv.xml @@ -44,7 +44,7 @@ bare qcow2 2.0 - http://www.cisco.com/asa.qcow2 + http://mycompany.images.com/asa.qcow2 inside @@ -139,7 +139,7 @@ bare qcow2 2.0 - http://www.cisco.com/csr.qcow2 + http://mycompany.images.com/csr.qcow2 left -- GitLab