summaryrefslogtreecommitdiffstats
path: root/docs/development/requirements/annex1.rst
blob: 65a5f22addeaf9f7dc9ae317dedd5eaa00de0ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

.. _uc-brahmaputra:

ANNEX A: Use case for OPNFV Brahmaputra
=======================================

A basic resource reservation use case to be realized for OPNFV B-release may
look as follows:

* Step 0: Shim-layer is monitoring/querying available capacity at NFVI

  * Step 0a: Cloud operator creates a new OpenStack tenant user and updates
    quota values for this user

  * Step 0b: The tenant user is creating and instantiating a simple VNF
    (e.g. 1 network, 2 VMs)

  * Step 0c: OpenStack is notifying shim-layer about capacity change for
    this new tenant user

  * Step 0d: Cloud operator can visualize the changes using the GUI

* Step 1: Consumer(NFVO) is sending a reservation request for future use to
  shim-layer

* Step 2: Shim-layer is checking for available capacity at the given time
  window

* Step 3: Shim-layer is responding with reservation identifier

* Step 4 (optional): Consumer(NFVO) is sending an update reservation request
  to shim-layer (startTime set to now) -> continue with Steps 2 and 3.

* Step 5: Consumer(VNFM) is requesting the allocation of virtualised resources
  using the reservation identifier in Step 3
seq, host) if not s: continue result.append(s) if len(result) == 0: return "" else: return "\"" + seq.join(result) + "\"" return wrapter @decorator def hostnames(s, seq, host=None): return host.get('name', '') @decorator def hostroles(s, seq, host=None): return "%s=%s" % (host.get('name', ''), ','.join(host.get('roles', []))) @decorator def hostmacs(s, seq, host=None): return host.get('mac', '') def export_dha_file(s, dha_file, conf_dir, ofile): env = {} env.update(s) if env.get('hosts', []): env.pop('hosts') env.update({'TYPE': s.get('TYPE', "virtual")}) env.update({'FLAVOR': s.get('FLAVOR', "cluster")}) env.update({'HOSTNAMES': hostnames(s, ',')}) env.update({'HOST_ROLES': hostroles(s, ';')}) env.update({'DHA': dha_file}) value = hostmacs(s, ',') if len(value) > 0: env.update({'HOST_MACS': value}) os.system("echo \#config file deployment parameter > %s" % ofile) for k, v in env.items(): os.system("echo 'export %s=${%s:-%s}' >> %s" % (k, k, v, ofile)) def export_reset_file(s, tmpl_dir, output_dir, output_file): tmpl_file_name = s.get('POWER_TOOL', '') if not tmpl_file_name: return tmpl = Template(file=os.path.join(tmpl_dir,'power', tmpl_file_name + '.tmpl'), searchList=s) reset_file_name = os.path.join(output_dir, tmpl_file_name + '.sh') with open(reset_file_name, 'w') as f: f.write(tmpl.respond()) os.system("echo 'export POWER_MANAGE=%s' >> %s" % (reset_file_name, output_file)) if __name__ == "__main__": if len(sys.argv) != 6: print("parameter wrong%d %s" % (len(sys.argv), sys.argv)) sys.exit(1) _, dha_file, conf_dir, tmpl_dir, output_dir, output_file = sys.argv if not os.path.exists(dha_file): print("%s is not exist" % dha_file) sys.exit(1) data = init(dha_file) export_dha_file(data, dha_file, conf_dir, os.path.join(output_dir, output_file)) export_reset_file(data, tmpl_dir, output_dir, os.path.join(output_dir, output_file)) sys.exit(0)