VM is still incurring compute charges, even though it is "stopped"? - azure

I have a VM running Windows on Azure... I do not currently need it running, so I used the Portal and "stopped" it a few months ago.
However, I am still incurring compute charges. And when I visit the Portal, it says the VM is still incurring charges and that I need to "... use the Portal to stop it ...".
But at the same time, the Portal is showing that the VM is already "stopped". I have included a screenshot. Why does it incur compute charges when it is supposedly already "stopped"?

This is an Azure "feature". You have to deallocate the VM for it to stop costing you money. The screenshot even says that. To address your second question, if its not incurring charges it would be in deallocated state.
If you are using automation, you need to issue the deallocate rest call
https://management.azure.com/subscriptions/xxx/resouceGroups/yyy/Microsoft.Compute/virtualMachines/vmName/deallocate?api-version=xxx

Related

Why the remaining credit amount is reducing although I'm not using the VMs?

I've "Visual Studio Enterprise" azure subscription. I initially got few credits. I think it was $200 for free. Earlier it used to show static remaining credit i.e. if I built two VMs and it cost $50 it would show $150. But since few days may be just past day remaining credit is continuously reducing.
The activities I have done so far. Earlier I was unable to connect to VM as outgoing connection was not allowed from my organisation. Since I have got permission I'm able to connect. After that I installed Active Directory Services on one of the VM.
I don't think till this step my credit amount got reduced except for the VMs I built.
I was trying to start and stop the VM using powershell but I wasn't able to do so. So I installed powershell azure modules. using Connect-AzAccount to connect and then used Start-AzVM and Stop-AzVm to start and stop the VMs. Just to clarify I keep the VMs in shut down mode so I don't keep getting billed.
Still the amount is being deducted. I ran Disconnect-AzAccount on suspicion that it might be causing the issue but still it hasn't fixed the issue.
Can any one help here?
There are mainly two ways to stop VM:
Stop the Azure VM locally: When you connect to the Azure VM with remote desktop, go to the Power options within Windows and select Shutdown, this will essentially “turn off” the VM and stop it from running. However, even though the VM won’t be running you WILL still be paying for the Virtual machine hardware allocation. Doing this will cause the Azure Portal to report the status of the VM to be “Stopped”.
Another way is to click Stop in the virtual machine page on the portal(or use Azure PowerShell or Azure CLI). Instead of just shutting down the Operating System, Azure will also deallocate the hardware (CPU and Memory) allocation. Doing this will cause the Azure Portal to report the status of the VM to be “Stopped (Deallocated)”.
Overall, both methods will reduce cost but not none of cost. You do still pay for the Azure Storage account usage, which is used for storig the VM’s .vhd disk image file. As a result, you will still incur some cost for the storage, but at least you will save on the VM resources.
Ref: Properly Shutdown Azure VM to Save Money
You need to identify what resource are been billed when VM is stopped or Stopped De-allocated.
Check the Cost analysis under Cost Management to identify the resource. Note that when VM is stopped you still pay for storage and other resources depending in your setup.

Does Windows Azure delete VMs that have been switched off?

I turned off several Azure VMs a few months ago, but they are no longer listed or available in my account.
Does anyone know if they auto-delete them if they have been switched off?
No, they wont get deleted and on top of that they will continue to cost you something. If you deallocated them using portal\cli\powershell\rest api, they will only cost whatever their storage costs. if you just did shutdown from inside the VM they will incur full cost.

Will Azure Cloud Service in Suspended state with Stopped Web role incur cost? [duplicate]

This question already has answers here:
Does Azure Worker Roles get charged $$ when they are Sleeping?
(3 answers)
Closed 4 years ago.
When the Azure Cloud Service is suspended and the Web Role associated with it has status Stopped VM, will this Cloud Service incur VM costs?
If not, how can I stop the Cloud Service so it will not incur cost but can be easily started when needed?
UPDATE: I looked into the wrong thing previously. This link may help:
Does Azure Worker Roles get charged $$ when they are Sleeping?
Either way: The short answer is yes. Everything I searched for within SO or Google says that you will still be charged. The only recommendation was to delete.
Azure web site offers a free online chatting tool that allows you to talk to Microsoft directly to know for 100%. If you do that route, then please come back and let us know for future users.
Original (may be useful for future)
I had recently asked Azure the same question. They recommended that I should either stop the server when not in use or move it to a free tier. They also said if the data is still on the VM or Web App, I will still be charged for that.
Your VM says Stopped rather than Stopped (Deallocated) so it may still cost you.
This link may help: https://blogs.technet.microsoft.com/gbanin/2015/04/22/difference-between-the-states-of-azure-virtual-machines-stopped-and-stopped-deallocated/
Try moving it to the free tier.
In addtion to here: https://azure.microsoft.com/en-gb/pricing/details/app-service/linux/
It says:
Am I charged for apps while they are in stopped state? Yes. Rates
listed apply to apps in stopped state. Please delete apps that are not
in use, or update the tier to Free to avoid charges.

Best practices for reducing Azure VM hours?

I recently implemented SSRS on a Azure VM and was very surprised when I realized I would be billed for 100% of the hours in a month if my VM was running. This runs around $200 and is in no way economical for our small reporting service we use for about 5 days month. What are my options for reducing VM hours?
I have already established I can shutdown and deallocated the machine when we are not using it. Ideally though the service would go into some kind of sleep mode and reallocate when the service is pinged.
You pretty much figured it out: When a VM is running, you're billed for it. This is how it's always been in Azure: Whether utilizing 0% or 100% of the VM, you're billed for the running VM. Think of it as paying for reserved resources. Just like an apartment, where you pay for the rent even if you're using it 0% (e.g. not home).
You can choose to stop the VM at any time, and billing stops, until you start the VM again. This is easily done via PowerShell / CLI, so you can automate it with your own tooling.
Note that VM billing is actually per minute, so if you shut down a VM after 30 minutes, you're not billed for an entire hour.
Only you can decide the proper way to manage your VM's uptime, based on your app's usage. There's no single right answer to that. And there's no mechanism for the VM to sleep if it detects inactivity. That's going to be an application-dependent thing (deciding when to shut down).
You have a couple of options to correct address this:
You could use automation, where you run a Powershell script to turn you VM off during off-peak time. Check this out:http://azure.microsoft.com/blog/2014/08/20/azure-automation-capabilities-in-depth-the-azure-automation-powershell-cmdlets/
You can setup alerts now in your account portal (yeah, I just said that!) Check it out here: http://azure.microsoft.com/en-us/documentation/articles/azure-billing-set-up-alerts/
I would look at both. You can shut-down a VM from PowerShell (MS just demonstrated that to me in a workshop this week), so I would use this approach if you know that SSRS is only going to run for a specified window.
You can also check Azure automation option if you have a definite schedule for the VM to be up and down. Azure automation gives you a way to create a runbook to manage the up time of the VM and also options to do the scheduling. Check this blog for more information https://blogs.endjin.com/2015/01/using-azure-automation-to-run-vms-during-office-hours-only/

90 days test Iaas Azure offer: how are calculated the costs when a VM is stopped

I have been doing some test and realized that when I stop a VM, I get a red warning saying that it still generates charges.
But on which basis ?
Furthermore, on some VM I created, the system without any reason starts fooling and reach a 98% CPU during several hours with no way to stop it or to connect with RDP. VM was totally dead and it's only after several hours that the stop command from the control panel succeeded.
Hope I will not been charged for this ? Who is able to decide if my VM is OK or fooling like a crazy horse ?
Moreover, is there any software allowing to transfer my VMs from Azure to my local system, and delete them on Azure to stop any charge ? for a simple backup with possibility to restore/restart them later ? Or to run them in my own hyper-V ?
Best regards
CS
Even if your VM is stopped, you still have resources that have been reserved for your VM (think of storage space, memory, CPU, ...) and these can't be 'sold' to anyone else. Deleting the VM will free these resoures and you'll no longer be charged.
Remember that Virtual Machines are still in preview, meaning things can go bad sometimes. And yes you'll be charged for this, but during the preview you get a 33% discount (more info here: https://www.windowsazure.com/en-us/pricing/details/).
The persistent disks of your VMs are stored in a storage account as page blobs. Using tools like Azure Storage Explorer, CloudXplorer, CloudBerry, ... you can download these VHD files and simply mount them in Hyper-V (You'll need to remember that you'll need a license if you want to run the machine on-premises).
Note that, if you simply delete the VM the disks won't be deleted (they will stay in your storage account). In that case you only pay for storage (which is very cheap).
The price of VM depends on their size and nature (prenium or not).
Also you have to pay for the storage, but a 120GB disks is not billed fully, only effectively used space is.
You can use IaaS Managament Studio to easily calculate how much your blob disk cost, and see links to pricing pages of azure.

Resources