Forum Discussion

Fabien62's avatar
Fabien62
Copper Contributor
Nov 19, 2020

Get info in virtual machine

Hi,

 

I have some questions about azure virtual machines (VMs) :

 

How does the pricing work? Are we paid per hour of use or per month?
For example, if I use it for 20 hours for 1 month, how does it work?

 

Does the pricing take place when the machine is running or when you connect to the virtual machine?

 

When stopping the VM, do I lose the files saved in drive C (SSD) and/or D (HDD)?

 

Finally, with the $100 offered for students, do we have enough to have a computer (4 CPU, 8 GB Ram as a minimum)?

 

Thank you in advance (I have a lot of questions, please forgive me).

 

 

  • Fabien62, that's not a simple question as you have to consider multiple factors and tradeoffs. First and foremost, you need to know that there's a difference between the pay-as-you-go (PAYG) concept and the pricing for specific Azure services, like VMs. In the cloud, you're only paying for what you're consuming (it's applicable to any cloud provider, not just Azure). However, with regard to VMs - and these are pre-allocated resources, i.e., you're still paying for a VM, even if it's stopped, just because it occupies compute resources in the data center. The only way to stop billing is to 'deallocate' (i.e. destroy) the resource. Other than that, you're billed for 730h a month (24h a day, along the month) for the VM. So, answering your first question, the pricing takes place from the moment you spin-up a VM and up until the moment you destroy it entirely.

    Now, during the VM creation, it attaches a managed data disk. The data is stored there just like on any other hard drive, so if you turn the VM off, your data won't be lost. There is a caveat - try not to use 'temp' shares attached to a VM by default, they're not meant for long-term storage.

    Finally, the $100 offering is not that much even for the general-purpose tier of VMs. The pricing heavily depends on the tier, and you can review it here. Azure Pricing Calculator will be your best friend in determining the monthly payment :smile:

    To save some money I personally prefer to Backup the entire VM if I don't use it (and I know I'll be using it in the future), so you'll only pay for Backup storage that is a lot cheaper than the running VM. Another useful option is to remove the unused VM and keep a data disk that was associated with it. Later on, if you decide to work with that VM, you'll be able to create a VM using the data disk (with your data and OS) that already exists in the virtual network (more about this approach here).

    Pay attention to the B or D class of the virtual machines (general purpose), that may fit your budget (maybe even B2MS specifically). Please bear in mind that some VM types may not be available in your region. As mentioned, consult the Azure calculator to find the best VM that fits your needs, and don't forget about the other changes that may occur (such as the storage and the network bandwidth). The calculator allows getting that factored-in as well. One of the best practices is to create a Budget and keep an eye on the Cost analysis in your subscription as you go.

     

    P.S. Please click 'like' and mark the question as answered if it helped :smile:

  • Command0r's avatar
    Command0r
    Iron Contributor

    Fabien62, that's not a simple question as you have to consider multiple factors and tradeoffs. First and foremost, you need to know that there's a difference between the pay-as-you-go (PAYG) concept and the pricing for specific Azure services, like VMs. In the cloud, you're only paying for what you're consuming (it's applicable to any cloud provider, not just Azure). However, with regard to VMs - and these are pre-allocated resources, i.e., you're still paying for a VM, even if it's stopped, just because it occupies compute resources in the data center. The only way to stop billing is to 'deallocate' (i.e. destroy) the resource. Other than that, you're billed for 730h a month (24h a day, along the month) for the VM. So, answering your first question, the pricing takes place from the moment you spin-up a VM and up until the moment you destroy it entirely.

    Now, during the VM creation, it attaches a managed data disk. The data is stored there just like on any other hard drive, so if you turn the VM off, your data won't be lost. There is a caveat - try not to use 'temp' shares attached to a VM by default, they're not meant for long-term storage.

    Finally, the $100 offering is not that much even for the general-purpose tier of VMs. The pricing heavily depends on the tier, and you can review it here. Azure Pricing Calculator will be your best friend in determining the monthly payment :smile:

    To save some money I personally prefer to Backup the entire VM if I don't use it (and I know I'll be using it in the future), so you'll only pay for Backup storage that is a lot cheaper than the running VM. Another useful option is to remove the unused VM and keep a data disk that was associated with it. Later on, if you decide to work with that VM, you'll be able to create a VM using the data disk (with your data and OS) that already exists in the virtual network (more about this approach here).

    Pay attention to the B or D class of the virtual machines (general purpose), that may fit your budget (maybe even B2MS specifically). Please bear in mind that some VM types may not be available in your region. As mentioned, consult the Azure calculator to find the best VM that fits your needs, and don't forget about the other changes that may occur (such as the storage and the network bandwidth). The calculator allows getting that factored-in as well. One of the best practices is to create a Budget and keep an eye on the Cost analysis in your subscription as you go.

     

    P.S. Please click 'like' and mark the question as answered if it helped :smile:

Resources