Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I start and shutdown an Azure VM via web requests?

I have a usage case where I need to send the azure vm start myvmname and azure vm shutdown myvmname commands via a web request.

The intention is to use only on demand instances in the workflow.

So far, I have a static front end on CloudFront, which sends an http request to an intermediary cloud web service, with the intention that this can start and stop my Azure VMs similar to using the NodeJS command line tools.

Preferences for the intermediary service are GAE, Azure or if there is a pay as you go option within AWS that would suit (constantly running an EC2 or Azure VM instance just for this purpose would be overkill).

The CloudFront static front end and Azure VMs for processing are not replaceable in this case.

like image 688
ljs.dev Avatar asked Aug 22 '13 05:08

ljs.dev


1 Answers

The Node.js cross-platform CLI uses the Windows Azure Service Management REST API to perform all its actions. This is a public API which uses an X.509 certificate for authentication. The REST API exposes operations to manage Virtual Machines including a Start Role and Shutdown Role (with the word Role being a synonym for VM).

Note that Shutdown Role deallocates the VM completely, causing it to lose its internal IP address. Performing Shutdown Role on the only VM in the Virtual Machine cloud service causes it to lose its public VIP as well.

like image 62
Neil Mackenzie Avatar answered Sep 22 '22 18:09

Neil Mackenzie