[
https://issues.apache.org/jira/browse/DTACLOUD-126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187764#comment-13187764
]
Ronelle Landy commented on DTACLOUD-126:
----------------------------------------
Patch was tested using rhevm with multiple datacenters and two realms
(clusters) in the datacenter under test. The API commands and output are copied
below:
>> Find images in datacenter
curl -X GET --user 'username:password "server:3001/api/images?format=xml"
<?xml version='1.0' encoding='utf-8' ?>
<images>
<image href='server:3001/api/images/ccf52584-4ec8-49cb-9f1b-9d214abfff5f'
id='ccf52584-4ec8-49cb-9f1b-9d214abfff5f'>
<name>63fa88a6-b9f2-452d-a2be-fdf3b0a72c2e</name>
<owner_id>xxxl</owner_id>
<description>Template by iwhd</description>
<architecture>x86_64</architecture>
<state>ok</state>
<actions>
<link
href='server:3001/api/instances;image_id=ccf52584-4ec8-49cb-9f1b-9d214abfff5f'
method='post' rel='create_instance' />
</actions>
</image>
</images>
>> Create instance - no realm specified
curl -X POST -F "image_id=ccf52584-4ec8-49cb-9f1b-9d214abfff5f" -F
"name=noRealmSpecified" --user 'username:password'
"server:3001/api/instances?format=xml"<?xml version='1.0' encoding='utf-8' ?>
<instance
href='server:3001/api/instances/07d8538f-e459-4138-aa9f-318bb547a99f'
id='07d8538f-e459-4138-aa9f-318bb547a99f'>
<name>noRealmSpecified</name>
<owner_id>xxx</owner_id>
<image href='server:3001/api/images/ccf52584-4ec8-49cb-9f1b-9d214abfff5f'
id='ccf52584-4ec8-49cb-9f1b-9d214abfff5f'></image>
<realm href='server:3001/api/realms/d21bab08-4086-11e1-922a-5cf3fc1c861c'
id='d21bab08-4086-11e1-922a-5cf3fc1c861c'></realm>
<state>PENDING</state>
<hardware_profile
href='http://bigisis.rhts.eng.bos.redhat.com:3001/api/hardware_profiles/DESKTOP'
id='DESKTOP'>
<property kind='fixed' name='memory' unit='MB' value='512'></property>
<property kind='fixed' name='storage' unit='GB' value='1'></property>
<property kind='fixed' name='cpu' unit='count' value='1'></property>
</hardware_profile>
<actions>
<link
href='server:3001/api/images;instance_id=07d8538f-e459-4138-aa9f-318bb547a99f'
method='post' rel='create_image' />
</actions>
<launch_time>2012-01-17T09:54:11.017-05:00</launch_time>
<public_addresses><address port='5890'
type='vnc'>xxx</address></public_addresses>
<private_addresses></private_addresses>
</instance>
>> Create Instance - specify different realm - same datacenter
curl -X POST -F "image_id=ccf52584-4ec8-49cb-9f1b-9d214abfff5f" -F
"name=differentRealmSpecified" -F
"realm_id=bdce3f96-4070-11e1-9f90-5cf3fc1c861c" --user 'username:password'
"server:3001/api/instances?format=xml"
<?xml version='1.0' encoding='utf-8' ?>
<instance
href='serverm:3001/api/instances/0c71d995-954e-4292-ace5-ed0890e5bb61'
id='0c71d995-954e-4292-ace5-ed0890e5bb61'>
<name>differentRealmSpecified</name>
<owner_id>xxx</owner_id>
<image href='server:3001/api/images/ccf52584-4ec8-49cb-9f1b-9d214abfff5f'
id='ccf52584-4ec8-49cb-9f1b-9d214abfff5f'></image>
<realm href='server:3001/api/realms/bdce3f96-4070-11e1-9f90-5cf3fc1c861c'
id='bdce3f96-4070-11e1-9f90-5cf3fc1c861c'></realm>
<state>PENDING</state>
<hardware_profile href='server:3001/api/hardware_profiles/DESKTOP'
id='DESKTOP'>
<property kind='fixed' name='memory' unit='MB' value='512'></property>
<property kind='fixed' name='storage' unit='GB' value='1'></property>
<property kind='fixed' name='cpu' unit='count' value='1'></property>
</hardware_profile>
<actions>
<link
href='server:3001/api/images;instance_id=0c71d995-954e-4292-ace5-ed0890e5bb61'
method='post' rel='create_image' />
</actions>
<launch_time>2012-01-17T09:57:41.841-05:00</launch_time>
<public_addresses><address port='5890'
type='vnc'>xxx</address></public_addresses>
<private_addresses></private_addresses>
</instance>
>> same cluster/realm specified
curl -X POST -F "image_id=ccf52584-4ec8-49cb-9f1b-9d214abfff5f" -F
"name=sameRealmSpecified" -F "realm_id=d21bab08-4086-11e1-922a-5cf3fc1c861c"
--user username:password'
"http://bigisis.rhts.eng.bos.redhat.com:3001/api/instances?format=xml"
<?xml version='1.0' encoding='utf-8' ?>
<instance
href='http://bigisis.rhts.eng.bos.redhat.com:3001/api/instances/4cbeda67-cd5f-4614-a40e-39a661f5fd0b'
id='4cbeda67-cd5f-4614-a40e-39a661f5fd0b'>
<name>sameRealmSpecified</name>
<owner_id>xxx</owner_id>
<image href='server:3001/api/images/ccf52584-4ec8-49cb-9f1b-9d214abfff5f'
id='ccf52584-4ec8-49cb-9f1b-9d214abfff5f'></image>
<realm href='server:3001/api/realms/d21bab08-4086-11e1-922a-5cf3fc1c861c'
id='d21bab08-4086-11e1-922a-5cf3fc1c861c'></realm>
<state>PENDING</state>
<hardware_profile
href='http://bigisis.rhts.eng.bos.redhat.com:3001/api/hardware_profiles/DESKTOP'
id='DESKTOP'>
<property kind='fixed' name='memory' unit='MB' value='512'></property>
<property kind='fixed' name='storage' unit='GB' value='1'></property>
<property kind='fixed' name='cpu' unit='count' value='1'></property>
</hardware_profile>
<actions>
<link
href='server:3001/api/images;instance_id=4cbeda67-cd5f-4614-a40e-39a661f5fd0b'
method='post' rel='create_image' />
</actions>
<launch_time>2012-01-17T10:15:58.704-05:00</launch_time>
<public_addresses><address port='5890'
type='vnc'>xxx</address></public_addresses>
<private_addresses></private_addresses>
</instance>
> RHEV-M: We need to skip 'default' cluster when no 'realm_id' is specified in
> create_instance
> --------------------------------------------------------------------------------------------
>
> Key: DTACLOUD-126
> URL: https://issues.apache.org/jira/browse/DTACLOUD-126
> Project: DeltaCloud
> Issue Type: Bug
> Components: Server
> Reporter: Michal Fojtik
> Assignee: Michal Fojtik
> Priority: Blocker
> Attachments:
> 0001-RHEV-M-Choose-the-image-realm-when-no-realm-is-being.patch
>
>
> When there is no realm_id provided upon creating a new instance, by default
> Deltacloud will choose the first 'realm' returned by 'realms' call.
> In RHEV-M it usually means that the 'default' cluster is being returned,
> which is wrong in most cases, since this cluster is being used for
> holding the 'Blank' template, thus cannot be removed. This cluster usually
> don't have 'storage domain' assigned and deploying an instance
> there lead to error.
> The solution could to to 'skip' default realm and try to use next realm in
> row (if there is next realm). If there is just 'default' realm, we should
> choose this realm and additionally give client decent error :-)
--
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