You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Marios Andreou (Commented) (JIRA)" <ji...@apache.org> on 2012/03/28 11:27:39 UTC

[jira] [Commented] (DTACLOUD-181) json output from creating an image (from a stopped instance) in RHEV-M does not return readable hardware profiles

    [ https://issues.apache.org/jira/browse/DTACLOUD-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240316#comment-13240316 ] 

Marios Andreou commented on DTACLOUD-181:
-----------------------------------------

Issue is verified and reproducible. The issue is specific to the listing of hardware_profiles within an Image, but is not confined to the rhevm driver (I could also reproduce with ec2 driver for example). An easier reproducer is to simply GET a specific Image with json format:

curl --user "user:pass" http://localhost:3001/api/images/88ead4c9-3488-4f2b-87fb-1cc1d70b65ca?format=json

With the attached patch applied output looks like:

{"image":{"actions":[{"create_instance":{"href":"/api/instances;image_id=88ead4c9-3488-4f2b-87fb-1cc1d70b65ca","method":"post"}}],"href":"http://localhost:3001/api/images/88ead4c9-3488-4f2b-87fb-1cc1d70b65ca","architecture":"x86_64","state":"\n        ok\n    ","description":"","hardware_profiles":[{"SERVER":{"href":"http://localhost:3001/api/hardware_profiles/SERVER"}},{"DESKTOP":{"href":"http://localhost:3001/api/hardware_profiles/DESKTOP"}}],"name":"test1","id":"88ead4c9-3488-4f2b-87fb-1cc1d70b65ca","owner_id":"admin@internal"}}

i.e. "hardware_profiles": [  {"hwp1_name": {"href":"uri_for_hwp1"}}, {"hwp2_name": {"href":"uri_for_hwp2"}}  ]
consistent with the xml output, we provide name and ref to each hwp compatible with the given image.

Waiting for review before pushing patch to master.
                
> json output from creating an image (from a stopped instance) in RHEV-M does not return readable hardware profiles
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: DTACLOUD-181
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-181
>             Project: DeltaCloud
>          Issue Type: Bug
>          Components: Server
>         Environment: deltacloud commit version: 59659586a6783bd4c851056813ed8369d08d4589 - clone: from https://git-wip-us.apache.org/repos/asf/deltacloud.git 
> Fedora 16
> rhevm 3.X
>            Reporter: Ronelle Landy
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-Fixes-DTACLOUD_181-json-output-of-HardareProfile-wit.patch
>
>
> Found when verifying DTACLOUD-170:
> The json output from creating an image from a STOPPED instance in rhevm returns the hardware profiles as:
> #<Deltacloud::HardwareProfile:0x7fa438754db8>
> The XML output from the same operation returns the hardware profiles as:
> <hardware_profile href='http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/hardware_profiles/SERVER&#39; id='SERVER' rel='hardware_profile'></hardware_profile>
> The complete output in both json and xml are copied below. Logging this as a sepate issue to DTACLOUD-170 as it is far more minor.
> >> Output in json
>  curl -X POST -F "name=rlandyImage" -F "description=Image description" -F "instance_id=59f35d07-093c-46a5-814b-d0c6084ef8c9" --user "uname:password" "http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/images?format=json"
> {"image":{"owner_id":"xxx","href":"http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/images/c4ddf46e-3abb-4bce-962e-2b55d4a01594","actions":[{"create_instance":{"method":"post","href":"/api/instances;image_id=c4ddf46e-3abb-4bce-962e-2b55d4a01594"}}],"architecture":"x86_64","state":"\n locked\n ","name":"rlandyImage","id":"c4ddf46e-3abb-4bce-962e-2b55d4a01594","description":"Image description","hardware_profiles":["#<Deltacloud::HardwareProfile:0x7fa438758288>","#<Deltacloud::HardwareProfile:0x7fa438754db8>"]}}[rlandy@localhost /]$
> [rlandy@localhost /]$
> >> Output in xml
> [rlandy@localhost /]$ curl -X POST -F "name=rlandyImageXml" -F "description=Image description" -F "instance_id=59f35d07-093c-46a5-814b-d0c6084ef8c9" --user "uname:password" "http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/images?format=xml"
> <?xml version='1.0' encoding='utf-8' ?>
> <image href='http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/images/9c8777bf-8d65-40e8-8bd4-e6ddf42f7b2f&#39; id='9c8777bf-8d65-40e8-8bd4-e6ddf42f7b2f'>
>   <name>rlandyImageXml</name>
>   <owner_id>xxx</owner_id>
>   <description>Image description</description>
>   <architecture>x86_64</architecture>
>   <state>locked</state>
>   <hardware_profiles>
>     <hardware_profile href='http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/hardware_profiles/SERVER&#39; id='SERVER' rel='hardware_profile'></hardware_profile>
>     <hardware_profile href='http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/hardware_profiles/DESKTOP&#39; id='DESKTOP' rel='hardware_profile'></hardware_profile>
>   </hardware_profiles>
>   <actions>
>     <link href='http://qe-blade-02.idm.lab.bos.redhat.com:3006/api/instances;image_id=9c8777bf-8d65-40e8-8bd4-e6ddf42f7b2f&#39; method='post' rel='create_instance' />
>   </actions>
> </image>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira