1 ================================
2 MultiCloud Fake_Cloud User Case
3 ================================
7 multilcoud-vmware server not only provide vio plugin to access real openstack platform,but
8 also provide fake_cloud plugin which simulate thereal VIO function.The fake
9 cloud is suitable for testing openstack function if there is not real VIO platform.
12 Make sure you environment have msb,aai service and multicloud-vmware config file has the right msb_ip and
13 msb_port value,The config file path is vio/vio/pub/config/congfig.py
17 Register Fake Cloud to AAI
18 ~~~~~~~~~~~~~~~~~~~~~~~~~~
20 Register vio information into AAI service with region name "vmware" and region id "fake"
22 .. code-block:: console
24 $ curl -X PUT -H "X-TransactionId":"get_aai_subr" -H "X-FromAppId":"AAI" -H "Accept":"application/json" \
25 -H "Content-Type:"application/json" -H "Authorization:Basic QUFJOkFBSQ==" \
26 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
28 "cloud-owner": "vmware",
29 "cloud-region-id": "fake",
30 "cloud-type": "vmware",
31 "cloud-region-version": "4.0",
32 "identity-url": "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3",
33 "cloud-zone": "cloud zone",
34 "complex-name": "complex name",
35 "esr-system-info-list": {
38 "system-name": "vmware-fake-cloud",
40 "service-url": "http://127.0.0.1:5000/v3",
45 "cloud-domain": "default",
46 "default-tenant": "admin",
52 the identity url reprent the fake cloud identity url.
59 the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3"
60 the ${msb_address} = "MSB_IP:MSB_PORT"
65 # send request to multicloud-framework(broker) service to get token of keystone V3
67 .. code-block:: console
69 $ 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
71 test.json content example:
77 "scope": {"project": {"id": “<project-id>”}},
80 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
87 There are a large amounts of data including service endpoint, user information, etc.
88 For our testing We take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”.
90 # you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
91 requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
95 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
98 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
104 Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
106 .. code-block:: console
108 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
114 Use nova’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
117 .. code-block:: console
119 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
122 List instance of user’s project
123 --------------------------------
125 .. code-block:: console
127 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
133 you need to input <server-id> in url path.
135 .. code-block:: console
137 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
143 you need to input <server-id> in url path
145 .. code-block:: console
147 $ 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
153 you need to input <server-id> in url path
155 .. code-block:: console
157 $ 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
163 you need to input <server-id> in url path
165 .. code-block:: console
167 $ 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
173 you need to input <server-id> in url path
175 .. code-block:: console
177 $ 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
183 you need to input <server-id> in url path
185 .. code-block:: console
187 $ 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
193 you need to input <server-id> in url path
195 .. code-block:: console
197 $ 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
203 you need to input <server-id> in url path
205 .. code-block:: console
207 $ 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
213 .. code-block:: console
215 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks
221 .. code-block:: console
223 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/preview \
226 "disable_rollback": true,
230 "stack_name": "teststack",
232 "heat_template_version": "2013-05-23",
233 "description": "Simple template to test heat commands",
236 "default": "m1.tiny",
242 "type": "OS::Nova::Server",
244 "key_name": "heat_key",
246 "get_param": "flavor"
248 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
249 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
261 .. code-block:: console
263 $ curl -X POST -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks \
266 "disable_rollback": true,
270 "stack_name": "teststack",
272 "heat_template_version": "2013-05-23",
273 "description": "Simple template to test heat commands",
276 "default": "m1.tiny",
282 "type": "OS::Nova::Server",
284 "key_name": "heat_key",
286 "get_param": "flavor"
288 "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
289 "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
301 .. code-block:: console
303 $ curl -X DELETE -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/heat/<tenantid>/stacks/<stack_name>/<stack_id>