Is it possible to suspend and resume a windows Azure server? - azure

I have a program that I run only 1-2 hours a day. Is there a way to suspend the Azure server so I don't pay for it, then resume it later? How fast is it to suspend and then resume?

To clarify here, Azure no longer charges for stopped VMs. The billing change was announced in 2013 on Scott Guthrie's blog: No Charge for Stopped VMs.
This means you can use the portal or APIs to stop a VM without deallocating the resource - and avoid charges at the same time.

Not sure if you are asking for Window Azure Cloud Services or for Windows Azure Virtual Machines but you sure can stop/start these Azure Virtual Machines directly on Windows Portal or using Powershell or REST based Service Management API. The Windows Azure Portal does not provide a way to schedule stop/restart so you will have to manually do it by yourself or use some 3rd party service i.e. AzureWatch etc to do it.
Note: Even if you shutdown the Virtual Machine or Cloud Service, you will still pay for if you want to do it for cost saving, then you would need to delete the service or VM. Reboot/Restart does not take long as VM is already configured and ready to run so it is just the time to turn on a pre-configured VM.
If you want to use REST API in your own application to stop/start here is some help:
Virtual Machines: http://msdn.microsoft.com/en-us/library/windowsazure/jj157206.aspx
Cloud Service: http://msdn.microsoft.com/en-us/library/windowsazure/gg441298.aspx
If you want to use Powershell to stop/Start Azure VM look for "Start-AzureVM" and "Stop-AzureVM" cmdlet below:
http://msdn.microsoft.com/en-us/library/windowsazure/jj152841.aspx

To save money, I did Remote Desktop to my Azure Windows VM, and clicked shutdown.
Then, at my Azure dashboard (https://manage.windowsazure.com) > VIRTUAL MACHINES > STATUS it changed from Running to Stopped.
But then I read this doesn't stop the billing.
So I went to Microsoft Azure > Virtual machines (classic) >
and saw the status was Stopped. But this doesn't mean billing stopped.
I clicked the "stop" command, and it changed to Stopped (deallocated) which means no (or near 0) billing.

The screenshot says it all... so only a "deallocated" VM won't be billed!
One more thing to add. As opposed to a deleted VM, a deallocated VM still has virtual disks attached to it which consume storage space and therefor creates costs.

If you mean the "suspended" state you can achieve with your computer I don't think is available today on Azure.
Google Cloud for example has just released that feature on beta https://cloud.google.com/compute/docs/instances/suspending-an-instance

Related

Find a script which can stop shut down Azure Vm from azure portal when the Vm is restarting after the patch applied

Background:
Now I use an Azure Automation to shutdown the Azure Vms,
but I met a problem last time when one VM had been shutdown form the Azure portal
when it was restarting after the applied patch and the result was the VM could not start again.
I want to find if there has a script that can check if the VM is restart/start/shutdown when I shut down the VM from Azure Portal.
Thanks in ad
You can use Azure Automation to schedule all your Start/Stop/Restart jobs. If ever, you need to check when and how your VMs have been restarted and by whom, you could check the Log history from the portal, inside your VM's sections. To automate the display of this using a script, you could use a simple runbook that queries the tables from the access logs of your VM, and triggers an action of your choice...
I hope this could help you resolve your issue :)

How can i diagnostic why Azure VM fallen "This virtual machine is stopping and deallocating as requested by an authorized user or process."

I use Azure- windows VM for running some services, the services are very stable(after testing).
The server run one day and after that he has fallen and i get this message.
**
Diagnose and solve problems
In Activity log
Resource health
Solved
The problem was in 'Auto-shutdown' it was enabled to 'Scheduled shutdown'. you can find it under - HOME --> VM --> Auto-shutdown(under the title Operations).
From the Activity Log, we can see the Azure Lab Service initiated the VM deallocation.
When you create a Lab Service in Azure, there is an option for you to automatically shut down virtual machines when users disconnect. It's probably the reason. This could help save costs.
It's the same Lab policy when you create template VMs in the lab Account or change it later.

Does Azure deallocate end user's VM's at its own discretion?

Does Azure deallocate end user's VM's at its own discretion?
I was using an Azure VM for a clean build and then the remote connection was dropped, I tried to reconnect by RDP and found out the machine was deallocated.
The info from Microsoft was:
Connect is disabled because this virtual machine is deallocated.
I did not know that Azure took machines away like that?
I would be hesitant to use Azure VM's in the future for build work.
Azure does not de-allocate your VM. There are numerous reasons you VM might be de-allocated while you are using it, below are a few;
Like #david mentioned in comment, you ran out of credit
Shared subscription, someone that also has access to you subscription shutdown VM
Automation, VM is set to shutdown at a certain time
These a just a few reason why you vm might have de-allocated while you are using it. If you can't determine on your own why it shutdown you can file a support ticket with Azure support.
Hope this helps.
Check if your appropriate resource group is enabled:
Open Azure portal.
Navigate to the Subscriptions.
Search for the necessary subscription group. enable it.
By default, there is a scheduled shutdown on Azure. If you go to operations settings in the left panel of the Azure VM portal, there is an auto-shutdown. You need to disable it so that your VM won't shutdown at the scheduled time.
Azure VM machine might be in stopped mode so it is saying that error message, please check the Azure VM list and see the status, accordingly start the VM, it will work
normally when you create your VM, you will see that there is a parameter that it will stop at 7pm or something like that. So After 7pm it will stop you VM. Which is good I think, because we tend to forget our VMs and then we pay for nothing. So no worries, just start your vm and you are all good to go :)

Can't deploy or manage to Azure cloud service (classic) e.g. web role, is there a way to reboot?

I've been deploying to my cloud service/web role pretty regularly for over a year with no issues. But suddenly, today, my deployment bombed with the following error:
The HTTP request to
'https://management.core.windows.net/*****/services/hostedservices/*****?embed-detail=true'
has exceeded the allotted timeout of 00:01:00. The time allotted to
this operation may have been a portion of a longer timeout.
And when I attempt to view the resource in the Azure portal dashboard, it eventually times out and displays a rain cloud icon. I get the same timeout and rain cloud icon when clicking on "Roles and Instances".
Azure's status page shows my region "West US" doesn't have any issues.
Interestingly, I can still access my application via the browser, so some instance is there and running, I just can't deploy updates to it or manage it in any way via the Azure portal.
What are my options here? I was hoping I could RDP into it and force it to reboot or restart IIS or something, but everything I click on related to the cloud service in the portal times out. I'd hate to have to attempt to delete it and create a new one as it's a pain to get the settings in sync, and often times I can't name it the same, etc.
Any ideas?
So, after going down the rabbit hole for about an hour playing around with the new Cloud Shell feature from the Azure portal to see if I could reboot it via a power shell command, the issue seems to have resolved itself. I guess it was some sort of temporary hiccup with Azure or something, but I can now see my cloud service/web role in the portal and can now deploy to it.

Confused about Azure VM Creation

So I am a little bit confused about the Azure feature to create virtual machines(i.e VMRoles).
When I do a quick create via the managment portal, I am not asked to specify nor a hosted service nor a storage account. After I click 'create' I see that a storage account is generated for me automatically with some unique name, but I don't see the same for a hosted service. Is a hosted service not needed to create a VM?
The thing that is confusing is that it seems like every other method for creating a VM does require me to specify a hosted service (Azure PowerShell, REST API). And indeed after I create the VM using one of these methods I see my VM inside the hosted service...
Anyone can explain this?
Thanks in advance
Please do not confuse Windows Azure Virtual Machines (IaaS, stateful) with Windows Azure VMRole (PaaS, stateless).
As for creation - the process behind the portal is automated. For me, I have a separate Cloud Service for each Virtual Machine I've created (along with the auto generated storage account). However as all operations are asyc, and I also guess the Microsoft teams are using some kind of CQRS pattern behind the portal, it might take some time for all the components behind a Virtual Machine to appear. While the API strictly requires everything to be ready set, before you actually create the Virtual Machine. My guess is that soon you will also see a cloud service created for your VM (it usually is with the name of the Virtual Machine you created). Also, if you have noticed, the public URI for accessing your Virtual Machine (be it RDP or SSH) has the format of [your_vm_name].cloudapp.net - so this is a Cloud Service (formerly known as Hosted Service).
First of all Windows Azure Virtual Machines and VM Role are two separate things. Based on what you have explained it seems you are trying to create a Windows Azure Virtual Machine so I will explain you in short how it works:
Very first: In order to create a Windows Azure Virtual Machine you need a VHD which has OS Image. You can use one from Gallery or you can upload one by yourself to your specific Blob Azure Storage.
When you use Quick create or create the process is exactly same in the background however during quick create lots of settings is already predefined as will quick create you will only get Windows OS VHD to choose. In both cases a storage account is used to copy the OS VHD (if it is not part of your OS image collection). In most of the cases a previously created storage account is used, so you may think in was not created but in fact the storage account was used to copy the VHD from repo. This may not be the case if you create a VM from an image which is already in your OS VHD collection.
With quick create the DNS name you set is become the VM name but with create you have option to create a different DNS name for your application but they needed in both cases. In any case the DNS name will bind to your VM, the same DNS name will distinguish your VM from others and a must to configure for any VM.
I believe that the cloud service is not surfaced for a single quick-create Virtual Machine. This is to make Virtual Machines as easy to use as possible. The cloud service would be created and be displayed on the portal were a second virtual machine to be added to the cloud service.

Resources