Tune docs of multi vim/cloud
[multicloud/framework.git] / docs / user / multivimproxy.txt
1 1 prepare docker environment
2
3 Please refer to onap deployment in kubernetes website(https://wiki.onap.org/display/DW/ONAP+on+Kubernetes)
4 to setup kubernets cluster.
5
6
7 After installing kubectl and helm, execute "kubectl cluster-info" command to verify your kubernets cluster.
8
9 Clone oom project:  git clone http://gerrit.onap.org/r/oom
10 Source the setenv.bash script in /oom/kubernetes/oneclick/, it will set your helm list of components to start/delete
11 Run the one time config pod - which mounts the volume /dockerdata/ contained in the pod config-init.
12
13 # cd  oom/kubernetes/config
14 # cp onap-parameters-sample.yaml onap-parameters.yaml
15 # ./createConfig.sh -n onap
16
17 wait for "onap" namespace created, pod "config-init" created
18 # kubectl get  namespaces
19 NAME              STATUS    AGE
20 default           Active    10d
21 kube-public       Active    10d
22 kube-system       Active    10d
23 onap              Active    9d
24
25 2 startup containers
26
27 first run kube2msb container.
28
29 # cd oom/kubernetes/oneclick
30 # ./createAll.bash -n onap -a kube2msb
31
32 run msb container
33 # ./createAll.bash -n onap -a msb
34
35 run aai container
36 # ./createAll.bash -n onap -a aai
37
38
39 Finally run multicloud container
40 # ./createAll.bash -n onap -a multicloud
41
42 get all pods
43 # kubectl get pods --all-namespaces
44 NAMESPACE         NAME                                    READY     STATUS    RESTARTS   AGE
45 kube-system       heapster-4285517626-2k4l1               1/1       Running   1          9d
46 kube-system       kube-dns-2514474280-mxh18               3/3       Running   3          9d
47 kube-system       kubernetes-dashboard-716739405-jl6mk    1/1       Running   1          9d
48 kube-system       monitoring-grafana-3552275057-hrpn5     1/1       Running   1          9d
49 kube-system       monitoring-influxdb-4110454889-t8tpv    1/1       Running   1          9d
50 kube-system       tiller-deploy-737598192-8q523           1/1       Running   1          9d
51 onap-aai          aai-resources-837807428-2t158           1/1       Running   0          2d
52 onap-aai          aai-service-3869033750-1nvg5            1/1       Running   0          2d
53 onap-aai          aai-traversal-50329389-gnsnk            1/1       Running   0          2d
54 onap-aai          data-router-2254557428-zwxx1            1/1       Running   0          2d
55 onap-aai          elasticsearch-622738319-sx6q1           1/1       Running   0          2d
56 onap-aai          gremlin-671060974-npsg5                 1/1       Running   0          2d
57 onap-aai          hbase-3690059193-2pjc5                  1/1       Running   0          2d
58 onap-aai          model-loader-service-849987455-w6vwn    1/1       Running   0          2d
59 onap-aai          search-data-service-4105978183-p1nnj    1/1       Running   0          2d
60 onap-aai          sparky-be-2696729089-mcjbw              1/1       Running   0          2d
61 onap-kube2msb     kube2msb-registrator-1600827891-1s3s4   1/1       Running   3          7d
62 onap-msb          msb-consul-3388279333-hbr16             1/1       Running   0          2d
63 onap-msb          msb-discovery-1109629174-t14q8          1/1       Running   0          2d
64 onap-msb          msb-eag-3969419634-2fdnr                1/1       Running   0          2d
65 onap-msb          msb-iag-1114772402-sjlww                1/1       Running   0          2d
66 onap-multicloud   framework-1225620501-9567n              1/1       Running   0          21h
67 onap-multicloud   multicloud-vio-269945856-rl6w6          1/1       Running   0          21h
68
69 get cluster-ip and port
70
71 # kubectl get svc --all-namespaces
72 NAMESPACE         NAME                   CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                             AGE
73 default           kubernetes             10.43.0.1       <none>        443/TCP                                                             10d
74 kube-system       heapster               10.43.96.134    <none>        80/TCP                                                              10d
75 kube-system       kube-dns               10.43.0.10      <none>        53/UDP,53/TCP                                                       10d
76 kube-system       kubernetes-dashboard   10.43.9.43      <none>        9090/TCP                                                            10d
77 kube-system       monitoring-grafana     10.43.210.16    <none>        80/TCP                                                              10d
78 kube-system       monitoring-influxdb    10.43.32.60     <none>        8086/TCP                                                            10d
79 kube-system       tiller-deploy          10.43.84.208    <none>        44134/TCP                                                           10d
80 onap-aai          aai-resources          None            <none>        8447/TCP,5005/TCP                                                   2d
81 onap-aai          aai-service            10.43.88.92     <nodes>       8443:30233/TCP,8080:30232/TCP                                       2d
82 onap-aai          aai-traversal          None            <none>        8446/TCP,5005/TCP                                                   2d
83 onap-aai          elasticsearch          None            <none>        9200/TCP                                                            2d
84 onap-aai          gremlin                None            <none>        8182/TCP                                                            2d
85 onap-aai          hbase                  None            <none>        2181/TCP,8080/TCP,8085/TCP,9090/TCP,16000/TCP,16010/TCP,16201/TCP   2d
86 onap-aai          model-loader-service   10.43.172.213   <nodes>       8443:30229/TCP,8080:30210/TCP                                       2d
87 onap-aai          search-data-service    None            <none>        9509/TCP                                                            2d
88 onap-aai          sparky-be              None            <none>        9517/TCP                                                            2d
89 onap-msb          msb-consul             10.43.41.203    <nodes>       8500:30500/TCP                                                      2d
90 onap-msb          msb-discovery          10.43.6.205     <nodes>       10081:30081/TCP                                                     2d
91 onap-msb          msb-eag                10.43.81.104    <nodes>       80:30082/TCP                                                        2d
92 onap-msb          msb-iag                10.43.188.78    <nodes>       80:30080/TCP                                                        2d
93 onap-multicloud   framework              10.43.97.54     <nodes>       9001:30291/TCP                                                      21h
94 onap-multicloud   multicloud-vio         10.43.230.197   <nodes>       9004:30294/TCP                                                      21h
95
96
97 Now msb,aai and multicloud container are online, navigate to http://msb_docker_host_ip:30081/iui/microservices/index.html,
98 you can see  multicloud endpoint have been registered.
99
100 No      Service Name    Version NameSpace       Url     Protocol        Visualrange     Control
101 1       multicloud      v0              /api/multicloud/v0      REST    InSystem
102 2       multicloud-vio  v0              /api/multicloud-vio/v0  REST    InSystem
103
104
105 Then register vio information into AAI service with region name "vmware" and region id "vio"
106 # cur -X PUT  -H "Authorization: Basic QUFJOkFBSQ=="  - "Content-Type: application/json" -H "X-TransactionId:get_aai_subcr"
107 https://aai_resource_docker_host_ip:30233/aai/v01/cloud-infrastructure/cloud-regions/cloud-region/vmware/vio
108 -d "{
109         "cloud-type": "vmware",
110         "cloud-region-version": "4.0",
111         "esr-system-info-list": {
112                 "esr-system-info": [
113                         {
114                                 "esr-system-info-id": "123-456",
115                                 "system-name": "vim-vio",
116                                 "system-type": "vim",
117                                 "type": "vim",
118                                 "user-name": "admin",
119                                 "password": "vmware",
120                                 "service-url": "<keystone auth url>",
121                                 "cloud-domain": "default",
122                                 "default-tenant": "admin",
123                                 "ssl-insecure": false
124                         }
125                         ]
126         }
127 }"
128
129
130
131
132 3 Test Examples
133
134 The env HOST_IP is msb-iag service cluster-ip value is "10.43.188.78"(see it above).
135 The vimid is "vmware_vio"  the registered name in aai.
136
137
138 2.1  Get auth token
139
140 # send request to multicloud-framework(broker) service to get token
141
142 curl -X  POST   -d @test.json  -H 'Content-Type:application/json'   http://$HOST_IP/api/multicloud/v0/<vimid>/identity/auth/tokens
143
144 test.json content example:
145
146 {
147         "auth":
148         {
149                 "scope": {"project": {"id": “<project-id>”}},
150                 "identity":
151                 {
152                         "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
153                 }
154         }
155 }
156
157
158 Response:
159 There are a large amounts of data including service endpoint, user information, etc.
160 For our testing  We  take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”.
161
162 # you can find the endpoint url namespace is "api/multicloiud-vio/v0", it represent the multicloud-vio service, So
163 requests sending to mulitcloud-vio will be forwarded to backend  VIO openstack.
164
165
166 Identity endpoint:
167         http://$HOST_IP/api/multicloud-vio/v0/<vimid>/identity
168
169 Nova endpoint:
170         http://$HOST_IP/api/multicloud-vio/v0/<vimid>/compute/<user-tenantid>
171
172
173 2.2 List projects
174
175 Use identity’s endpoint:  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/identity/
176
177 curl -X GET   -H 'X-Auth-Token:<token>'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/identity/projects
178
179
180 2.3 Get os Hypervisor
181
182 Use nova’s endpoint:  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<user-tenantid>
183
184
185 curl -X GET   -H 'X-Auth-Token:<token>'   http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/os-hypervisors/detail
186
187
188 2.4  List instance of  user’s project
189
190 curl -X GET   -H 'X-Auth-Token:<token>'    http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers
191
192
193 2.5  Show instance detail
194
195 you need to input <server-id> in url path.
196
197 curl -X GET   -H 'X-Auth-Token:<token>'    http://$HOST_IP/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
198
199
200 2.6 Shutdown instance
201
202 you need to input <server-id> in url path
203
204 curl -X POST -d '{"os-stop":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
205
206
207 2.7  Start instance
208
209 you need to input <server-id> in url path
210
211 curl -X POST -d '{"os-start":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
212
213
214 2.8  Suspend instance
215
216 you need to input <server-id> in url path
217
218 curl -X POST -d '{"suspend":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
219
220
221 2.9 Resume  instance
222
223 you need to input <server-id> in url path
224
225 curl -X POST -d '{"resume":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
226
227
228 2.10  Pause instance
229
230 you need to input <server-id> in url path
231
232 curl -X POST -d '{"pause":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
233
234
235
236 2.11 Unpasue instance
237
238 you need to input <server-id> in url path
239
240 curl -X POST -d '{"unpause":null}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action
241
242
243 2.12 Reboot instance
244
245 you need to input <server-id> in url path
246
247 curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json'  http://$HOST_IP/api/multicloud-vio/v0/<vimid>/nova/<tenantid>/servers/<server-id>/action