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

Ignasi Barrera commented on JCLOUDS-1330:
-----------------------------------------

I'd say, when deleting a node, we should delete the networks it was attached to 
if:

* The network was automatically created by jclouds (it has a marker tag that 
allows us to identify them).
* There are no other nodes attached to it.

This way we prevent deleting networking infrastructure that could be 
pre-created by users, and we allow reusing them as needed.

Regarding the resource-group deletion, we are already deleting it if empty, 
after having cleaned up all resources associated to the deleted nodes . See 
[here|https://github.com/jclouds/jclouds-labs/blob/master/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java#L123-L125],
 so I think that logic is already OK. We should assume that users may create 
stuff in the resource group, and we don't want to automatically delete 
everything we are not directly in control of.

So, I'd say we just need to add the logic to delete "our" orphaned networks. 
The rest should be ok as-is. Does this make sense?

> Azure ARM orphaned networks not cleaned up when node deleted
> ------------------------------------------------------------
>
>                 Key: JCLOUDS-1330
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1330
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 2.0.2
>            Reporter: Duncan Grant
>            Priority: Minor
>              Labels: azurecompute-arm
>
> Azure ARM orphaned networks not cleaned up when node deleted which also 
> prevents the resource group from being removed.
> Not sure this is actually a bug.
> According to 
> https://github.com/duncangrant/jclouds-labs/blob/dbadb279f14848f21879f7eb6c7136e1a5f11192/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CleanupResources.java#L94-L95
>  the network should be cleaned up when the resource group is deleted.
> However this is not the case.  As can be seen here: 
> https://github.com/duncangrant/jclouds-labs/blob/dbadb279f14848f21879f7eb6c7136e1a5f11192/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CleanupResources.java#L207
> As the resource group contains the network this will prevent the resource 
> group from being deleted leaving both the network and the resource group.
> I think that, assuming the network was created by jclouds at the same time as 
> the resource group, it is reasonable to delete both here.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to