Skip to main content

Different cases of Azure VM 'reboots'

This post is focusing on different types of maintenance activities that can happen on your Azure Virtual Machine (VM). Depending on the actions that need to be done on your VM, this can have a direct or indirect impact on the machine availability or performance. 

Impact types
First of all, let's identify how a machine can be impacted by different maintenance activities. We do not include in this discussion cases like outages or disasters.
  • Performance decrease: During a live migration of a machine, the performance of the machine can be lower than usual. This happens because of the live migration of a machine from one physical hardware to another that consumes resources.
  • Pause: For a short period of time the machine is paused, but without data loss or connectivity problems (E.g., RDP connection is maintained, but delayed for a short period of time).
  • Unplanned reboot: There are isolated cases when the VM needs a restart. In this situation, there is a short period of downtime until the machine restarts.
  • Loss temporary drive: In specific situations, the temporary drive of the machine is lost. This shall not impact the applications that are running on the machine because the temporary drive should be used only for temporary data. 
  • Planned reboot: In this situation in the time window specified by the user when system redeploy is allowed, Azure initiates a system update that might request a system reboot. 

Impact situations
There are 3 types of cases when our machine availability is impacted.
  • Unplanned hardware maintenance: This is one of the most impressive scenarios. The platform can predict a hardware failure and trigger a migration from one physical hardware to another. This migration is done using live migrations technology that reduces the impact on the machine.
  • Unexpected downtime: It is represented by the cases when physical hardware fails (E.g., disk failure, network failure) and the only thing that is possible to do is to migrate the machine to another hardware on another rack or datacenter. In this situations, the machine is down for a specific time. Even if the temporary disk can be lost, the data and OS disk are preserved. 
  • Planned maintenance: Normal maintenance activities that are happening on Azure or machine level (E.g., OS update). In general, there is no impact on the machine availability, expect exceptional cases when a reboot is required. For this scenarios, Maintenance-Redeploy can be used to trigger the restart in a convenable time window. 


Mitigations procedures
There are some small things that we can do on our side to mitigate these situations and reduce at minimal the impact on our machines. 
  • Availability Sets: The first thing that we can do is to add multiple machines inside an availability set. This ensures us that in the case of a hardware failure the machines are stored on different physical resources, that are shared between them (fault domains). The same thing is applicable from how updates are pushed automatically to the VMs and how the reboot is happening (update domains). This combination of update and fault domains is called Available Set and is managed automatically by Azure. Using Availability Sets, Azure is offering a 99.95% uptime SLA.
  • Azure Load Balancer: It is not enough to have all the machines up and running. Besides this, you need a load balancer that can manage the load between machines and detect when a machine is rebooted. 
  • Azure Zones: Are entirely different from Availability Sets and ensures that machines are running in separate physical locations in the same Azure Regions. This means that each zone has its own storage, cooling system, network and power source. 
  • Manage Disk: This goes hand in hand with Availability Sets and ensures that the machine disks are isolated from each other. Behind the scene, each machine disk is added on different storage fault domains to ensure that in a case of a storage failure only a part of instances of that machine is affected.
  • Separate Availability Sets for each Application Tier: This simple solution ensures that it is impossible to have all machine restarts from the same application tier at the same time. If you use only one Availability Sets for all tiers, there is a small chance that all the machines from a specific tier to be restarted in the same time (odds are low, but still exists). 

Conclusion
As we can even if there are situations when we can have our machine down for a short period of times, there are simple things that we can do to avoid this kind of situations. Combining Availability Sets with Manage Disks and by keeping different application tiers on different Availablity Sets improves the odds to have our system offline. 

Comments

Popular posts from this blog

How to check in AngularJS if a service was register or not

There are cases when you need to check in a service or a controller was register in AngularJS.
For example a valid use case is when you have the same implementation running on multiple application. In this case, you may want to intercept the HTTP provider and add a custom step there. This step don’t needs to run on all the application, only in the one where the service exist and register.
A solution for this case would be to have a flag in the configuration that specify this. In the core you would have an IF that would check the value of this flag.
Another solution is to check if a specific service was register in AngularJS or not. If the service was register that you would execute your own logic.
To check if a service was register or not in AngularJS container you need to call the ‘has’ method of ‘inhector’. It will return TRUE if the service was register.
if ($injector.has('httpInterceptorService')) { $httpProvider.interceptors.push('httpInterceptorService&#…

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine:
threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration:

TeamCity.NET 4.51EF 6.0.2VS2013
It seems that there …

Fundamental Books of a Software Engineer (version 2018)

More then six years ago I wrote a blog post about fundamental books that any software engineer (developer) should read. Now it is an excellent time to update this list with new entries.

There are 5 different categories of books, that represent the recommended path. For example, you start with Coding books, after that, you read books about Programming, Design and so on.
There are some books about C++ that I recommend not because you shall know C++, only because the concepts that you can learn from it.

Coding

Writing solid codeCode completeProgramming Pearls, more programming pearls(recommended)[NEW] Introduction to Algorithms

Programming

Refactoring (M. Fowler)Pragmatic ProgrammerClean code[NEW] Software Engineering: A Practitioner's Approach[NEW] The Mythical Man-Month[NEW] The Art of Computer Programming

Design

Applying UML and Patterns (GRASP patterns)C++ coding standards (Sutter, Alexandrescu)The C++ programming language (Stroustrup, Part IV)Object-oriented programming (Peter Coad)P…