Updates docs for SR1 with final revision
[genesis.git] / fuel / prototypes / auto-deploy / documentation / 4-dha-adapter-api.txt
1 The structure is being reworked. This page describes the DHA adapter interface.
2
3
4 This is a the beginning of a documentation of the DHA adapter
5 interface, which is auto generated from the bash implementation of the
6 libvirt DHA adapter. So, to some extent work in progress.
7
8 An example run from the ./verify_adapter tool:
9
10 sfb@blackbox:~/git/toolbox/opnfv/production/deploy$ ./verify_adapter.sh libvirt.sh dha.yaml
11 Adapter init
12 dha.yaml
13 DHAPARSE: /home/sfb/git/toolbox/opnfv/production/deploy/dha-adapters/dhaParse.py
14 DHAFILE: dha.yaml
15 Adapter API version: 1.0
16 Adapter name: libvirt
17 All PXE MAC addresses:
18 1: 52:54:00:38:c7:8e
19 2: 52:54:00:9c:c2:c9
20 Using Fuel custom install: no
21 Can set boot order live: no
22 Can operate on ISO media: yes
23 Can insert/eject ISO without power toggle: yes
24 Can erase the boot disk MBR: yes
25 Done
26
27
28 *** DHA API definition version 1.1 ***
29
30 # Get the DHA API version supported by this adapter
31 dha_getApiVersion ()
32
33 # Get the name of this adapter
34 dha_getAdapterName ()
35
36 # ### Node identity functions ###
37 # Node numbering is sequential.
38 # Get a list of all defined node ids, sorted in ascending order
39 dha_getAllNodeIds()
40
41 # Get ID for Fuel node ID
42 dha_getFuelNodeId()
43
44 # Get node property
45 # Argument 1: node id
46 # Argument 2: Property
47 dha_getNodeProperty()
48
49 # Get MAC address for the PXE interface of this node. If not
50 # defined, an empty string will be returned.
51 # Argument 1: Node id
52 dha_getNodePxeMac()
53
54 # Use custom installation method for Fuel master?
55 # Returns 0 if true, 1 if false
56 dha_useFuelCustomInstall()
57
58 # Fuel custom installation method
59 # Leaving the Fuel master powered on and booting from ISO at exit
60 # Argument 1: Full path to ISO file to install
61 dha_fuelCustomInstall()
62
63 # Get power on strategy from DHA
64 # Returns one of two values:
65 #   all:        Power on all nodes simultaneously
66 #   sequence:   Power on node by node, wait for Fuel detection
67 dha_getPowerOnStrategy()
68
69 # Power on node
70 # Argument 1: node id
71 dha_nodePowerOn()
72
73 # Power off node
74 # Argument 1: node id
75 dha_nodePowerOff()
76
77 # Reset node
78 # Argument 1: node id
79 dha_nodeReset()
80
81 # Is the node able to commit boot order without power toggle?
82 # Argument 1: node id
83 # Returns 0 if true, 1 if false
84 dha_nodeCanSetBootOrderLive()
85
86 # Set node boot order
87 # Argument 1: node id
88 # Argument 2: Space separated line of boot order - boot ids are "pxe", "disk" and "iso"
89 dha_nodeSetBootOrder()
90
91 # Is the node able to operate on ISO media?
92 # Argument 1: node id
93 # Returns 0 if true, 1 if false
94 dha_nodeCanSetIso()
95
96 # Is the node able to insert add eject ISO files without power toggle?
97 # Argument 1: node id
98 # Returns 0 if true, 1 if false
99 dha_nodeCanHandeIsoLive()
100
101 # Insert ISO into virtualDVD
102 # Argument 1: node id
103 # Argument 2: iso file
104 dha_nodeInsertIso()
105
106 # Eject ISO from virtual DVD
107 # Argument 1: node id
108 dha_nodeEjectIso()
109
110 # Wait until a suitable time to change the boot order to 
111 # "disk iso" when ISO has been booted. Can't be too long, nor
112 # too short...
113 # We should make a smart trigger for this somehow...
114 dha_waitForIsoBoot()
115
116 # Is the node able to reset its MBR?
117 # Returns 0 if true, 1 if false
118 dha_nodeCanZeroMBR()
119
120 # Reset the node's MBR
121 dha_nodeZeroMBR()
122
123 # Entry point for dha functions
124 # Typically do not call "dha_node_zeroMBR" but "dha node_ZeroMBR"
125 # Before calling dha, the adapter file must gave been sourced with
126 # the DHA file name as argument
127 dha()
128