[
https://issues.apache.org/jira/browse/DTACLOUD-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13584632#comment-13584632
]
Ronelle Landy commented on DTACLOUD-477:
----------------------------------------
So this looks better from a functionality point of view ....
Create a new image (realm reported as default)
curl -X POST -F "image_id=67663" --user "un:pw"
"http://localhost:3001/api/instances?format=xml"
<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/1153181' id='1153181'>
<name>serverFri Feb 22 15:17:28 -0500 2013</name>
<owner_id>[email protected]</owner_id>
<image href='http://localhost:3001/api/images/67663' id='67663'></image>
<realm href='http://localhost:3001/api/realms/default' id='default'></realm>
<state>PENDING</state>
<hardware_profile href='http://localhost:3001/api/hardware_profiles/100'
id='100'>
</hardware_profile>
<actions>
</actions>
<launch_time>2013-02-22T20:17:31Z</launch_time>
<public_addresses></public_addresses>
<private_addresses></private_addresses>
<storage_volumes></storage_volumes>
<authentication type='key'>
<login>
<username>root</username>
<password><![.....]></password>
</login>
</authentication>
</instance>
Query the instance (realm reported as default here as well) ...
curl -X GET --user "un:pw"
"http://localhost:3001/api/instances?format=xml"<?xml version='1.0'
encoding='utf-8' ?>
<instances>
<instance href='http://localhost:3001/api/instances/1153181' id='1153181'>
<name>serverFri Feb 22 15:17:28 -0500 2013</name>
<owner_id>....</owner_id>
<image href='http://localhost:3001/api/images/67663' id='67663'></image>
<realm href='http://localhost:3001/api/realms/default' id='default'></realm>
<state>RUNNING</state>
<hardware_profile href='http://localhost:3001/api/hardware_profiles/100'
id='100'>
</hardware_profile>
<actions>
<link href='http://localhost:3001/api/instances/1153181/reboot'
method='post' rel='reboot' />
<link href='http://localhost:3001/api/instances/1153181/stop'
method='post' rel='stop' />
<link href='http://localhost:3001/api/images;instance_id=1153181'
method='post' rel='create_image' />
</actions>
<launch_time>2013-02-22T20:17:31Z</launch_time>
<public_addresses><address
type='ipv4'>15.185.169.84</address></public_addresses>
<private_addresses><address
type='ipv4'>10.6.117.96</address></private_addresses>
<storage_volumes></storage_volumes>
<authentication type='key'>
<login>
<username>root</username>
<password><![CDATA[]]></password>
</login>
</authentication>
</instance>
</instances>
> Openstack provider: Realms id not correctly reported from GET
> /api/instance/Instance_id
> ---------------------------------------------------------------------------------------
>
> Key: DTACLOUD-477
> URL: https://issues.apache.org/jira/browse/DTACLOUD-477
> Project: DeltaCloud
> Issue Type: Bug
> Components: Native/Frontend
> Environment: Deltacloud 1.1.1 - gem under test
> Openstack provider
> Reporter: Ronelle Landy
> Assignee: Marios Andreou
>
> Create an instance passing a realm_id - note that this realm is the same as
> the one where the image resides:
> >> curl -X POST -F "image_id=67663" -F "realm_id=az-2.region-a.geo-1" --user
> >> "un:pw"
> >> "http://amd-pike-06.lab.bos.redhat.com:3001/api/instances?format=json"
> {"instance":{"id":"1099283","href":"http://amd-pike-06.lab.bos.redhat.com:3001/api/instances/1099283","name":"server2013-02-14
> 12:17:20
> -0500","state":"PENDING","owner":"....","image":{"href":"http://amd-pike-06.lab.bos.redhat.com:3001/api/images/67663","id":"67663","rel":"image"},
> "realm":{"href":"http://amd-pike-06.lab.bos.redhat.com:3001/api/realms/az-2.region-a.geo-1","id":"az-2.region-a.geo-1","rel":"realm"},"
> actions":[],"hardware_profile":{"id":"100","href":"http://amd-pike-06.lab.bos.redhat.com:3001/api/hardware_profiles/100","rel":"hardware_profile","properties":{}},"public_addresses":[],"private_addresses":[],"create_time":"2013-02-14T17:17:28Z","storage_volumes":[],"authentication_type":"key","authentication":{"user":"root","password":"uQiHTRW5ircK5Mzz"}}}
> All good above.
> Now GET the instance ... not that the realm is reported as:
> <realm href='http://amd-pike-06.lab.bos.redhat.com:3001/api/realms/n/a'
> id='n/a'></realm>
> >> curl -X GET --user "un:pw"
> >> "http://amd-pike-06.lab.bos.redhat.com:3001/api/instances/1099283?format=xml"<?xml
> >> version='1.0' encoding='utf-8' ?>
> <instance
> href='http://amd-pike-06.lab.bos.redhat.com:3001/api/instances/1099283'
> id='1099283'>
> <name>server2013-02-14 12:17:20 -0500</name>
> <owner_id>...</owner_id>
> <image href='http://amd-pike-06.lab.bos.redhat.com:3001/api/images/67663'
> id='67663'></image>
> <realm href='http://amd-pike-06.lab.bos.redhat.com:3001/api/realms/n/a'
> id='n/a'></realm>
> <state>RUNNING</state>
> <hardware_profile
> href='http://amd-pike-06.lab.bos.redhat.com:3001/api/hardware_profiles/100'
> id='100'>
> </hardware_profile>
> <actions>
> <link
> href='http://amd-pike-06.lab.bos.redhat.com:3001/api/instances/1099283/reboot'
> method='post' rel='reboot' />
> <link
> href='http://amd-pike-06.lab.bos.redhat.com:3001/api/instances/1099283/stop'
> method='post' rel='stop' />
> <link
> href='http://amd-pike-06.lab.bos.redhat.com:3001/api/images;instance_id=1099283'
> method='post' rel='create_image' />
> </actions>
> <launch_time>2013-02-14T17:17:28Z</launch_time>
> <public_addresses><address
> type='ipv4'>15.185.178.1</address></public_addresses>
> <private_addresses><address
> type='ipv4'>10.7.103.19</address></private_addresses>
> <storage_volumes></storage_volumes>
> <authentication type='key'>
> <login>
> <username>root</username>
> <password><![CDATA[]]></password>
> </login>
> </authentication>
> </instance>
> [root@cloud-qe-3 tests]#
> This fails deltacloud/test/instances_test.rb.
> test_0011_should allow to create new instance using image, realm and
> hardware_profile(Deltacloud API instances collection) [instances_test.rb:282]:
> Expected: "az-2.region-a.geo-1"
> Actual: "n/a"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira