This post describe when user (or administrator) push TOSCA file to XOS, things will happen in XOS and how XOS create Network, Port, Instance on OpenStack.
First, I will introduce XOS’s components, XOS composed by many containers, but only
xos-db will involve in provision VM procedure:
- XOS Core (xos-core): contain all model definations
- XOS TOSCA API interface (xos-tosca): TOSCA northbound interface
- XOS GUI (xos-gui)
- XOS Web Socket (xos-ws)
- XOS chameleon (chameleon)
- XOS Database (xos-db): Save models information
- XOS Redis (xos-redis)
For more information about XOS’s component, click here.
Every VMs, Networks created by XOS need to be defined in TOSCA, following comes an example about create service and service’s network.
# vMME Service
Meanwhile, we still don’t create service instance (or called Tenant) yet, In M-CORD 5.0, VM will be created by
vepc-service automatically, we will not explain vepc-service here, if you’re interested, you can find source code in GitHub - epc-service.
Here is a TOSCA snippet code continued previous code, it created a VM (Service Instance) named
vmme1, this code will be extracted by
XOS TOSCA Container, and
xos-tosca send model information to
# OAI Service instances
Let us start with this illustration, it tells the workflow from TOSCA YAML file to actually create VM instance. I will explain each steps later.
- administrator/user POST YAML file to
xos-toscaby simple HTTP request.
xos-toscapass information to
xos-corestore data in
xos-db, we have several models about OpenStack VM, services will share these models.
Imagemodels, and when these models have new data come in,
openstack-synchronizerwill get notified.
VMby calling Ansible script.
In synchronizer, we have 2 types code:
We can say
SyncStep will going to do something about service, e.g. Provisioning new VM on OpenStack, Install apache on target machine, create user, … etc.
ModelPolicy is much different from
SyncStep, it is responsible for maintaining models, for example, create a new VM in Instance model, modify Instance model information, delete VM from model … etc, will be done by
you can find another file named
sync_instances.yaml in same folder as
sync_instances.py, this file defined VM create script in Ansible YAML format.
ModelPolicy have some default action.
As a result,
ModelPolicy will create model’s content in
SyncStep have no default action, it’s all defined in service by developer.