}
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 {
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)
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