blob: dc8af4c0d2049ab3e0969841551420d16e8cf794 [file] [log] [blame]
liangke01ef9142017-10-12 18:09:15 +08001================================
2MultiCloud Fake_Cloud User Case
3================================
4
5
6
7multilcoud-vmware server not only provide vio plugin to access real openstack platform,but
8also provide fake_cloud plugin which simulate thereal VIO function.The fake
9cloud is suitable for testing openstack function if there is not real VIO platform.
10
11
12Make sure you environment have msb,aai service and multicloud-vmware config file has the right msb_ip and
13msb_port value,The config file path is vio/vio/pub/config/congfig.py
14
15
16
17Register Fake Cloud to AAI
18~~~~~~~~~~~~~~~~~~~~~~~~~~
19
20Register vio information into AAI service with region name "vmware" and region id "fake"
21
22.. code-block:: console
23
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080024 $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \
25 -H "Content-Type:"application/json" \
26 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
27 -d "{
28 "cloud-owner": "vmware",
29 "cloud-region-id": "vio",
30 "cloud-type": "vmware",
31 "cloud-region-version": "4.0",
32 "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud-vio/v0/vmware_fake/identity/v3",
33 "sriov-automation": false,
34 "resource-version": "1505892661724",
35 "esr-system-info-list": {
36 "esr-system-info": [
37 {
38 "esr-system-info-id": "62e17285-c207-42b0-9d55-b472b274c254",
39 "system-name": "vim-fake-cloud",
40 "type": "vim",
41 "service-url": "http://127.0.0.1:5000/v3",
42 "user-name": "admin",
43 "password": "vmware",
44 "system-type": "vim",
45 "ssl-insecure": false,
46 "cloud-domain": "default",
47 "default-tenant": "admin",
48 "resource-version": "1505892661819"
49 }
50 ]
51 }
52 }"
liangke01ef9142017-10-12 18:09:15 +080053
54
55the identity url reprent the fake cloud identity url.
56
57
58
59Test Examples
Ethan Lynn42fbfdc2017-10-20 13:52:45 +080060~~~~~~~~~~~~~
liangke01ef9142017-10-12 18:09:15 +080061
62the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud-vio/v0/vmware_fake/identity/v3"
63the ${msb_address} = "MSB_IP:MSB_PORT"
64
65Get auth token
66--------------
67
68# send request to multicloud-framework(broker) service to get token
69
70.. code-block:: console
71
72 $ curl -X POST -d @test.json -H 'Content-Type:application/json' ${fake_identiy_url}
73
74test.json content example:
75
76::
77
78 {
79 "auth": sudo pip install virtualenv{
80 "scope": {"project": {"id": “<project-id>”}},
81 "identity":
82 {
83 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
84 }
85 }
86 }
87
88
89Response:
90There are a large amounts of data including service endpoint, user information, etc.
91For our testing We take nova and identity service endpoint address and auth token which is in response header named X-Subject-Token”.
92
93# you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
94requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
95
96
97Identity endpoint:
98 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
99
100Nova endpoint:
101 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
102
103
104List projects
105-------------
106
107Use identitys endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
108
109.. code-block:: console
110
111 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
112
113
114Get os Hypervisor
115-----------------
116
117Use novas endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
118
119
120.. code-block:: console
121
122 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
123
124
125List instance of users project
126--------------------------------
127
128.. code-block:: console
129
130 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
131
132
133Show instance detail
134--------------------
135
136you need to input <server-id> in url path.
137
138.. code-block:: console
139
140 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
141
142
143Shutdown instance
144-----------------
145
146you need to input <server-id> in url path
147
148.. code-block:: console
149
150 $ curl -X POST -d '{"os-stop":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
151
152
153Start instance
154--------------
155
156you need to input <server-id> in url path
157
158.. code-block:: console
159
160 $ curl -X POST -d '{"os-start":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
161
162
163Suspend instance
164----------------
165
166you need to input <server-id> in url path
167
168.. code-block:: console
169
170 $ curl -X POST -d '{"suspend":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
171
172
173Resume instance
174----------------
175
176you need to input <server-id> in url path
177
178.. code-block:: console
179
180 $ curl -X POST -d '{"resume":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
181
182
183Pause instance
184--------------
185
186you need to input <server-id> in url path
187
188.. code-block:: console
189
190 $ curl -X POST -d '{"pause":null}' -H 'X-Auth-Token:<token>' -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
191
192
193Unpasue instance
194----------------
195
196you need to input <server-id> in url path
197
198.. code-block:: console
199
200 $ curl -X POST -d '{"unpause":null}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
201
202
203Reboot instance
204---------------
205
206you need to input <server-id> in url path
207
208.. code-block:: console
209
210 $ curl -X POST -d '{"reboot":{"type":"HARD"}}' -H 'X-Auth-Token:<token> -H 'Content-Type:application/json' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers/<server-id>/action
211