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
13 also provide fake_cloud plugin which simulate thereal VIO function.The fake
14 cloud is suitable for testing openstack function if there is not real VIO
18 Make sure you environment have msb,aai service and multicloud-vmware config
19 file has the right msb_ip and
20 msb_port value,The config file path is vio/vio/pub/config/congfig.py
24 Register Fake Cloud to AAI
25 ~~~~~~~~~~~~~~~~~~~~~~~~~~
27 Register vio information into AAI service with region name "vmware" and region
30 .. code-block:: console
32 $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \
33 -H "Content-Type:"application/json" -H "Authorization:Basic QUFJOkFBSQ==" \
34 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
36 "cloud-owner": "vmware",
37 "cloud-region-id": "fake",
38 "cloud-type": "vmware",
39 "cloud-region-version": "4.0",
40 "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3",
41 "cloud-zone": "cloud zone",
42 "complex-name": "complex name",
43 "esr-system-info-list": {
46 "system-name": "vmware-fake-cloud",
48 "service-url": "http://127.0.0.1:5000/v3",
53 "cloud-domain": "default",
54 "default-tenant": "admin",
60 the identity url reprent the fake cloud identity url.
67 the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3"
68 the ${msb_address} = "MSB_IP:MSB_PORT"
73 # send request to multicloud-framework(broker) service to get token of keystone
76 .. code-block:: console
78 $ 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
80 test.json content example:
86 "scope": {"project": {"id": “<project-id>”}},
89 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
96 There are a large amounts of data including service endpoint, user information,
98 For our testing We take nova and identity service endpoint address and auth
99 token which is in response header named “X-Subject-Token”.
101 # you can find the endpoint url namespace is
102 "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service,
103 So requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip
104 and port reprenst ${msb_address}
109 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
113 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
119 Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
121 .. code-block:: console
123 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
129 Use nova’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
132 .. code-block:: console
134 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
137 List instance of user’s project
138 --------------------------------
140 .. code-block:: console
142 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
148 you need to input <server-id> in url path.
150 .. code-block:: console
152 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
158 you need to input <server-id> in url path
160 .. code-block:: console
162 $ 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
168 you need to input <server-id> in url path
170 .. code-block:: console
172 $ 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
178 you need to input <server-id> in url path
180 .. code-block:: console
182 $ 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
188 you need to input <server-id> in url path
190 .. code-block:: console
192 $ 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
198 you need to input <server-id> in url path
200 .. code-block:: console
202 $ 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
208 you need to input <server-id> in url path
210 .. code-block:: console
212 $ 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
218 you need to input <server-id> in url path
220 .. code-block:: console
222 $ 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
228 .. code-block:: console
230 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks
236 .. code-block:: console
238 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/preview \
241 "disable_rollback": true,
245 "stack_name": "teststack",
247 "heat_template_version": "2013-05-23",
248 "description": "Simple template to test heat commands",
251 "default": "m1.tiny",
257 "type": "OS::Nova::Server",
259 "key_name": "heat_key",
261 "get_param": "flavor"
263 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
264 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
276 .. code-block:: console
278 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks \
281 "disable_rollback": true,
285 "stack_name": "teststack",
287 "heat_template_version": "2013-05-23",
288 "description": "Simple template to test heat commands",
291 "default": "m1.tiny",
297 "type": "OS::Nova::Server",
299 "key_name": "heat_key",
301 "get_param": "flavor"
303 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
304 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
316 .. code-block:: console
318 $ curl -X DELETE -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/<stack_name>/<stack_id>