Start/Stop VMs during off-hours - specific VMs only? RRS feed

  • Question

  • I'm using the  Start/Stop VMs during off-hours feature Azure Automation solution.

    I'm trying to use it to start/stop a small number of specified VMs only (3 VMs).
    followed the instructions, running the ScheduledStartStop_Parent runbook and specifying the desired VMs in the VMList parameter, but at present it's starting and stopping all VMs in all resource groups.  It's literally processing all VMs in the subscription!

    I've tried listing every single one of the other VMs into the "External_ExcludeVMNames" variable, but this is not a workable solution, since if one of the excluded VMs is later deleted (this is a lab environment after all), the entire solution fails to function at all.

    Here are the key variables mentioned in the documentation.  I've tried asterisk "*" in both the ResourceGroupNames variables as suggested by the solution, but this appears to function as a wildcard and processes all resource groups, as does assigning a null string, which also causes the solution to process all resource groups.

    External_ExcludeVMNames                   none
    External_Start_ResourceGroupNames         ""
    External_Stop_ResourceGroupNames          ""

    I'm tempted to try the idea of creating an empty resource group specificlly so it can be named in these variables, but I feel this is violating the KISS principle.  All throughout the code and the documentation it advises that these variables are ignored if the VMList variable is defined, which it is.

    Can anyone provide any suggestions as to what might have gone wrong, and how to fix this? 

    Sunday, May 31, 2020 11:39 AM