I was taking a look at it. The order is correct – first the compute is handled and then the storage.
It might seem confusing because I first retrieve the "zombie" volume details from the space to populate the context with it, before handing it to the cloud drivers (first the compute gets it, then the storage driver)

From: Eli Polonsky [mailto:notifications@github.com]
Sent: Thursday, April 03, 2014 6:04 PM
To: CloudifySource/cloudify
Cc: Noa Kuperberg
Subject: Re: [cloudify] CLOUDIFY-2671 - Volumes and floating IPs not cleaned after VM failure (#101)


In esc/src/main/java/org/cloudifysource/esc/driver/provisioning/ElasticMachineProvisioningCloudifyAdapter.java:

> @@ -1312,6 +1301,34 @@ public void cleanupMachineResources(final long duration, final TimeUnit timeUnit

>                      throw new ElasticMachineProvisioningException("Failed to cleanup cloud", e);

>              }

>       }

> +

> +

> +     @Override

> +     public void onMachineFailure(final FailedGridServiceAgent failedAgent, final long duration, final TimeUnit

> +                    timeUnit) throws ElasticMachineProvisioningException, InterruptedException, TimeoutException {

> +            try {

> +

> +                    final MachineDetails previousMachineDetails = getPreviousMachineDetailsFromFailedGSA(failedAgent);

> +                    ServiceVolume volume = getAttachedVolumeFromSpace(serviceName, previousMachineDetails);

> +                    previousMachineDetails.setAttachedVolumeId(volume.getId());

> +                    final ProvisioningContextImpl ctx = setUpProvisioningContext(null /*locationId*/, null/*reservationId*/,

> +                                   previousMachineDetails);

> +

> +                    // handling compute resources

Are you sure this is the correct order of things?

i think its better to first handle storage resources, since they usually depend on compute resources, and not the other way around.

—
Reply to this email directly or view it on GitHub<https://github.com/CloudifySource/cloudify/pull/101/files#r11255506>.