示例#1
0
def create_cloudsim_resource_template():
    ### Resource to be reuqested for 'cloudsim'
    resource_requests = {'compute': {}, 'network': {}}

    ###### mycompute-0
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = "1"
    msg.vm_flavor.vcpu_count = 4
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 40
    resource_requests['compute']['mycompute-0'] = msg

    ###### mycompute-1
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = "1"
    msg.vm_flavor.vcpu_count = 2
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 20
    resource_requests['compute']['mycompute-1'] = msg

    ####### mynet-0
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    resource_requests['network']['mynet-0'] = msg
    
    ####### mynet-1
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    resource_requests['network']['mynet-1'] = msg

    return resource_requests
示例#2
0
def create_mock_resource_temaplate():
    ### Resource to be reuqested for 'mock'
    resource_requests = {'compute': {}, 'network': {}}

    ###### mycompute-0
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = str(uuid.uuid3(uuid.NAMESPACE_DNS, 'image-0'))
    msg.vm_flavor.vcpu_count = 4
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 40
    resource_requests['compute']['mycompute-0'] = msg

    ###### mycompute-1
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = str(uuid.uuid3(uuid.NAMESPACE_DNS, 'image-1'))
    msg.vm_flavor.vcpu_count = 2
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 20
    resource_requests['compute']['mycompute-1'] = msg

    ####### mynet-0
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    resource_requests['network']['mynet-0'] = msg
    
    ####### mynet-1
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    resource_requests['network']['mynet-1'] = msg

    return resource_requests
示例#3
0
def create_openstack_static_template():
    ### Resource to be reuqested for 'openstack_static'
    resource_requests = {'compute': {}, 'network': {}}

    ###### mycompute-0
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = openstack_info['image_id']
    msg.vm_flavor.vcpu_count = 4
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 80
    resource_requests['compute']['mycompute-0'] = msg

    ###### mycompute-1
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = openstack_info['image_id']
    msg.vm_flavor.vcpu_count = 2
    msg.vm_flavor.memory_mb = 4096
    msg.vm_flavor.storage_gb = 40
    resource_requests['compute']['mycompute-1'] = msg

    ####### mynet-0
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    msg.provider_network.physical_network = 'PHYSNET1'
    msg.provider_network.overlay_type = 'VLAN'
    msg.provider_network.segmentation_id = 17
    resource_requests['network']['mynet-0'] = msg
    
    ####### mynet-1
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    msg.provider_network.physical_network = 'PHYSNET1'
    msg.provider_network.overlay_type = 'VLAN'
    msg.provider_network.segmentation_id = 18
    resource_requests['network']['mynet-1'] = msg

    return resource_requests
示例#4
0
def create_openstack_dynamic_template():
    ### Resource to be reuqested for 'openstack_dynamic'
    resource_requests = {'compute': {}, 'network': {}}

    ###### mycompute-0
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = openstack_info['image_id']
    msg.vm_flavor.vcpu_count = 2
    msg.vm_flavor.memory_mb = 4096
    msg.vm_flavor.storage_gb = 40
    msg.guest_epa.mempage_size = 'LARGE'
    msg.guest_epa.cpu_pinning_policy = 'DEDICATED'
    msg.allocate_public_address = True
    
    resource_requests['compute']['mycompute-0'] = msg

    ###### mycompute-1
    msg = rmgryang.VDUEventData_RequestInfo()
    msg.image_id  = openstack_info['image_id']
    msg.vm_flavor.vcpu_count = 4
    msg.vm_flavor.memory_mb = 8192
    msg.vm_flavor.storage_gb = 40
    msg.guest_epa.mempage_size = 'LARGE'
    msg.guest_epa.cpu_pinning_policy = 'DEDICATED'
    msg.allocate_public_address = True
    
    resource_requests['compute']['mycompute-1'] = msg

    ####### mynet-0
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    #msg.provider_network.overlay_type = 'VXLAN'
    #msg.provider_network.segmentation_id = 71

    resource_requests['network']['mynet-0'] = msg

    ####### mynet-1
    msg = rmgryang.VirtualLinkEventData_RequestInfo()
    #msg.provider_network.overlay_type = 'VXLAN'
    #msg.provider_network.segmentation_id = 73
    resource_requests['network']['mynet-1'] = msg

    return resource_requests