jenkinsci / azure-slave-plugin

18 stars 41 forks source link

VM created through Jenkins is not shutting down after Retention time #34

Open v-tugude opened 8 years ago

v-tugude commented 8 years ago

Steps:

  1. Manage Jenkins ->Configure system -> Add new cloud
  2. Enter valid subscription details and Verify subscription
  3. Enter Name,label, Image reference values, Launch method,username and password
  4. Set Retention time to 10 mins and check the checkbox " Shutdown only(do not delete) after retention time"
  5. Create a freestyle project with the above label expression as reference
  6. Build the project

Result: The VM is in running status even after retention time

ssk2 commented 8 years ago

I see this issue too.

pesetskyps commented 8 years ago

have the same issue. Is it related to only latest version? Cause I tested previously it was fine.

pesetskyps commented 8 years ago

After quick investigation it can happen if this code block returns false for one of the conditions: if (idleTerminationMillis > 0 && slaveNode.isIdle() && slaveNode.isProvisioned() && idleTerminationMillis < (System.currentTimeMillis() - slaveNode.getIdleStartMilliseconds())) So e.g. in my case if node is stuck in provisioning state slaveNode.isProvisioned() will returm false and no retention will happen. So IMHO code is fine

anshuljain633 commented 5 years ago

@pesetskyps so what is the solution for this.