Day29 MANO开源专案使用之kube5gnfvo - 样板介绍篇

相信在前两天介绍的OSM部分,有观看的大概了解了关於Network Slicing(NS)实例化所需的一个步骤了吧!我们来回顾一下吧。

建立VNF Package ->建立 NS Package ->实例化NS Package

那麽今天我要来介绍如何在kube5gnfvo中建立自己的NS,首先先讲一点,由於kube5gnfvo属於後端部分,因此本篇使用Postman做一个API测试,

样板使用与说明

首先我们先建立自己的VNF,此次我使用ubuntu做一个VNF的范例,有兴趣的可以去kube5gnfvo的example查看,里面有写好的template,可以直接使用。
首先,VNF的资料结构如下:

├── Definitions
│   └── ubuntu.yaml
├── Files
│   ├── Artifacts
│   └── ChangeLog.txt
├── TOSCA-Metadata
│   └── TOSCA.meta
└── ubuntu-test.mf

主要部分为Definitions和Files
Definitions放置主要的描述档案
Files则放置一些配置资料的档案内容

VNF

  • ubuntu.yaml
tosca_definitions_version: tosca_simple_yaml_1_0

topology_template:
  node_templates:
    VNF1:
      type: tosca.nodes.nfv.VNF
      properties:
        descriptor_id: 367f45fd-1dd2-11b2-8001-080027ubuntu
        descriptor_version: 1.0
        provider: imac
        product_name: ubuntu
        software_version: latest

    VDU1:
      type: tosca.nodes.nfv.Vdu.Compute
      properties:
        sw_image_data:
          name: ubuntu
          provider: free5gmano
          version: laster
          diskFormat: raw
      capabilities:
        virtual_compute:
          properties:
            virtual_memory:
              virtual_mem_size: 512Mi
            virtual_cpu:
              num_virtual_cpu: 250m
      artifacts:
        sw_image:
          type: tosca.artifacts.nfv.SwImage
          file: ubuntu:20.04
      attributes:
        namespace: default
        replicas: 1
        command: [sh, -c, sleep 360d]

    CP1:
      type: tosca.nodes.nfv.Cpd
      properties:
        layer_protocol: ipv4
      requirements:
        virtual_binding: VDU1
        virtual_link: VL1

    VL1:
      type: tosca.nodes.nfv.VnfVirtualLink
      properties:
        network_name: management
        vl_profile:
          virtual_link_protocol_data:
            l3_protocol_data:
              dhcp_enabled: False
    CP2:
      type: tosca.nodes.nfv.Cpd
      properties:
        type: ovs
        layer_protocol: ipv4
      requirements:
        virtual_binding: VDU1
        virtual_link: VL2

    VL2:
      type: tosca.nodes.nfv.VnfVirtualLink
      properties:
        network_name: ovs-net
        vl_profile:
          virtual_link_protocol_data:
            l3_protocol_data:
              cidr: 192.168.2.162/23

其中主要几个栏位为VDU中的 artifacts 、attributes以及VNF的descriptor_id和CP、VL的内容

VDU

  • artifacts: 这里去设定image使用的内容部分,当然还有其他的栏位或功能部分,可以查看example内的其他template做参考
  • attributes:一些额外的变数部分,我在此使用command而已,还有许多内容可以参考其他template
    VNF
    *descriptor_id:此栏位定义VNF的ID的部分,在NS描述中,会使用到此ID作为VNF绑定在NS上的一句
    CP、VL:主要为连线部分的设定,也就是拿来设定VNF本身的介面内容的部分,此区有使用两个CP和VL,也就是会有本身的介面和一个第二介面,此处第二介面使用的是ovs

其他的内容主要都是给其他使用者使用的栏位,主要都不是给MANO做布署服务的部分,所以就不一一做解释了。剩下的其他资料结构,主要是用来查询档案的位置以及给使用者解释使用的栏位,这部分相信看到这里的应该都有了基础知识,我也不一一赘述了。

NS

关於NS的资料结构的部分

├── Definitions
│   └── ns.yaml
├── Files
│   └── ChangeLog.txt
├── TOSCA-Metadata
│   └── TOSCA.meta
└── free5gc-ns.mf

ns.yaml

tosca_definitions_version: tosca_simple_yaml_1_2

topology_template:
  node_templates:
    NS1:
      type: tosca.nodes.nfv.NS
      properties:
        descriptor_id: df931963-ebce-40e4-b810-9fe5c3450b80
        designer: imac
        version: 1.0
        name: ubuntu-ns
        invariant_id: 1111-2222-aaaa-bbbb
        constituent_vnfd:
          - vnfd_id: 367f45fd-1dd2-11b2-8001-080027ubuntu

主要介绍 descriptor_id、constituent_vnfd这两个变数部分

descriptor_id:此为NS的栏位部分,主要给实例化时做搜寻使用的部分。
constituent_vnfd:这边可以放多个vnf的ID,也就是刚刚介绍VNF与NS做绑定的栏位部分。

多VNF的ns.yaml

tosca_definitions_version: tosca_simple_yaml_1_2

topology_template:
  node_templates:
    NS1:
      type: tosca.nodes.nfv.NS
      properties:
        descriptor_id: df931963-ebce-40e4-b810-9fe5c3450b80
        designer: imac
        version: 1.0
        name: ubuntu-ns
        invariant_id: 1111-2222-aaaa-bbbb
        constituent_vnfd:
          - vnfd_id: 367f45fd-1dd2-11b2-8001-080027ubuntu
          - vnfd_id: 367f45fd-1dd2-11b2-8001-080028ubuntu
          - vnfd_id: 367f45fd-1dd2-11b2-8001-080029ubuntu
          ...

NS的资料结构也主要是这部分,其他的也跟VNF的资料结构差不多,多是要来查询资料的档案位置以及让使用者读所使用的。
那麽今天主要介绍一下要如何修改template,只介绍主要会用到的栏位,其他的多是让人看的,而不是用来布署使用的。
那麽明天就是最後一天了,就让我努力的水到最後吧!!


<<:  Flutter基础介绍与实作-Day30 最後总结

>>:  Android Studio初学笔记-Day29-ButtomNavigationView

R^2 决定系数 | ML#Day22

到目前为止,我们靠着不断尝试和Vertex的帮助之下,顺利地走完一个周期。 了解概论 -> 命...

# Day28--让commit像战国时代一样分分合合

上一篇我们学到怎麽使用Vim,还有修改commit message,这次要做的事情呢,就是要来合并跟...

2021年破框计画,一起犇向更好的自己

假期过後,我们如何能比2020年的自己,过得更踏实自信? 最近,在樊登读书APP上听到一本书 觉得非...

Day26 Let's ODOO: ODOO Studio

今天来介绍Odoo studio,对於程序苦手或非程序人员,运用Odoo studio可以直接透过见...

[教学] 如何使用Visual Studio 内建SQL工具修复资料库

大家好,我是一名菜鸟工程师,这篇文章用来记录我工作遇到的需求及解决方式,如果有更好的解决方式,也欢迎...