diff --git a/simple_secure_ee_ns/icons/osm.png b/simple_secure_ee_ns/icons/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..62012d2a2b491bdcd536d62c3c3c863c0d8c1b33 Binary files /dev/null and b/simple_secure_ee_ns/icons/osm.png differ diff --git a/simple_secure_ee_ns/simple_ee_nsd.yaml b/simple_secure_ee_ns/simple_ee_nsd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ee65272277074bf1821ca6a655ebf19797536798 --- /dev/null +++ b/simple_secure_ee_ns/simple_ee_nsd.yaml @@ -0,0 +1,21 @@ +nsd: + nsd: + - description: NS with 2 VNFs with cloudinit connected by datanet and mgmtnet VLs + df: + - id: default-df + vnf-profile: + - id: simple + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: simple + constituent-cpd-id: vnf-mgmt-ext + virtual-link-profile-id: mgmtnet + vnfd-id: simple_secure_ee-vnf + id: simple_secure_ee-ns + name: simple_secure_ee-ns + version: 1.0 + virtual-link-desc: + - id: mgmtnet + mgmt-network: true + vnfd-id: + - simple_secure_ee-vnf diff --git a/simple_secure_ee_vnf/cloud_init/cloud-config.txt b/simple_secure_ee_vnf/cloud_init/cloud-config.txt new file mode 100755 index 0000000000000000000000000000000000000000..a9acf62700fbcaed336d7a5213143e22da63a8c7 --- /dev/null +++ b/simple_secure_ee_vnf/cloud_init/cloud-config.txt @@ -0,0 +1,4 @@ +#cloud-config +password: osm2020 +chpasswd: { expire: False } +ssh_pwauth: True diff --git a/simple_secure_ee_vnf/helm-charts/eechart/.helmignore b/simple_secure_ee_vnf/helm-charts/eechart/.helmignore new file mode 100755 index 0000000000000000000000000000000000000000..50af0317254197a5a019f4ac2f8ecc223f93f5a7 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/simple_secure_ee_vnf/helm-charts/eechart/Chart.yaml b/simple_secure_ee_vnf/helm-charts/eechart/Chart.yaml new file mode 100755 index 0000000000000000000000000000000000000000..414c5f1aa1becbd34d69342874b63db8bb1cb77c --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: OSM EE helm chart +name: eechart +version: 0.1.0 diff --git a/simple_secure_ee_vnf/helm-charts/eechart/source/install.sh b/simple_secure_ee_vnf/helm-charts/eechart/source/install.sh new file mode 100755 index 0000000000000000000000000000000000000000..248ec4819f981c16cf71f1605646eef294a92697 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/source/install.sh @@ -0,0 +1,29 @@ +#!/bin/bash +## +# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U. +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +## + +# This script is intended for launching RO from a docker container. +# It waits for mysql server ready, normally running on a separate container, ... +# then it checks if database is present and creates it if needed. +# Finally it launches RO server. + +echo "Sample install.sh from source dir" + +# Install libraries +#apt-get install -y ... + +# Install library to execute command remotely by ssh +python3 -m pip install asyncssh + diff --git a/simple_secure_ee_vnf/helm-charts/eechart/source/vnf_ee.py b/simple_secure_ee_vnf/helm-charts/eechart/source/vnf_ee.py new file mode 100755 index 0000000000000000000000000000000000000000..3f4a15bb0496871c95576a351019c7bf99f950cc --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/source/vnf_ee.py @@ -0,0 +1,92 @@ +## +# Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. +# This file is part of OSM +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## + +import asyncio +import logging +import asyncssh + + +from osm_ee.exceptions import VnfException + + +class VnfEE: + + def __init__(self, config_params): + self.logger = logging.getLogger('osm_ee.vnf') + self.config_params = config_params + + async def config(self, id, params): + self.logger.debug("Execute action config params: {}".format(params)) + # Config action is special, params are merged with previous config calls + self.config_params.update(params) + required_params = ["ssh-hostname"] + self._check_required_params(self.config_params, required_params) + yield "OK", "Configured" + + async def touch(self, id, params): + self.logger.debug("Execute action touch params: '{}', type: {}".format(params, type(params))) + + try: + self._check_required_params(params, ["file-path"]) + + # Check if filename is a single file or a list + file_list = params["file-path"] if isinstance(params["file-path"], list) else [params["file-path"]] + file_list_length = len(file_list) + + async with asyncssh.connect(self.config_params["ssh-hostname"], + password=self.config_params.get("ssh-password"), + username=self.config_params.get("ssh-username"), + known_hosts=None) as conn: + for index, file_name in enumerate(file_list): + command = "touch {}".format(file_name) + self.logger.debug("Execute remote command: '{}'".format(command)) + result = await conn.run(command) + self.logger.debug("Create command result: {}".format(result)) + + if result.exit_status != 0: + detailed_status = result.stderr + # TODO - ok but with some errors + else: + detailed_status = "Created file {}".format(file_name) + + if index + 1 != file_list_length: + yield "PROCESSING", detailed_status + else: + yield "OK", detailed_status + except Exception as e: + self.logger.error("Error creating remote file: {}".format(repr(e))) + yield "ERROR", str(e) + + async def sleep(self, id, params): + self.logger.debug("Execute action sleep, params: {}".format(params)) + + for i in range(3): + await asyncio.sleep(5) + self.logger.debug("Temporal result return, params: {}".format(params)) + yield "PROCESSING", f"Processing {i} action id {id}" + yield "OK", f"Processed action id {id}" + + @staticmethod + def _check_required_params(params, required_params): + for required_param in required_params: + if required_param not in params: + raise VnfException("Missing required param: {}".format(required_param)) diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/NOTES.txt b/simple_secure_ee_vnf/helm-charts/eechart/templates/NOTES.txt new file mode 100755 index 0000000000000000000000000000000000000000..c52fc2c419ef6f4cccfb63fd93ca7379bfc04cf7 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "eechart.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "eechart.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "eechart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "eechart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/_helpers.tpl b/simple_secure_ee_vnf/helm-charts/eechart/templates/_helpers.tpl new file mode 100755 index 0000000000000000000000000000000000000000..d3e28e0260b8bff2fdef09046df0abaea885739c --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/_helpers.tpl @@ -0,0 +1,56 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "eechart.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "eechart.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "eechart.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "eechart.labels" -}} +app.kubernetes.io/name: {{ include "eechart.name" . }} +helm.sh/chart: {{ include "eechart.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "eechart.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "eechart.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/configmap.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/configmap.yaml new file mode 100755 index 0000000000000000000000000000000000000000..5b9634c7e1abe64c6f720f708dd5c9664e72e8cf --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "eechart.fullname" . }} +data: +{{ (.Files.Glob "source/*").AsConfig | indent 2 }} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/ingress.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/ingress.yaml new file mode 100755 index 0000000000000000000000000000000000000000..264f89091bee2ba8746edc2841c275d28fef1168 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "eechart.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "eechart.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/service.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/service.yaml new file mode 100755 index 0000000000000000000000000000000000000000..88d38d66a3997c6e2a96754582736cfb065da6c2 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "eechart.fullname" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: grpc + protocol: TCP + name: grpc + selector: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml new file mode 100755 index 0000000000000000000000000000000000000000..be615a5f08c7b557446fa74e5e3619e47d2ee804 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "eechart.serviceAccountName" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +{{- end -}} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/statefulset.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/statefulset.yaml new file mode 100755 index 0000000000000000000000000000000000000000..9cc4d96c3d54dd73036107ad9caa06e771a563b4 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/statefulset.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "eechart.fullname" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +spec: + serviceName: {{ include "eechart.fullname" . }} + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + imagePullSecrets: + - name: regcred + serviceAccountName: {{ template "eechart.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: grpc + containerPort: 50051 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: osm-ee + mountPath: /app/storage + - name: osm-ee-source + mountPath: /app/EE/osm_ee/vnf + - name: grpc-tls + mountPath: /etc/ssl/grpc-tls/ + volumes: + - name: osm-ee-source + configMap: + name: {{ include "eechart.fullname" . }} + - name: grpc-tls + secret: + secretName: ee-tls-{{ .Values.global.osm.ns_id }} + volumeClaimTemplates: + - metadata: + name: osm-ee + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 1Gi + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/simple_secure_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml b/simple_secure_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml new file mode 100755 index 0000000000000000000000000000000000000000..e52b7b8b2515729e582b5efbc22dc5a0bdb0f3b2 --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "eechart.fullname" . }}-test-connection" + labels: +{{ include "eechart.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "eechart.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/simple_secure_ee_vnf/helm-charts/eechart/values.yaml b/simple_secure_ee_vnf/helm-charts/eechart/values.yaml new file mode 100755 index 0000000000000000000000000000000000000000..1b3b462cc09273c3d7d8e3dfa41f515d35d0a78a --- /dev/null +++ b/simple_secure_ee_vnf/helm-charts/eechart/values.yaml @@ -0,0 +1,68 @@ +# Default values for eechart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: gcuba/docker-api-fe + tag: grpc-tls + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 50050 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/simple_secure_ee_vnf/icons/osm.png b/simple_secure_ee_vnf/icons/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..62012d2a2b491bdcd536d62c3c3c863c0d8c1b33 Binary files /dev/null and b/simple_secure_ee_vnf/icons/osm.png differ diff --git a/simple_secure_ee_vnf/simple_ee_vnfd.yaml b/simple_secure_ee_vnf/simple_ee_vnfd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f9a3b6d9a6feb160919b79e2ecf0f69cb8a8dc2d --- /dev/null +++ b/simple_secure_ee_vnf/simple_ee_vnfd.yaml @@ -0,0 +1,99 @@ +vnfd: + description: A VNF consisting of 1 VDU with cloud-init, and a monitoring ee + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: mgmtVM + vdu-profile: + - id: mgmtVM + min-number-of-instances: 1 + lcm-operations-configuration: + operate-vnf-op-config: + day1-2: + - config-access: + ssh-access: + default-user: ubuntu + required: true + config-primitive: + - execution-environment-primitive: touch + execution-environment-ref: monitor + name: touch + parameter: + - data-type: STRING + default-value: /home/ubuntu/touched + name: file-path + - execution-environment-primitive: sleep + execution-environment-ref: monitor + name: sleep + execution-environment-list: + - external-connection-point-ref: vnf-mgmt-ext + helm-chart: eechart + id: monitor + id: simple_secure_ee-vnf + initial-config-primitive: + - execution-environment-ref: monitor + name: config + parameter: + - name: ssh-hostname + value: + - name: ssh-username + value: ubuntu + - name: ssh-password + value: osm2020 + seq: 1 + - execution-environment-ref: monitor + name: touch + parameter: + - name: file-path + value: /home/ubuntu/first-touch + seq: 2 + ext-cpd: + - id: vnf-mgmt-ext + int-cpd: + cpd: mgmtVM-eth0-int + vdu-id: mgmtVM + id: simple_secure_ee-vnf + mgmt-cp: vnf-mgmt-ext + product-name: simple_secure_ee-vnf + sw-image-desc: + - id: ubuntu18.04 + image: ubuntu18.04 + name: ubuntu18.04 + vdu: + - cloud-init-file: cloud-config.txt + id: mgmtVM + int-cpd: + - id: mgmtVM-eth0-int + virtual-network-interface-requirement: + - name: mgmtVM-eth0 + position: 1 + virtual-interface: + type: PARAVIRT + name: mgmtVM + sw-image-desc: ubuntu18.04 + virtual-compute-desc: mgmtVM-compute + virtual-storage-desc: + - mgmtVM-storage + version: 1.0 + virtual-compute-desc: + - id: mgmtVM-compute + virtual-cpu: + num-virtual-cpu: 1 + pinning: + policy: static + thread-policy: PREFER + virtual-memory: + mempage-size: LARGE + numa-enabled: true + numa-node-policy: + mem-policy: STRICT + node: + - id: 1 + node-cnt: 1 + size: 1.0 + virtual-storage-desc: + - id: mgmtVM-storage + size-of-storage: 20 diff --git a/updated_simple_ee_vnf/cloud_init/cloud-config.txt b/updated_simple_ee_vnf/cloud_init/cloud-config.txt new file mode 100755 index 0000000000000000000000000000000000000000..a9acf62700fbcaed336d7a5213143e22da63a8c7 --- /dev/null +++ b/updated_simple_ee_vnf/cloud_init/cloud-config.txt @@ -0,0 +1,4 @@ +#cloud-config +password: osm2020 +chpasswd: { expire: False } +ssh_pwauth: True diff --git a/updated_simple_ee_vnf/helm-charts/eechart/.helmignore b/updated_simple_ee_vnf/helm-charts/eechart/.helmignore new file mode 100755 index 0000000000000000000000000000000000000000..50af0317254197a5a019f4ac2f8ecc223f93f5a7 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/updated_simple_ee_vnf/helm-charts/eechart/Chart.yaml b/updated_simple_ee_vnf/helm-charts/eechart/Chart.yaml new file mode 100755 index 0000000000000000000000000000000000000000..414c5f1aa1becbd34d69342874b63db8bb1cb77c --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: OSM EE helm chart +name: eechart +version: 0.1.0 diff --git a/updated_simple_ee_vnf/helm-charts/eechart/source/install.sh b/updated_simple_ee_vnf/helm-charts/eechart/source/install.sh new file mode 100755 index 0000000000000000000000000000000000000000..248ec4819f981c16cf71f1605646eef294a92697 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/source/install.sh @@ -0,0 +1,29 @@ +#!/bin/bash +## +# Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U. +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +## + +# This script is intended for launching RO from a docker container. +# It waits for mysql server ready, normally running on a separate container, ... +# then it checks if database is present and creates it if needed. +# Finally it launches RO server. + +echo "Sample install.sh from source dir" + +# Install libraries +#apt-get install -y ... + +# Install library to execute command remotely by ssh +python3 -m pip install asyncssh + diff --git a/updated_simple_ee_vnf/helm-charts/eechart/source/vnf_ee.py b/updated_simple_ee_vnf/helm-charts/eechart/source/vnf_ee.py new file mode 100755 index 0000000000000000000000000000000000000000..8a99841af76872ac26cbcfd29132cac06b46d367 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/source/vnf_ee.py @@ -0,0 +1,126 @@ +## +# Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. +# This file is part of OSM +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: nfvlabs@tid.es +## + +import asyncio +import logging +import asyncssh + + +from osm_ee.exceptions import VnfException + + +class VnfEE: + + def __init__(self, config_params): + self.logger = logging.getLogger('osm_ee.vnf') + self.config_params = config_params + + async def config(self, id, params): + self.logger.debug("Execute action config params: {}".format(params)) + # Config action is special, params are merged with previous config calls + self.config_params.update(params) + required_params = ["ssh-hostname"] + self._check_required_params(self.config_params, required_params) + yield "OK", "Configured" + + async def touch(self, id, params): + self.logger.debug("Execute action touch params: '{}', type: {}".format(params, type(params))) + + try: + self._check_required_params(params, ["file-path"]) + + # Check if filename is a single file or a list + file_list = params["file-path"] if isinstance(params["file-path"], list) else [params["file-path"]] + file_list_length = len(file_list) + + async with asyncssh.connect(self.config_params["ssh-hostname"], + password=self.config_params.get("ssh-password"), + username=self.config_params.get("ssh-username"), + known_hosts=None) as conn: + for index, file_name in enumerate(file_list): + command = "touch {}".format(file_name) + self.logger.debug("Execute remote command: '{}'".format(command)) + result = await conn.run(command) + self.logger.debug("Create command result: {}".format(result)) + + if result.exit_status != 0: + detailed_status = result.stderr + # TODO - ok but with some errors + else: + detailed_status = "Created file {}".format(file_name) + + if index + 1 != file_list_length: + yield "PROCESSING", detailed_status + else: + yield "OK", detailed_status + except Exception as e: + self.logger.error("Error creating remote file: {}".format(repr(e))) + yield "ERROR", str(e) + + async def mkdir(self, id, params): + self.logger.debug("Execute action mkdir params: '{}', type: {}".format(params, type(params))) + + try: + self._check_required_params(params, ["foldername"]) + + # Check if filename is a single file or a list + folder_list = params["foldername"] if isinstance(params["foldername"], list) else [params["foldername"]] + folder_list_length = len(folder_list) + + async with asyncssh.connect(self.config_params["ssh-hostname"], + password=self.config_params.get("ssh-password"), + username=self.config_params.get("ssh-username"), + known_hosts=None) as conn: + for index, foldername in enumerate(folder_list): + command = "mkdir {}".format(foldername) + self.logger.debug("Execute remote command: '{}'".format(command)) + result = await conn.run(command) + self.logger.debug("Create command result: {}".format(result)) + + if result.exit_status != 0: + detailed_status = result.stderr + # TODO - ok but with some errors + else: + detailed_status = "Created folder {}".format(foldername) + + if index + 1 != folder_list_length: + yield "PROCESSING", detailed_status + else: + yield "OK", detailed_status + except Exception as e: + self.logger.error("Error creating remote folder: {}".format(repr(e))) + yield "ERROR", str(e) + + async def sleep(self, id, params): + self.logger.debug("Execute action sleep, params: {}".format(params)) + + for i in range(3): + await asyncio.sleep(5) + self.logger.debug("Temporal result return, params: {}".format(params)) + yield "PROCESSING", f"Processing {i} action id {id}" + yield "OK", f"Processed action id {id}" + + @staticmethod + def _check_required_params(params, required_params): + for required_param in required_params: + if required_param not in params: + raise VnfException("Missing required param: {}".format(required_param)) diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/NOTES.txt b/updated_simple_ee_vnf/helm-charts/eechart/templates/NOTES.txt new file mode 100755 index 0000000000000000000000000000000000000000..c52fc2c419ef6f4cccfb63fd93ca7379bfc04cf7 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "eechart.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "eechart.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "eechart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "eechart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/_helpers.tpl b/updated_simple_ee_vnf/helm-charts/eechart/templates/_helpers.tpl new file mode 100755 index 0000000000000000000000000000000000000000..d3e28e0260b8bff2fdef09046df0abaea885739c --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/_helpers.tpl @@ -0,0 +1,56 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "eechart.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "eechart.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "eechart.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "eechart.labels" -}} +app.kubernetes.io/name: {{ include "eechart.name" . }} +helm.sh/chart: {{ include "eechart.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "eechart.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "eechart.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/configmap.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/configmap.yaml new file mode 100755 index 0000000000000000000000000000000000000000..5b9634c7e1abe64c6f720f708dd5c9664e72e8cf --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "eechart.fullname" . }} +data: +{{ (.Files.Glob "source/*").AsConfig | indent 2 }} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/ingress.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/ingress.yaml new file mode 100755 index 0000000000000000000000000000000000000000..264f89091bee2ba8746edc2841c275d28fef1168 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "eechart.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "eechart.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/service.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/service.yaml new file mode 100755 index 0000000000000000000000000000000000000000..88d38d66a3997c6e2a96754582736cfb065da6c2 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "eechart.fullname" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: grpc + protocol: TCP + name: grpc + selector: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml new file mode 100755 index 0000000000000000000000000000000000000000..be615a5f08c7b557446fa74e5e3619e47d2ee804 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "eechart.serviceAccountName" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +{{- end -}} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/statefulset.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/statefulset.yaml new file mode 100755 index 0000000000000000000000000000000000000000..65d9bc3b8096ee4d896bf2543ebfb08346e71dcf --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/statefulset.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "eechart.fullname" . }} + labels: +{{ include "eechart.labels" . | indent 4 }} +spec: + serviceName: {{ include "eechart.fullname" . }} + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + imagePullSecrets: + - name: regcred + serviceAccountName: {{ template "eechart.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: grpc + containerPort: 50051 + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: osm-ee + mountPath: /app/storage + - name: osm-ee-source + mountPath: /app/EE/osm_ee/vnf + volumes: + - name: osm-ee-source + configMap: + name: {{ include "eechart.fullname" . }} + volumeClaimTemplates: + - metadata: + name: osm-ee + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 1Gi + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/updated_simple_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml b/updated_simple_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml new file mode 100755 index 0000000000000000000000000000000000000000..e52b7b8b2515729e582b5efbc22dc5a0bdb0f3b2 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "eechart.fullname" . }}-test-connection" + labels: +{{ include "eechart.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "eechart.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/updated_simple_ee_vnf/helm-charts/eechart/values.yaml b/updated_simple_ee_vnf/helm-charts/eechart/values.yaml new file mode 100755 index 0000000000000000000000000000000000000000..84cb21b701265e7f293d7b771d389907dba8c988 --- /dev/null +++ b/updated_simple_ee_vnf/helm-charts/eechart/values.yaml @@ -0,0 +1,68 @@ +# Default values for eechart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: illoret/grpcee + tag: latest + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 50050 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/updated_simple_ee_vnf/icons/osm.png b/updated_simple_ee_vnf/icons/osm.png new file mode 100644 index 0000000000000000000000000000000000000000..62012d2a2b491bdcd536d62c3c3c863c0d8c1b33 Binary files /dev/null and b/updated_simple_ee_vnf/icons/osm.png differ diff --git a/updated_simple_ee_vnf/simple_ee_vnfd.yaml b/updated_simple_ee_vnf/simple_ee_vnfd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c95d16baaaa8021eddc3429eb187d71b81a68cfb --- /dev/null +++ b/updated_simple_ee_vnf/simple_ee_vnfd.yaml @@ -0,0 +1,106 @@ +vnfd: + description: A VNF consisting of 1 VDU with cloud-init, and a monitoring ee + df: + - id: default-df + instantiation-level: + - id: default-instantiation-level + vdu-level: + - number-of-instances: 1 + vdu-id: mgmtVM + vdu-profile: + - id: mgmtVM + min-number-of-instances: 1 + lcm-operations-configuration: + operate-vnf-op-config: + day1-2: + - config-access: + ssh-access: + default-user: ubuntu + required: true + config-primitive: + - execution-environment-primitive: touch + execution-environment-ref: monitor + name: touch + parameter: + - data-type: STRING + default-value: /home/ubuntu/touched + name: file-path + - execution-environment-primitive: mkdir + execution-environment-ref: monitor + name: mkdir + parameter: + - data-type: STRING + default-value: /home/ubuntu/newfolder + name: foldername + - execution-environment-primitive: sleep + execution-environment-ref: monitor + name: sleep + execution-environment-list: + - external-connection-point-ref: vnf-mgmt-ext + helm-chart: eechart + id: monitor + id: simple_ee-vnf + initial-config-primitive: + - execution-environment-ref: monitor + name: config + parameter: + - name: ssh-hostname + value: + - name: ssh-username + value: ubuntu + - name: ssh-password + value: osm2020 + seq: 1 + - execution-environment-ref: monitor + name: touch + parameter: + - name: file-path + value: /home/ubuntu/first-touch + seq: 2 + ext-cpd: + - id: vnf-mgmt-ext + int-cpd: + cpd: mgmtVM-eth0-int + vdu-id: mgmtVM + id: simple_ee-vnf + mgmt-cp: vnf-mgmt-ext + product-name: simple_ee-vnf + sw-image-desc: + - id: ubuntu18.04 + image: ubuntu18.04 + name: ubuntu18.04 + vdu: + - cloud-init-file: cloud-config.txt + id: mgmtVM + int-cpd: + - id: mgmtVM-eth0-int + virtual-network-interface-requirement: + - name: mgmtVM-eth0 + position: 1 + virtual-interface: + type: PARAVIRT + name: mgmtVM + sw-image-desc: ubuntu18.04 + virtual-compute-desc: mgmtVM-compute + virtual-storage-desc: + - mgmtVM-storage + version: 1.0 + virtual-compute-desc: + - id: mgmtVM-compute + virtual-cpu: + num-virtual-cpu: 1 + pinning: + policy: static + thread-policy: PREFER + virtual-memory: + mempage-size: LARGE + numa-enabled: true + numa-node-policy: + mem-policy: STRICT + node: + - id: 1 + node-cnt: 1 + size: 1.0 + virtual-storage-desc: + - id: mgmtVM-storage + size-of-storage: 20