danielestevez commented on this pull request.


>           } catch (Exception ex) {
             logger.warn(ex, "Error cleaning up resources for node %s", 
deadNode);
          }
+
+         List<SecurityGroup> securityGroups = 
cleanupResources.findOrphanedSecurityGroups(regionAndId.regionId(), 
deadNode.getGroup());
+         for (SecurityGroup securityGroup : securityGroups) {
+            logger.debug(">> destroying security group %s ...", 
securityGroup.id());
+            if 
(cleanupResources.cleanupSecurityGroupIfOrphaned(regionAndId.regionId(), 
securityGroup.id())) {
+               logger.debug(">> security group: (%s) has been deleted.", 
securityGroup.id());
+            } else {
+               logger.warn(">> security group: (%s) has not been deleted.", 
securityGroup.id());
+            }
+         }
+
+         // FIXME not sure it is correct to always delete vSwitch and VPC

This is a similar case as this https://github.com/jclouds/jclouds/pull/1202 
(still unfinished) PR in ARM provider. 

Basically we should be able to identify if those VPC/vSwitch were created by 
the jclouds providers and delete them only if empty AND created by us. We use 
tags in the ARM to check this, is there anything similar in Aliyun API?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/443#discussion_r208698367

Reply via email to