2 This work is licensed under a Creative Commons Attribution 4.0
5 ================================
6 MultiCloud Fake_Cloud User Case
7 ================================
11 multilcoud-vmware server not only provide vio plugin to access real openstack platform,but
12 also provide fake_cloud plugin which simulate thereal VIO function.The fake
13 cloud is suitable for testing openstack function if there is not real VIO platform.
16 Make sure you environment have msb,aai service and multicloud-vmware config file has the right msb_ip and
17 msb_port value,The config file path is vio/vio/pub/config/congfig.py
21 Register Fake Cloud to AAI
22 ~~~~~~~~~~~~~~~~~~~~~~~~~~
24 Register vio information into AAI service with region name "vmware" and region id "fake"
26 .. code-block:: console
28 $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \
29 -H "Content-Type:"application/json" -H "Authorization:Basic QUFJOkFBSQ==" \
30 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
32 "cloud-owner": "vmware",
33 "cloud-region-id": "fake",
34 "cloud-type": "vmware",
35 "cloud-region-version": "4.0",
36 "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3",
37 "cloud-zone": "cloud zone",
38 "complex-name": "complex name",
39 "esr-system-info-list": {
42 "system-name": "vmware-fake-cloud",
44 "service-url": "http://127.0.0.1:5000/v3",
49 "cloud-domain": "default",
50 "default-tenant": "admin",
56 the identity url reprent the fake cloud identity url.
63 the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3"
64 the ${msb_address} = "MSB_IP:MSB_PORT"
69 # send request to multicloud-framework(broker) service to get token of keystone V3
71 .. code-block:: console
73 $ curl -X POST -d @test.json -H 'Content-Type:application/json' http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3/auth/tokens
75 test.json content example:
81 "scope": {"project": {"id": “<project-id>”}},
84 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
91 There are a large amounts of data including service endpoint, user information, etc.
92 For our testing We take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”.
94 # you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
95 requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
99 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
102 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
108 Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
110 .. code-block:: console
112 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
118 Use nova’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
121 .. code-block:: console
123 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
126 List instance of user’s project
127 --------------------------------
129 .. code-block:: console
131 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
137 you need to input <server-id> in url path.
139 .. code-block:: console
141 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
147 you need to input <server-id> in url path
149 .. code-block:: console
151 $ 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
157 you need to input <server-id> in url path
159 .. code-block:: console
161 $ 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
167 you need to input <server-id> in url path
169 .. code-block:: console
171 $ 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
177 you need to input <server-id> in url path
179 .. code-block:: console
181 $ 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
187 you need to input <server-id> in url path
189 .. code-block:: console
191 $ 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
197 you need to input <server-id> in url path
199 .. code-block:: console
201 $ 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
207 you need to input <server-id> in url path
209 .. code-block:: console
211 $ 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
217 .. code-block:: console
219 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks
225 .. code-block:: console
227 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/preview \
230 "disable_rollback": true,
234 "stack_name": "teststack",
236 "heat_template_version": "2013-05-23",
237 "description": "Simple template to test heat commands",
240 "default": "m1.tiny",
246 "type": "OS::Nova::Server",
248 "key_name": "heat_key",
250 "get_param": "flavor"
252 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
253 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
265 .. code-block:: console
267 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks \
270 "disable_rollback": true,
274 "stack_name": "teststack",
276 "heat_template_version": "2013-05-23",
277 "description": "Simple template to test heat commands",
280 "default": "m1.tiny",
286 "type": "OS::Nova::Server",
288 "key_name": "heat_key",
290 "get_param": "flavor"
292 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
293 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
305 .. code-block:: console
307 $ curl -X DELETE -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/<stack_name>/<stack_id>