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" \
26 https://aai_ip:aai_port/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/vmware/fake \
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": {
38 "esr-system-info-id": "62e17285-c207-42b0-9d55-b472b274c254",
39 "system-name": "vim-fake-cloud",
41 "service-url": "http://127.0.0.1:5000/v3",
45 "ssl-insecure": false,
46 "cloud-domain": "default",
47 "default-tenant": "admin",
48 "resource-version": "1505892661819"
55 the identity url reprent the fake cloud identity url.
62 the ${fake_identiy_url}= "http://MSB_IP:MSB_PORT/api/multicloud-vio/v0/vmware_fake/identity/v3"
63 the ${msb_address} = "MSB_IP:MSB_PORT"
68 # send request to multicloud-framework(broker) service to get token
70 .. code-block:: console
72 $ curl -X POST -d @test.json -H 'Content-Type:application/json' ${fake_identiy_url}
74 test.json content example:
79 "auth": sudo pip install virtualenv{
80 "scope": {"project": {"id": “<project-id>”}},
83 "password": {"user": {"domain": {"name": “<doman-name>”}, "password": “<user-password>”, "name": “<user-name>”}}, "methods": ["password"]
90 There are a large amounts of data including service endpoint, user information, etc.
91 For our testing We take nova and identity service endpoint address and auth token which is in response header named “X-Subject-Token”.
93 # you can find the endpoint url namespace is "api/multicloiud-vio/v0/vmware_fake", it represent the multicloud-vio service, So
94 requests sending to mulitcloud-vio will be forwarded to fake cloud.the ip and port reprenst ${msb_address}
98 http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity
101 http://$msb_address/api/multicloud-vio/v0/vmware_fake/compute/<user-tenantid>
107 Use identity’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/
109 .. code-block:: console
111 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/identity/projects
117 Use nova’s endpoint: http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<user-tenantid>
120 .. code-block:: console
122 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/os-hypervisors/detail
125 List instance of user’s project
126 --------------------------------
128 .. code-block:: console
130 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vmware_fake/nova/<tenantid>/servers
136 you need to input <server-id> in url path.
138 .. code-block:: console
140 $ curl -X GET -H 'X-Auth-Token:<token>' http://$msb_address/api/multicloud-vio/v0/vimid/nova/tenantid/servers/<server-id>
146 you need to input <server-id> in url path
148 .. code-block:: console
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
156 you need to input <server-id> in url path
158 .. code-block:: console
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
166 you need to input <server-id> in url path
168 .. code-block:: console
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
176 you need to input <server-id> in url path
178 .. code-block:: console
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
186 you need to input <server-id> in url path
188 .. code-block:: console
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
196 you need to input <server-id> in url path
198 .. code-block:: console
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
206 you need to input <server-id> in url path
208 .. code-block:: console
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