#!/usr/bin/env python3
-#
+#
# Copyright 2016 RIFT.IO Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
RwVnfdYang,
VnfdYang,
RwYang,
- )
+)
try:
def compose(self, image_name, cloud_init="", cloud_init_file="", endpoint=None, mon_params=[],
mon_port=8888, mgmt_port=8888, num_vlr_count=1, num_ivlr_count=1,
- num_vms=1, image_md5sum=None, mano_ut=False):
+ num_vms=1, image_md5sum=None, mano_ut=False, use_static_ip=False):
self.descriptor = RwVnfdYang.YangData_Vnfd_VnfdCatalog()
self.id = str(uuid.uuid1())
vnfd = self.descriptor.vnfd.add()
cp = vnfd.connection_point.add()
cp.type_yang = 'VPORT'
cp.name = '%s/cp%d' % (self.name, i)
+ if use_static_ip:
+ if 'pong_' in self.name:
+ cp.static_ip_address = '31.31.31.31'
+ else:
+ cp.static_ip_address = '31.31.31.32'
if endpoint is not None:
endp = VnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd_HttpEndpoint(
node = vdu.guest_epa.numa_node_policy.node.add()
node.id = 0
node.memory_mb = 512
- node.vcpu = [0, 1]
+ vcpu = node.vcpu.add()
+ vcpu.id = 0
+ vcpu = node.vcpu.add()
+ vcpu.id = 1
node = vdu.guest_epa.numa_node_policy.node.add()
node.id = 1
node.memory_mb = 512
- node.vcpu = [2, 3]
+ vcpu = node.vcpu.add()
+ vcpu.id = 2
+ vcpu = node.vcpu.add()
+ vcpu.id = 3
# specify the vswitch EPA
vdu.vswitch_epa.ovs_acceleration = 'DISABLED'
internal_cp.name = cp_name + "/icp{}".format(i)
internal_cp.id = cp_name + "/icp{}".format(i)
internal_cp.type_yang = 'VPORT'
- internal_vlds[i].internal_connection_point_ref.append(internal_cp.id)
+ ivld_cp = internal_vlds[i].internal_connection_point_ref.add()
+ ivld_cp.id_ref = internal_cp.id
internal_interface = vdu.internal_interface.add()
internal_interface.name = 'fab%d' % i
ip_profile.ip_profile_params.ip_version = "ipv4"
ip_profile.ip_profile_params.subnet_address = "31.31.31.0/24"
ip_profile.ip_profile_params.gateway_address = "31.31.31.210"
-
+
vld_id = 1
for cpgroup in cpgroup_list:
vld = nsd.vld.add()
ex_pong_userdata=None,
use_placement_group=True,
use_ns_init_conf=True,
+ use_static_ip=False,
):
# List of connection point groups
# Each connection point group refers to a virtual link
num_vms=num_vnf_vms,
image_md5sum=ping_md5sum,
mano_ut=mano_ut,
+ use_static_ip=use_static_ip,
)
pong = VirtualNetworkFunction("pong_vnfd%s" % (suffix))
num_vms=num_vnf_vms,
image_md5sum=pong_md5sum,
mano_ut=mano_ut,
+ use_static_ip=use_static_ip,
)
# Initialize the member VNF index