From: Rajesh Velandy Date: Wed, 14 Dec 2016 18:18:39 +0000 (+0000) Subject: Merge branch 'v1.0' X-Git-Tag: v1.1.0~46 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d748ab1836d94ebe1273b1910954be3b2a2b4486;hp=308419079128a5c2ccd9c027e45bf225ceba50cf;p=osm%2FSO.git Merge branch 'v1.0' Signed-off-by: velandy --- diff --git a/BUILD.sh b/BUILD.sh index cb6fb37b..4d9f36a8 100755 --- a/BUILD.sh +++ b/BUILD.sh @@ -158,6 +158,7 @@ fi # and install of the packages required to build and run # this module if $runMkcontainer; then + sudo apt-get install -y libxml2-dev libxslt-dev sudo /usr/rift/container_tools/mkcontainer --modes build --modes ext --repo ${PLATFORM_REPOSITORY} fi @@ -269,8 +270,6 @@ if [[ $UIPathToBuild ]]; then sudo make -C $UIPathToBuild install fi -echo "To run SO with UI please run:" -echo 'sudo -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode' -echo -echo "To run SO without UI please run:" -echo 'sudo -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode --no-ui' +echo "Creating Service ...." +sudo $(dirname $0)/create_launchpad_service + diff --git a/common/plugins/yang/rw-cloud.yang b/common/plugins/yang/rw-cloud.yang index e4682ac6..2c7ce6fd 100644 --- a/common/plugins/yang/rw-cloud.yang +++ b/common/plugins/yang/rw-cloud.yang @@ -60,7 +60,7 @@ module rw-cloud leaf sdn-account { description "Configured SDN account associated with this cloud account"; type leafref { - path "/rw-sdn:sdn-account/rw-sdn:name"; + path "/rw-sdn:sdn/rw-sdn:account/rw-sdn:name"; } } diff --git a/common/plugins/yang/rw-sdn.tailf.yang b/common/plugins/yang/rw-sdn.tailf.yang index c8a4d46f..3f638836 100644 --- a/common/plugins/yang/rw-sdn.tailf.yang +++ b/common/plugins/yang/rw-sdn.tailf.yang @@ -30,7 +30,7 @@ module rw-sdn-annotation prefix tailf-common; } - tailf-common:annotate "/rw-sdn:sdn-account/rw-sdn:connection-status" { + tailf:annotate "/rw-sdn:sdn/rw-sdn:account/rw-sdn:connection-status" { tailf-common:callpoint rw_callpoint; } diff --git a/common/plugins/yang/rw-sdn.yang b/common/plugins/yang/rw-sdn.yang index 0a5b2285..6475cc52 100644 --- a/common/plugins/yang/rw-sdn.yang +++ b/common/plugins/yang/rw-sdn.yang @@ -25,7 +25,7 @@ module rw-sdn import rw-pb-ext { - prefix "rw-pb-ext"; + prefix "rwpb"; } import rwsdn { @@ -37,16 +37,17 @@ module rw-sdn "Initial revision."; } - list sdn-account { - rw-pb-ext:msg-new SDNAccountConfig; + container sdn { + list account { + rwpb:msg-new SDNAccountConfig; + key "name"; + leaf name { + type string; + } - key "name"; - leaf name { - type string; + uses rwsdn:sdn-provider-auth; + uses rwsdn:connection-status; } - - uses rwsdn:sdn-provider-auth; - uses rwsdn:connection-status; } rpc update-sdn-status { diff --git a/create_launchpad_service b/create_launchpad_service new file mode 100755 index 00000000..7e862d6b --- /dev/null +++ b/create_launchpad_service @@ -0,0 +1,40 @@ +#!/bin/bash +# install the launchpad systemd service +# these files should work on both ub16 and fc20 + +if [ $(whoami) != "root" ]; then + echo must be root + exit 1 +fi + + +cat </etc/systemd/system/launchpad.service +[Unit] +Description=RIFT.ware Launchpad +After=network-online.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/sh -c 'nohup sudo -b -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode' +ExecStop=/bin/sh -c 'killall rwmain' + +[Install] +WantedBy=default.target +EOF + +chmod 664 /etc/systemd/system/launchpad.service + +if ! systemctl daemon-reload; then + echo "WARNING: Not able to reload daemons: this must be run in a privileged container: sudo systemctl daemon-reload ; sudo systemctl enable launchpad.service" +else + # enable launchpad at boot - should always succeed in a privileged container + systemctl enable launchpad.service +fi + +# start launchpad? +#sudo systemctl start launchpad.service + +echo +echo "Launchpad service created and enabled. Run 'sudo systemctl start launchpad.service' to start the service." +echo diff --git a/models/openmano/python/rift/openmano/rift2openmano.py b/models/openmano/python/rift/openmano/rift2openmano.py index 67cef7e4..c29818f8 100755 --- a/models/openmano/python/rift/openmano/rift2openmano.py +++ b/models/openmano/python/rift/openmano/rift2openmano.py @@ -443,8 +443,11 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): vnfc["image name"] = vdu.image if vdu.has_field("image_checksum"): vnfc["image checksum"] = vdu.image_checksum - - if vdu.guest_epa.has_field("numa_node_policy"): + dedicated_int = False + for intf in list(vdu.internal_interface) + list(vdu.external_interface): + if intf.virtual_interface.type_yang in ["SR_IOV", "PCI_PASSTHROUGH"]: + dedicated_int = True + if vdu.guest_epa.has_field("numa_node_policy") or dedicated_int: vnfc["numas"] = [{ "memory": max(int(vdu.vm_flavor.memory_mb/1024), 1), "interfaces":[], @@ -510,9 +513,9 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): elif int_if.virtual_interface.type_yang in ["OM_MGMT"]: vnfc["bridge-ifaces"].append(intf) - elif int_if.virtual_interface.type_yang == "SR-IOV": + elif int_if.virtual_interface.type_yang == "SR_IOV": intf["bandwidth"] = "10 Gbps" - intf["dedicated"] = "yes:sriov" + intf["dedicated"] = "no" vnfc["numas"][0]["interfaces"].append(intf) elif int_if.virtual_interface.type_yang == "PCI_PASSTHROUGH": diff --git a/models/plugins/yang/mano-types.yang b/models/plugins/yang/mano-types.yang index 5f68b416..c3ea6988 100644 --- a/models/plugins/yang/mano-types.yang +++ b/models/plugins/yang/mano-types.yang @@ -851,8 +851,8 @@ module mano-types } choice numa-policy { - case numa-unware { - leaf numa-unware { + case numa-unaware { + leaf numa-unaware { type empty; } } diff --git a/models/plugins/yang/nsr.yang b/models/plugins/yang/nsr.yang index f7c16fe6..e8b65ae9 100644 --- a/models/plugins/yang/nsr.yang +++ b/models/plugins/yang/nsr.yang @@ -133,7 +133,7 @@ module nsr list key-pair { key "name"; - description "Used to configure the list of public keys to be injected as part + description "Used to configure the list of public keys to be injected as part of ns instantiation"; leaf name { description "Name of this key pair"; @@ -151,7 +151,7 @@ module nsr input { leaf name { mandatory true; - description "Name of the Network Service"; + description "Name of the Network Service"; type string; } leaf nsd-ref { @@ -265,8 +265,8 @@ module nsr key "placement-group-ref vnfd-id-ref"; leaf vnfd-id-ref { - description - "A reference to a vnfd. This is a + description + "A reference to a vnfd. This is a leafref to path: ../../../../nsd:constituent-vnfd + [nsr:id = current()/../nsd:id-ref] @@ -327,7 +327,7 @@ module nsr "The SDN account to use when requesting resources for this vnffgr"; type leafref { - path "/rwsdn:sdn-account/rwsdn:name"; + path "/rwsdn:sdn/rwsdn:account/rwsdn:name"; } } diff --git a/models/plugins/yang/rw-nsr.yang b/models/plugins/yang/rw-nsr.yang index ae2c92ac..805ed00c 100644 --- a/models/plugins/yang/rw-nsr.yang +++ b/models/plugins/yang/rw-nsr.yang @@ -64,8 +64,8 @@ module rw-nsr key "id"; description "Recent operational events for this network service. - Though the model does not impose any restrictions on the numbe of events, - the max operational events will be limited to the most recent 10"; + Though the model does not impose any restrictions on the numbe of events, + the max operational events will be limited to the most recent 10"; leaf id { description "The id of the instance"; @@ -137,9 +137,9 @@ module rw-nsr by multiple cloud accounts when that becomes available."; type string; } - + list vnf-cloud-account-map { - description + description "Mapping VNF to Cloud Account where VNF will be instantiated"; key "member-vnf-index-ref"; @@ -178,13 +178,13 @@ module rw-nsr } list vl-cloud-account-map { - description + description "Mapping VL to Cloud Account where VL will be instantiated"; key "vld-id-ref"; leaf vld-id-ref { - description + description "A reference to a vld. leafref path ../../nsd/vld/id"; type string; @@ -218,7 +218,7 @@ module rw-nsr augment /nsr:start-network-service/nsr:input{ uses rw-ns-instance-config; - } + } augment /nsr:ns-instance-opdata/nsr:nsr { uses manotypes:action-param; @@ -229,7 +229,7 @@ module rw-nsr "The SDN account associted with the cloud account using which an NS was instantiated."; type leafref { - path "/rw-sdn:sdn-account/rw-sdn:name"; + path "/rw-sdn:sdn/rw-sdn:account/rw-sdn:name"; } } @@ -438,7 +438,7 @@ module rw-nsr notification nsm-notification { description "Notification for NSM Events. - The timestamp of this event is automatically expressed + The timestamp of this event is automatically expressed in human readble format - 1970-01-01T00:00:00Z"; leaf event { diff --git a/models/plugins/yang/rw-vlr.yang b/models/plugins/yang/rw-vlr.yang index bbfd616e..755bb81c 100644 --- a/models/plugins/yang/rw-vlr.yang +++ b/models/plugins/yang/rw-vlr.yang @@ -32,7 +32,7 @@ module rw-vlr } import rw-cloud { - prefix "rwcloud"; + prefix "rw-cloud"; } import ietf-yang-types { @@ -53,7 +53,7 @@ module rw-vlr "The cloud account to use when requesting resources for this vlr"; type leafref { - path "/rwcloud:cloud/rwcloud:account/rwcloud:name"; + path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name"; } } leaf om-datacenter { diff --git a/models/plugins/yang/rw-vnfr.yang b/models/plugins/yang/rw-vnfr.yang index eb027e0d..be8acb4b 100644 --- a/models/plugins/yang/rw-vnfr.yang +++ b/models/plugins/yang/rw-vnfr.yang @@ -38,7 +38,7 @@ module rw-vnfr } import rw-cloud { - prefix "rwcloud"; + prefix "rw-cloud"; } import rwvcs-types { @@ -150,7 +150,7 @@ module rw-vnfr "The cloud account to use when requesting resources for this vnf"; type leafref { - path "/rwcloud:cloud/rwcloud:account/rwcloud:name"; + path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name"; } } diff --git a/models/plugins/yang/vnfr.yang b/models/plugins/yang/vnfr.yang index 14a2d814..4a85588e 100644 --- a/models/plugins/yang/vnfr.yang +++ b/models/plugins/yang/vnfr.yang @@ -191,7 +191,7 @@ module vnfr } leaf create-time { - description + description "Creation timestamp of this Virtual Network Function. The timestamp is expressed as seconds since unix epoch - 1970-01-01T00:00:00Z"; @@ -258,7 +258,7 @@ module vnfr uses vnfd:common-connection-point; leaf vlr-ref { - description + description "Reference to the VLR associated with this connection point"; type leafref { path "/vlr:vlr-catalog/vlr:vlr/vlr:id"; @@ -266,10 +266,16 @@ module vnfr } leaf ip-address { - description + description "IP address assigned to the external connection point"; type inet:ip-address; } + leaf mac-address { + description + "MAC address assigned to the external connection point"; + // type inet:mac-address; + type string; + } leaf connection-point-id { rwpb:field-inline "true"; rwpb:field-string-max 64; @@ -371,10 +377,16 @@ module vnfr uses vnfd:common-connection-point; leaf ip-address { - description - "IP address assigned to the external connection point"; + description + "IP address assigned to the internal connection point"; type inet:ip-address; } + leaf mac-address { + description + "MAC address assigned to the internal connection point"; + // type inet:mac-address; + type string; + } } list internal-interface { diff --git a/rwcal/plugins/vala/rwcal_openstack/rwcal_openstack.py b/rwcal/plugins/vala/rwcal_openstack/rwcal_openstack.py index 05dc4989..936db92c 100644 --- a/rwcal/plugins/vala/rwcal_openstack/rwcal_openstack.py +++ b/rwcal/plugins/vala/rwcal_openstack/rwcal_openstack.py @@ -1180,6 +1180,8 @@ class RwcalOpenstackPlugin(GObject.Object, RwCal.Cloud): if ('fixed_ips' in port_info) and (len(port_info['fixed_ips']) >= 1): if 'ip_address' in port_info['fixed_ips'][0]: c_point.ip_address = port_info['fixed_ips'][0]['ip_address'] + if 'mac_address' in port_info : + c_point.mac_addr = port_info['mac_address'] if port_info['status'] == 'ACTIVE': c_point.state = 'active' else: diff --git a/rwcal/plugins/yang/rwcal.yang b/rwcal/plugins/yang/rwcal.yang index 76bd38b3..2e768f9d 100644 --- a/rwcal/plugins/yang/rwcal.yang +++ b/rwcal/plugins/yang/rwcal.yang @@ -1109,6 +1109,12 @@ module rwcal rwpb:field-string-max 64; type string; } + + leaf mac-addr { + rwpb:field-inline "true"; + rwpb:field-string-max 48; + type string; + } } grouping virtual-link-info-params { diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/scripts/onboard_pkg b/rwlaunchpad/plugins/rwlaunchpadtasklet/scripts/onboard_pkg index 6a39775b..741fbae2 100755 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/scripts/onboard_pkg +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/scripts/onboard_pkg @@ -400,8 +400,8 @@ if __name__ == "__main__": parser.add_argument("-p", "--upload-port", default=4567, type=int, help="Upload port number, default 4567") - parser.add_argument("-P", "--restconf-port", default=8888, type=int, - help="RESTconf port number, default 8888") + parser.add_argument("-P", "--restconf-port", default=8008, type=int, + help="RESTconf port number, default 8008") parser.add_argument("--restconf-user", default='admin', help="RESTconf user name, default admin") parser.add_argument("--restconf-password", default='admin', diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py index d3ff7f22..6c189464 100644 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py @@ -550,6 +550,11 @@ class OpenmanoNsr(object): return vnf["ip_address"].strip() return None + def get_vnf_mac_address(vnf): + if "mac_address" in vnf: + return vnf["mac_address"].strip() + return None + def get_ext_cp_info(vnf): cp_info_list = [] for vm in vnf["vms"]: @@ -567,7 +572,11 @@ class OpenmanoNsr(object): if ip_address is None: ip_address = "0.0.0.0" - cp_info_list.append((intf["external_name"], ip_address)) + mac_address = intf["mac_address"] + if mac_address is None: + mac_address="00:00:00:00:00:00" + + cp_info_list.append((intf["external_name"], ip_address, mac_address)) return cp_info_list @@ -615,6 +624,7 @@ class OpenmanoNsr(object): if all_vms_active(vnf_status): vnf_ip_address = get_vnf_ip_address(vnf_status) + vnf_mac_address = get_vnf_mac_address(vnf_status) if vnf_ip_address is None: self._log.warning("No IP address obtained " @@ -625,7 +635,7 @@ class OpenmanoNsr(object): self._log.debug("All VMs in VNF are active. Marking as running.") vnfr_msg.operational_status = "running" - self._log.debug("Got VNF ip address: %s", vnf_ip_address) + self._log.debug("Got VNF ip address: %s, mac-address: %s", vnf_ip_address, vnf_mac_address) vnfr_msg.mgmt_interface.ip_address = vnf_ip_address vnfr_msg.vnf_configuration.config_access.mgmt_ip_address = vnf_ip_address @@ -643,11 +653,12 @@ class OpenmanoNsr(object): # Add connection point information for the config manager cp_info_list = get_ext_cp_info(vnf_status) - for (cp_name, cp_ip) in cp_info_list: + for (cp_name, cp_ip, cp_mac_addr) in cp_info_list: cp = vnfr_msg.connection_point.add() cp.name = cp_name cp.short_name = cp_name cp.ip_address = cp_ip + cp.mac_address = cp_mac_addr yield from self._publisher.publish_vnfr(None, vnfr_msg) active_vnfs.append(vnfr) diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py index f43b0cb5..85349521 100755 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py @@ -220,7 +220,6 @@ class VnffgRecord(object): if self._vnffgr_state == VnffgRecordState.INIT: vnffgr_dict = {"id": self._vnffgr_id, - "nsd_id": self._nsr.nsd_id, "vnffgd_id_ref": self._vnffgd_msg.id, "vnffgd_name_ref": self._vnffgd_msg.name, "sdn_account": self._sdn_account_name, @@ -229,7 +228,6 @@ class VnffgRecord(object): vnffgr = NsrYang.YangData_Nsr_NsInstanceOpdata_Nsr_Vnffgr.from_dict(vnffgr_dict) elif self._vnffgr_state == VnffgRecordState.TERMINATED: vnffgr_dict = {"id": self._vnffgr_id, - "nsd_id": self._nsr.nsd_id, "vnffgd_id_ref": self._vnffgd_msg.id, "vnffgd_name_ref": self._vnffgd_msg.name, "sdn_account": self._sdn_account_name, @@ -243,7 +241,6 @@ class VnffgRecord(object): self._log.exception("Fetching VNFFGR for VNFFG with id %s failed", self._vnffgr_id) self._vnffgr_state = VnffgRecordState.FAILED vnffgr_dict = {"id": self._vnffgr_id, - "nsd_id": self._nsr.nsd_id, "vnffgd_id_ref": self._vnffgd_msg.id, "vnffgd_name_ref": self._vnffgd_msg.name, "sdn_account": self._sdn_account_name, @@ -257,7 +254,6 @@ class VnffgRecord(object): def vnffgr_create_msg(self): """ Virtual Link Record message for Creating VLR in VNS """ vnffgr_dict = {"id": self._vnffgr_id, - "nsd_id": self._nsr.nsd_id, "vnffgd_id_ref": self._vnffgd_msg.id, "vnffgd_name_ref": self._vnffgd_msg.name, "sdn_account": self._sdn_account_name, @@ -4124,7 +4120,10 @@ class NsManager(object): # Terminate the instances/networks assocaited with this nw service self._log.debug("Terminating the network service %s", nsr_id) - yield from self._nsrs[nsr_id].terminate() + try : + yield from self._nsrs[nsr_id].terminate() + except Exception as e: + self.log.exception("Failed to terminate NSR[id=%s]", nsr_id) # Unref the NSD yield from self.nsd_unref_by_nsr_id(nsr_id) diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py index 0ebe9df3..cf836120 100755 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwvnffgmgr.py @@ -190,7 +190,7 @@ class VnffgMgr(object): vnfr.mgmt_address = cp_ref.connection_point_params.mgmt_address vnfr.mgmt_port = 5000 vnfr_list.append(vnfr) - + vdu = vnfr.vdu_list.add() vdu.name = cp_ref.connection_point_params.name vdu.port_id = cp_ref.connection_point_params.port_id @@ -220,9 +220,9 @@ class VnffgMgr(object): if(len(classifier_list) == 2): meta[vnffgr.classifier[0].id] = '0x' + ''.join(str("%0.2X"%int(i)) for i in vnffgr.classifier[1].ip_address.split('.')) meta[vnffgr.classifier[1].id] = '0x' + ''.join(str("%0.2X"%int(i)) for i in vnffgr.classifier[0].ip_address.split('.')) - + self._log.debug("VNFFG Meta VNFFG chain is {}".format(meta)) - + for classifier in classifier_list: vnffgr_cl = [_classifier for _classifier in vnffgr.classifier if classifier.id == _classifier.id] if len(vnffgr_cl) > 0: @@ -236,8 +236,8 @@ class VnffgMgr(object): vnffgcl.port_id = vnffgr_cl[0].port_id vnffgcl.vm_id = vnffgr_cl[0].vm_id # Get the symmetric classifier endpoint ip and set it in nsh ctx1 - - vnffgcl.vnffg_metadata.ctx1 = meta.get(vnffgr_cl[0].id,'0') + + vnffgcl.vnffg_metadata.ctx1 = meta.get(vnffgr_cl[0].id,'0') vnffgcl.vnffg_metadata.ctx2 = '0' vnffgcl.vnffg_metadata.ctx3 = '0' vnffgcl.vnffg_metadata.ctx4 = '0' @@ -323,7 +323,7 @@ class VnffgMgr(object): del self._vnffgr_list[vnffgr_id] class SDNAccountDtsHandler(object): - XPATH = "C,/rw-sdn:sdn-account" + XPATH = "C,/rw-sdn:sdn/rw-sdn:account" def __init__(self, dts, log, parent): self._dts = dts diff --git a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py index 0f4ef343..d359aa4f 100755 --- a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py +++ b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py @@ -311,6 +311,14 @@ class VirtualDeploymentUnitRecord(object): return conn_point.ip_address return "0.0.0.0" + def cp_mac_addr(self, cp_name): + """ Find mac address by connection point name """ + if self._vm_resp is not None: + for conn_point in self._vm_resp.connection_points: + if conn_point.name == cp_name: + return conn_point.mac_addr + return "00:00:00:00:00:00" + def cp_id(self, cp_name): """ Find connection point id by connection point name """ if self._vm_resp is not None: @@ -422,7 +430,8 @@ class VirtualDeploymentUnitRecord(object): icp_list.append({"name": cp.name, "id": cp.id, "type_yang": "VPORT", - "ip_address": self.cp_ip_addr(cp.id)}) + "ip_address": self.cp_ip_addr(cp.id), + "mac_address": self.cp_mac_addr(cp.id)}) ii_list.append({"name": intf.name, "vdur_internal_connection_point_ref": cp.id, @@ -437,7 +446,10 @@ class VirtualDeploymentUnitRecord(object): ei_list.append({"name": cp, "vnfd_connection_point_ref": cp, "virtual_interface": {}}) - self._vnfr.update_cp(cp, self.cp_ip_addr(cp), self.cp_id(cp)) + self._vnfr.update_cp(cp, + self.cp_ip_addr(cp), + self.cp_mac_addr(cp), + self.cp_id(cp)) vdur_dict["external_interface"] = ei_list @@ -1706,13 +1718,14 @@ class VirtualNetworkFunctionRecord(object): # Update the VNFR with the changed status yield from self.publish(None) - def update_cp(self, cp_name, ip_address, cp_id): + def update_cp(self, cp_name, ip_address, mac_addr, cp_id): """Updated the connection point with ip address""" for cp in self._cprs: if cp.name == cp_name: self._log.debug("Setting ip address and id for cp %s, cpr %s with ip %s id %s", cp_name, cp, ip_address, cp_id) cp.ip_address = ip_address + cp.mac_address = mac_addr cp.connection_point_id = cp_id return diff --git a/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py b/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py index 1f888249..0ced574b 100755 --- a/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py +++ b/rwlaunchpad/plugins/rwvns/rift/tasklets/rwvnstasklet/rwvnstasklet.py @@ -82,7 +82,7 @@ class SDNAccountDtsOperdataHandler(object): def _register_show_status(self): def get_xpath(sdn_name=None): - return "D,/rw-sdn:sdn-account{}/rw-sdn:connection-status".format( + return "D,/rw-sdn:sdn/rw-sdn:account{}/rw-sdn:connection-status".format( "[name='%s']" % sdn_name if sdn_name is not None else '' ) @@ -152,7 +152,7 @@ class SDNAccountDtsOperdataHandler(object): yield from self._register_validate_rpc() class SDNAccountDtsHandler(object): - XPATH = "C,/rw-sdn:sdn-account" + XPATH = "C,/rw-sdn:sdn/rw-sdn:account" def __init__(self, dts, log, parent): self._dts = dts