Create Linux Custom Image – Azure Resource Manager

Create Linux Custom Image – Azure Resource Manager

Create Linux Custom Image – Azure Resource Manager

To see Create Windows Custom Image on Azure Resource ManagerFollow this link

This post will show you how to create Custom Image on Azure new portal also known as Azure Resource Manager portal (https://portal.azure.com), this post focuses on creating Linux Image that can be used to deploy multiple VMs in the future using template based deployment.

  1. First Deploy the Virtual Machine from Microsoft gallery and then login to it using SSH. The VM will require a Public IP Address.

2. Once done, then execute below command

     sudo waagent -deprovision+user

This command will do the following –

  • Delete all SSH host keypair from this Virtual Machine
  • Delete /etc/resolv.conf file
  • Disables Root password
  • Purges the DHCP cache
  • Stops the Azure Agent

 

Linux-Generalize

This is similar to running sysprep on the Windows Machine.

3.  Now, Stop the Azure VM by running below command

Linux-Generalize-02

Linux-Generalize-03

Linux-Generalize-04

4.  Now you need to Generalize the Virtual Machine.

Please note that Generalied VMs can’t be started.

Linux-Generalize-05

5.  Once VM is generalized, Save the Image in a Storage Account by running command shown below, which also generates JSON file that can be used in the ARM template for future deployments.

Linux-Generalize-06

      6.  JSON File. The Image URI shown in Green border can be used in your Image Deployments as source Image.

Linux-Generalize-07

About The Author

Related posts

Leave a Reply

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