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

Stuart Hendren commented on JCLOUDS-207:
----------------------------------------

On version 1.9.0 (may have happened earlier) there is a change in the notation 
used for key-pair, but this is not changed in the delete phase leading to more 
key pairs not being deleted.

When the key is formed it uses the following code (in my use case) which leads 
to something like  jclouds#I-0#e96

{code:title=FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat.java|borderStyle=solid}
   public String uniqueNameForGroup(String group) {
      return String.format(uniqueFormat, checkGroup(group), 
suffixSupplier.get());
   }
{code}

However, when deleting the search still uses the region,  
jclouds#I-0#us-east-1#*.

{code:title=EC2ComputeServicer.java|borderStyle=solid}
for (KeyPair keyPair : 
client.getKeyPairApi().get().describeKeyPairsInRegionWithFilter(region,
              ImmutableMultimap.<String, String>builder()
                      .put("key-name", Strings2.urlEncode(
                              String.format("jclouds#%s#%s*", group, 
region).replace('#', delimiter)))
                      .build())) {
         String keyName = keyPair.getKeyName();
         Predicate<String> keyNameMatcher = 
namingConvention.create().containsGroup(group);
         String oldKeyNameRegex = String.format("jclouds#%s#%s#%s", group, 
region, "[0-9a-f]+").replace('#', delimiter);
         // old keypair pattern too verbose as it has an unnecessary region 
qualifier

{code}




> Key Pair and Security Groups created by jclouds are not removed when the node 
> is destroyed (via Jclouds)
> --------------------------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-207
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-207
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.6.0
>            Reporter: Eugen Paraschiv
>              Labels: ec2
>
> Simply stated, the problem is that the nodes that are created in EC2 via 
> jclouds leave a key-pair and a security group each, after they're deleted 
> (also via jclouds). 
> This issue is described in much more detail here: 
> http://www.cloudsoftcorp.com/blog/tidying-up-after-jclouds/
> Hopefully it's an easy fix and the operation of first creating and then 
> destroying the node will leave no unnecessary artifacts on the EC2 account. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to