question

mimckitt avatar image
0 Votes"
mimckitt asked ·

Trending on MSDN: Check if an Azure VM is up and Running

I want to start a Virtual Machine using REST API.

I am currently following this code.


I have 3 questions:

  1. Is there a way to know if a VM is up and running already using API or any other code?

  2. What will happen if I try to start a Virtual Machine that is already running?

  3. How can we find out after calling the API that the VM is actually up and running? Is there a fixed wait time?

Sourced from MSDN


azure-virtual-machines
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.

1 Answer

olufemiaMSFT avatar image
1 Vote"
olufemiaMSFT answered ·

Welcome to the Microsoft Q&A (Preview) platform. Happy to answer your questions.

All the REST commands related to Virtual Machines can be found here.


The instance view Command will get you the status of the VM to see if it is running or deallocated.


If you attempt to start a virtual machine that is already in the running state, the command will simply error out stating the VM is already running. It will not impact the VM negatively in any way. Here is the API command to start a VM.


An example in PowerShell after running the start command is that you get a response back stating that the VM is up and running that the command was successful. The same is true for a REST call. And as mentioned above, you can always use the instance view call to get the current power status of a VM.

Sourced from MSDN


· 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.