In this article, we are going to see how to create a Virtual Machine (VM) image and back it up in real time in Windows Azure environment. In our previous article we have seen the option to attach and detach a Virtual Machine data disk without much of the effort in maintaining. Images are nothing but a replica of an environment that is ready to use by provisioning it, initially in our previous articles, we have used a Windows Server 2008 R2 from the Gallery, which is a fresh image of the Windows Server that is made available in the list.
Similarly, we can create our own Image and make it available so that we can use it whenever we need a new instance up and running. Basically in simple words we can say an Image is like a template which can be used a reference to create a number of similar instances in no time. Let us see the step-by-step approach on how to achieve this task to capture a Virtual Machine image in Windows Azure.
Open Windows Azure Management Portal with your valid login credentials and navigate to the Virtual Machine and click on Connect to login to the machine with the credentials which we used while provisioning the machine as shown in the screen below:
Click on Ok and proceed to connect to the machine and login as an administrator. Now open command prompt by going to start programs and see to open the command prompt in administrator mode as shown in the screen below:
Now change the root directory to
%windir%\system32\sysprep, and run the executable
sysprep.exe which is a System Preparation tool kit that is used to manage the remote systems as shown in the screen below:
sysprep.exe will open the System Preparation Tool, select the options “Enter System Out-of-Box Experience (OOBE)” and make sure that Generalize is checked. Now select the shutdown option from the dropdown as shown in the screen below:
Click on OK and we can see the system starts shutdown and in the Windows Azure Management portal, we can see the status as Stopped as shown in the screen below:
Now select the Virtual Machine instance which we need to create an image and at the bottom menu, we can see an option Capture that is used to create an image of the virtual machine, which we are selected as shown in the screen below:
Clicking on Capture button will open the Capture Dialogue screen where we need to input the data, the Image name and the Virtual Machine name as shown in the screen below:
Now click on the ok button to proceed further and start creating the Image to capture and we can see the status as shown in the screen below:
Once the image is created we can see the list of available images in the Image tab that is available next to the Virtual machines tab and disk tab as shown in the screen below:
Therefore, in this article we have seen how to manage and capture an image that can be used as a template for the virtual machines.