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",
53 the identity url reprent the fake cloud identity url.
60 the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud/v0/vmware_fake/identity/v3"
61 the ${msb_address} = "MSB_IP:MSB_PORT"
66 # send request to multicloud-framework(broker) service to get token
68 .. code-block:: console
70 $ curl -X POST -d @test.json -H 'Content-Type:application/json' ${fake_identiy_url}
72 test.json content example:
78 "scope": {"project": {"id": “<project-id>”}},
81 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
88 There are a large amounts of data including service endpoint, user information, etc.
89 For our testing We take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”.
91 # you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
92 requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
96 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
99 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
105 Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
107 .. code-block:: console
109 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
115 Use nova’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
118 .. code-block:: console
120 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
123 List instance of user’s project
124 --------------------------------
126 .. code-block:: console
128 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
134 you need to input <server-id> in url path.
136 .. code-block:: console
138 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
144 you need to input <server-id> in url path
146 .. code-block:: console
148 $ 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
154 you need to input <server-id> in url path
156 .. code-block:: console
158 $ 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
164 you need to input <server-id> in url path
166 .. code-block:: console
168 $ 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
174 you need to input <server-id> in url path
176 .. code-block:: console
178 $ 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
184 you need to input <server-id> in url path
186 .. code-block:: console
188 $ 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
194 you need to input <server-id> in url path
196 .. code-block:: console
198 $ 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
204 you need to input <server-id> in url path
206 .. code-block:: console
208 $ 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