Virtual Machine Extensions – Automation, Deployment, and Configuration of Resources

By now, you know how to create a VM and gain access to the VM. Let’s say you want to create hundreds of VMs and want to configure them with a software or application. Creating and managing these VMs manually is a time-consuming and repetitive task. When you perform these actions repetitively, chances of mistakes are likely. You need to figure out a way by which you will be able to automate this whole thing and make your life easier.

FIGURE 8.22 Images in the Azure portal

Honestly, manual configuration requires a lot of time, and it is quite boring. For each virtual machine, you need to create the VM, install the software, configure the software, perform security hardening (if required), and apply updates. There will be cases where you need to redeploy the architecture for testing or recovery. Software development teams use virtual machines for testing, and they need a new set of VMs with preconfigured software during every test cycle. It is not easy to deploy and configure machines manually for each test cycle. Also, if there is a regional failure, you should be able to deploy the architecture in another region. While trying to recover from the failure, you will not have the time to manually configure every virtual machine.

The solution for this is to use some automation tool. You can reduce the complexity of the architecture and pass the configuration as a script or configuration file to these automation tools. These tools will help with the configuration of the VM without any manual intervention. Since there is no manual work involved, the chances of mistakes are minimal. By leveraging these tools, your organization can become more cost effective and productive. In this section, we will introduce the concept of virtual machine extensions.

The post-deployment configuration and automation tasks on Azure VMs can be accomplished using small applications that are called virtual machine extensions. Azure VM extensions can be managed from Azure CLI, Azure PowerShell, the Azure portal, or Azure Resource Manager templates. The extensions can be bundled with the VM deployments or can be provisioned on any existing VMs.

You will be focusing on two main extensions: Custom Script for Linux Extension and the Desired State Configuration extension. These extensions are not the only ones available in Azure; there are also other extensions that we can use for monitoring, security, backup, and other virtual machine configurations. The extensions are offered by Microsoft for both Windows and Linux virtual machines, there are extensions provided by third parties as well.

If you navigate to the extension blade of an existing VM, you will be able to see the list of available extensions (refer to Figure 8.23). The list of supported extensions may vary depending upon the operating system of the virtual machine.

FIGURE 8.23 Virtual machine extensions

In Figure 8.23, you can see you can see the Custom Script for Linux extension in the search results. So, let’s understand more about this extension and its purpose.

0 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms of Use | About | Privacy Policy | Cookies | Accessibility Help | Contact