Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: DevTest Lab Schedules support for ComputeVmShutdownTask task type #4135

Closed
mikebranstein opened this issue Aug 22, 2019 · 4 comments

Comments

@mikebranstein
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

As of the 1.33.0 release of DevTest Labs Schedules, a schedule can only be applied to a DevTest Lab via the lab_name property. Azure also uses these schedules to perform automated VM shutdowns for VMs outside of DevTest Labs.

For example, the ARM JSON for such a shutdown schedule is:

{
  "type": "microsoft.devtestlab/schedules",
  "apiVersion": "2016-05-15",
  "name": "<dev-test-lab-schedule-name>",
  "location": "<location>",
  "properties": {
    "status": "Enabled",
    "taskType": "ComputeVmShutdownTask",
    "dailyRecurrence": {
      "time": "1900"
    },
    "timeZoneId": "Eastern Standard Time",
    "notificationSettings": {
      "status": "Disabled",
      "timeInMinutes": 30
    },
    "targetResourceId": "<vm-external-id>",
    "provisioningState": "Succeeded",
    "uniqueIdentifier": "<resource-uuid>"
  }
}

As you can see, the targetResourceId points to a VM's external id instead of a DevTest Lab. The task type is also different from what is supported by the v1.33.0 resource currently.

The external id is formatted as: /subscriptions/<subscription_id>/resourceGroups/<resource-group-name>/providers/Microsoft.Compute/virtualMachines/<virtual-machine-name>

New or Affected Resource(s)

  • azurerm_dev_test_schedule

Potential Terraform Configuration

This could mean lab_name becomes an optional parameter, and require the name or id of the virtual machine to be optional. The ComputeVmShutdownTask would need added as a valid task type.

References

@katbyte
Copy link
Collaborator

katbyte commented Jan 21, 2020

This seems like a duplicate of #2334, which was closed by #3554

@katbyte katbyte closed this as completed Jan 21, 2020
@katbyte katbyte added this to the v1.33.0 milestone Jan 21, 2020
@mikebranstein
Copy link
Author

This should not be closed. v1.33.0 did not address the issue. See the above description for the details on why 1.33.0 does not provide a complete solution.

@mikebranstein
Copy link
Author

@katbyte Please reconsider opening this, as v1.33.0 did not address the issue.

As of the 1.33.0 release of DevTest Labs Schedules, a schedule can only be applied to a DevTest Lab via the lab_name property. Azure also uses these schedules to perform automated VM shutdowns for VMs outside of DevTest Labs.

For example, the ARM JSON for such a shutdown schedule is:

{
  "type": "microsoft.devtestlab/schedules",
  "apiVersion": "2016-05-15",
  "name": "<dev-test-lab-schedule-name>",
  "location": "<location>",
  "properties": {
    "status": "Enabled",
    "taskType": "ComputeVmShutdownTask",
    "dailyRecurrence": {
      "time": "1900"
    },
    "timeZoneId": "Eastern Standard Time",
    "notificationSettings": {
      "status": "Disabled",
      "timeInMinutes": 30
    },
    "targetResourceId": "<vm-external-id>",
    "provisioningState": "Succeeded",
    "uniqueIdentifier": "<resource-uuid>"
  }
}

As you can see, the targetResourceId points to a VM's external id instead of a DevTest Lab. The task type is also different from what is supported by the v1.33.0 resource currently.

The external id is formatted as: /subscriptions/<subscription_id>/resourceGroups/<resource-group-name>/providers/Microsoft.Compute/virtualMachines/<virtual-machine-name>

@ghost
Copy link

ghost commented Feb 21, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants