You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whirr.apache.org by "Andrei Savu (JIRA)" <ji...@apache.org> on 2011/05/27 12:14:47 UTC

[jira] [Created] (WHIRR-315) Use AWSUtils to handle instance IDs

Use AWSUtils to handle instance IDs 
------------------------------------

                 Key: WHIRR-315
                 URL: https://issues.apache.org/jira/browse/WHIRR-315
             Project: Whirr
          Issue Type: Bug
            Reporter: Andrei Savu
            Assignee: Andrei Savu
             Fix For: 0.6.0


I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 

>From the documentation I would expect to be able to call:
{code}
computeService.destroyNode(metadata.getId())
{code}
but I have to do the following call in order to get the expected behavior:
{code}
computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
{code}

Adrian, am I missing something about how jclouds handles instance IDs?


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Attachment: WHIRR-315.patch

I've updated the patch. I was wrong, {{computeService.destroyNode}} works as expected. 

I'm still having one issue with {{NodePredicates.withIds}}. I took a look at the implementation and it uses {{nodeMetadata.getProviderId()}} which is not equal to {{nodeMetadata.getId()}}. 

Is this the expected behavior? What's the rational? 



> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Temporary override Providers#withIds until jclouds beta-10 is out

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Description: Provider#withIds is expecting a provider specific ID. This problem is fixed in jclouds-beta-10. This issue adds a temporary override. computerService.destroyNode works as expected.   (was: I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 

>From the documentation I would expect to be able to call:
{code}
computeService.destroyNode(metadata.getId())
{code}
but I have to do the following call in order to get the expected behavior:
{code}
computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
{code}

Adrian, am I missing something about how jclouds handles instance IDs?
)
        Summary: Temporary override Providers#withIds until jclouds beta-10 is out  (was: Use AWSUtils to handle instance IDs )

Updated issue title and description to match the patch. 

> Temporary override Providers#withIds until jclouds beta-10 is out
> -----------------------------------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch, WHIRR-315.patch
>
>
> Provider#withIds is expecting a provider specific ID. This problem is fixed in jclouds-beta-10. This issue adds a temporary override. computerService.destroyNode works as expected. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Attachment: WHIRR-315.patch

Updated the patch as Adrian suggested. I'm going to commit this now. 

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Temporary override Providers#withIds until jclouds beta-10 is out

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I've just committed this. 

> Temporary override Providers#withIds until jclouds beta-10 is out
> -----------------------------------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch, WHIRR-315.patch
>
>
> Provider#withIds is expecting a provider specific ID. This problem is fixed in jclouds-beta-10. This issue adds a temporary override. computerService.destroyNode works as expected. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040190#comment-13040190 ] 

Andrei Savu commented on WHIRR-315:
-----------------------------------

I will check again. Maybe I'm doing something wrong. 

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042416#comment-13042416 ] 

Andrei Savu commented on WHIRR-315:
-----------------------------------

Ok. I will do that. Adrian, thanks for taking a look at this. :) 

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040168#comment-13040168 ] 

Adrian Cole commented on WHIRR-315:
-----------------------------------

This sounds very surprising. I'll have a look.

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040181#comment-13040181 ] 

Adrian Cole commented on WHIRR-315:
-----------------------------------

Have you debugged to see the value being passed to compute.destroyNode(id) ?

The code for the jclouds ec2 impl (EC2DestroyNodeStrategy) is the following, so you can imagine why this patch makes me scratch my head:

   public NodeMetadata destroyNode(String id) {
      String[] parts = AWSUtils.parseHandle(id);
      String region = parts[0];
      String instanceId = parts[1];
--snip--

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042436#comment-13042436 ] 

Adrian Cole commented on WHIRR-315:
-----------------------------------

not a problem

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Adrian Cole (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042294#comment-13042294 ] 

Adrian Cole commented on WHIRR-315:
-----------------------------------

I think changing the public cli interface to workaround a trivial bug is a bad idea.  Why don't we just paste in a correct predicate instead of changing the public interfaces to whirr?  If we change the public interface to whirr, it will establish incorrect behaviour which is hard to have users change back/forth from.

The predicate that was failing can be pasted into whirr somewhere and deprecate saying that this is fixed in beta-10.

Here's an example, which is already in beta-10:

   /**
    *  temporary override Providers#withIds until jclouds beta-10 is out
    */
   @Deprecated
   public static <T extends ComputeMetadata> Predicate<T> withIds(String... ids) {
      final Set<String> search = ImmutableSet.copyOf(checkNotNull(ids, "ids must be defined"));
      return new Predicate<T>() {
         @Override
         public boolean apply(T nodeMetadata) {
            return search.contains(nodeMetadata.getId());
         }

         @Override
         public String toString() {
            return "withIds(" + search + ")";
         }
      };
   }

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042182#comment-13042182 ] 

Andrei Savu commented on WHIRR-315:
-----------------------------------

Should we open an issue to jclouds to discuss NodePredicates.withIds or this is the expected behavior and we can move forward with this patch? 

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch, WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Status: Patch Available  (was: Open)

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WHIRR-315) Use AWSUtils to handle instance IDs

Posted by "Andrei Savu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WHIRR-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Savu updated WHIRR-315:
------------------------------

    Attachment: WHIRR-315.patch

Attached a patch that replaces string.split with AWSUtils.parseHandle. 

> Use AWSUtils to handle instance IDs 
> ------------------------------------
>
>                 Key: WHIRR-315
>                 URL: https://issues.apache.org/jira/browse/WHIRR-315
>             Project: Whirr
>          Issue Type: Bug
>            Reporter: Andrei Savu
>            Assignee: Andrei Savu
>             Fix For: 0.6.0
>
>         Attachments: WHIRR-315.patch
>
>
> I realized that I have to use AWSUtills in order to handle instances IDs correctly. It looks like inconsistent behavior in jclouds. 
> From the documentation I would expect to be able to call:
> {code}
> computeService.destroyNode(metadata.getId())
> {code}
> but I have to do the following call in order to get the expected behavior:
> {code}
> computeService.destroyNode(AWSUtils.parseHandle(metadata.getId())[1]);
> {code}
> Adrian, am I missing something about how jclouds handles instance IDs?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira