# 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
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
+
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";
}
}
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;
}
import rw-pb-ext {
- prefix "rw-pb-ext";
+ prefix "rwpb";
}
import rwsdn {
"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 {
--- /dev/null
+#!/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 <<EOF >/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
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":[],
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":
}
choice numa-policy {
- case numa-unware {
- leaf numa-unware {
+ case numa-unaware {
+ leaf numa-unaware {
type empty;
}
}
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";
input {
leaf name {
mandatory true;
- description "Name of the Network Service";
+ description "Name of the Network Service";
type string;
}
leaf nsd-ref {
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]
"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";
}
}
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";
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";
}
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;
augment /nsr:start-network-service/nsr:input{
uses rw-ns-instance-config;
- }
+ }
augment /nsr:ns-instance-opdata/nsr:nsr {
uses manotypes:action-param;
"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";
}
}
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 {
}
import rw-cloud {
- prefix "rwcloud";
+ prefix "rw-cloud";
}
import ietf-yang-types {
"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 {
}
import rw-cloud {
- prefix "rwcloud";
+ prefix "rw-cloud";
}
import rwvcs-types {
"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";
}
}
}
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";
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";
}
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;
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 {
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:
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 {
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',
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"]:
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
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 "
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
# 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)
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,
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,
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,
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,
# 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)
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
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:
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'
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
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:
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,
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
# 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
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 ''
)
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