question

VenuSunkara-4258 avatar image
VenuSunkara-4258 asked ·

Assign a policy to enforce a condition for existing/new VMs that should shut-down by 7 PM and on by 10 AM

Hi Team,

I would like to add a policy which is related to Virtual Machines that should shut down the all VMs at 7 PM and on by 10 AM Daily on Weekdays.

Thanks in advance.

Regards,
Venu Sunkara

azure-policy
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

karishmatiwari-msft avatar image
karishmatiwari-msft answered ·

You can use Azure automation to start/stop VM during off hours.
Please refer to this document and let me know if you have any questions.


1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi karishmatiwari-msft,

Thanks for giving reply, but im looking for azure policies.

Regards,
Venu Sunkara

0 Votes 0 · ·
Sirlupinwatson avatar image
Sirlupinwatson answered ·

Hi @VenuSunkara-4258

What are those lazy hours to work :) :) :)

No but seriously do you mind if i ask why you want to shut them down overnight, i am just curious.

Thanks :P

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Sirlupinwatson,

In my organisation people are using VMs for POC purpose and they are not shutting down their VMs while leaving office & as well as on weekends so it is an extra cost for organization.

Regadrs,
Venu Sunkara

1 Vote 1 · ·

@VenuSunkara-4258 Hi, thanks for reply !!!

Ah , i see , make sense. Consuming more electricity or the actual cost by the hours or days basics AWS is charging you ?

It's just personal informations to help me to understands, thanks mate

0 Votes 0 · ·
VaibhavChaudhari avatar image
VaibhavChaudhari answered ·

I don't see any Azure policy for this requirement. However there is Auto turn off option, but again auto start option is not available.

Azure Virtual Machine auto-shutdown


Also there was similar feedback for this requirement where MS suggests to use Automation option.

Ability to turn ON and OFF virtual machines based on a schedule


1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Vaibhav-Chaudhari

Thanks for your reply, but im looking for a policy (the policy need to apply on the newly creating resources)

Regards,
Venu

0 Votes 0 · ·
Nadeimjoo-9378 avatar image
Nadeimjoo-9378 answered ·

You need to associate Tags with VM and create an automation process that will look for these tags and their values for shutting down VM's and restarting them again.

Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.