What is an Azure VM image?

1.5 hours

Show
  • 4 Learning Objectives

What is an Azure VM image?

About this Hands-on Lab

When architecting solutions in the cloud that leverage compute, it is very common to need to rapidly deploy Windows or Linux servers, which fit a specific purpose.

VM images allow you to have a Windows or Linux server, which is pre-configured with applications, software, security, and more. We can then speed up (and automate) the deployment of VMs, which are built from these images and are ready for use.

Within this lab, you’ll gain experience creating a custom VM image from a Windows virtual machine.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Configure a Virtual Machine with IIS

Use the Azure Portal to perform the following tasks. Please log in with the credentials provided to you for this lab.

Please be aware you will need an RDP client to connect to the Windows server. To connect to vm1, use the credentials provided on the lab page.

Connect to VM1 Using RDPNavigate to the Virtual Machines services page.Open the existing VM called vm1.Click on the Connect option in the command bar, and select RDP.Use the RDP file with your preferred RDP client.Note: You may choose to copy the public IP address and connect via RDP manually with your RDP client, instead of using the RDP file.

Configure a Web ServerClick Start, Windows PowerShell, then Windows PowerShell.Type the command: Install-WindowsFeature -name Web-Server -IncludeManagementTools

Create a Basic HTML PageClick Start, Windows PowerShell, then Windows PowerShell.Type the command: ConvertTo-Html -InputObject (Get-Date) | Out-File C:inetpubwwwrootindex.html You can test that the webserver is working by opening http://locahost in Internet Explorer. It should display the test HTML page you just created (date-time).Remain connected to the server by RDP for the next task.Generalize the Windows ServerEnsure you are still connected to VM1 using RDP, as per the previous task.Perform SysprepRight-click the start menu.Click on Run.Type the following: %WINDIR%system32sysprep.Click OK to open the folder.Double-click on the sysprep.exe file.Use the following settings:System Cleanup Action: Enter System Out-of-Box Experience (OOBE)Generalize: tick the tickboxShutdown Options: ShutdownNOTE: When you click OK, the computer will generalize and then shutdownClick OK. Note: The above task can be completed in with the following command-line option if preferred: %WINDIR%system32sysprepsysprep.exe /generalize /shutdown /oobe.Create an Image of the Virtual MachineUse the Azure Portal to perform the following tasks. Please login with the credentials provided to you for this lab. (adsbygoogle = window.adsbygoogle || []).push({}); Convert VM1 to an ImageNavigate to the Virtual Machines services page.Open the existing VM called vm1.Check that the Status is showing as stopped.Use the RDP file with your preferred RDP client.Click on the Capture option in the command menu, and use the following settings:Name: vmimage1Resource group: leave the default selectedAutomatically delete this virtual machine: noType the virtual machine name: vm1Click on Create.Note: You will no longer be able to start vm1 after completing this step.Create a VM using the VM ImageUse the Azure Portal to perform the following tasks. Please login with the credentials provided to you for this lab.Create a VM from the ImageNavigate to the Images services page.Click on vmimage1, which we just created.Click on the + Create VM option in the command menu, and use the following settings:BasicsSubscription: leave as-isResource group: leave as-isVirtual machine name: vm2Region: leave as-isAvailability options: noneImage: leave as-isSize: B2sAdministrator account: use the provided VM credentialsPublic inbound ports: noneLicense Type: Windows ServerWould you like to use an existing Windows Server license?: NoClick on Next: Disks.DisksLeave as-isClick on Next: NetworkingNetworkingVirtual network: vnet1Subnet: subnet1Public IP: leave as-isNIC network security group: NoneClick on Review + create.Click on Create.Note: We have network security already associated with vnet1. This will allow RDP access to vm2.

Test the VMConnect to the VM using the steps followed earlier. Ensure you use the new public IP address for vm2.Once connected, you can verify the VM is created from the image by performing the following test:Test: Open http://localhost in Internet Explorer Result: You should see the page we created earlier. The above test validates that your new server has (a) IIS configuration from vm1, and (b) the index.html file you generated on vm1.

Additional Resources

You've recently been hired as a solution architect by The Pupper Camp (TPC). The Pupper Camp is a dog services company that works across the globe.

Your IT manager has asked you to provide a proof-of-concept virtual machine image for a website that TPC needs to scale rapidly.

You will need to create a VM image with IIS (Web Server) installed, including a test HTML file. This image must then be used to demonstrate the deployment of a virtual machine using your image.

Note: When creating a VM using the VM Image, choose License Type: Windows Server. On the question Would you like to use an existing Windows Server license?: choose No.

What is an Azure VM image?

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

What is a VM image?

A VM image is an executable image file from a VM; this image file is in a special storage format. We can create a new VM by uploading the image file to the physical machine. Usually some software, like mysql or ms office, is installed on these new VMs beforehand.

What is the difference between image and snapshot in Azure?

Images versus snapshots With managed disks, you can take an image of a generalized VM that has been deallocated. This image includes all of the disks attached to the VM. You can use this image to create a VM, and it includes all of the disks. A snapshot is a copy of a disk at the point in time the snapshot is taken.

How do I create a VM image in Azure?

Use the portal.
Go to the Azure portal to find a managed image. ... .
Select the image you want to use from the list. ... .
Select Create VM from the menu..
Enter the virtual machine information. ... .
Select a size for the VM. ... .
Under Settings, make changes as necessary and select OK..

How do you find the image of a Azure VM?

Go to azure portal > Select the running/stopped VM whose image you want to identify > Go to export template option > On the right side of the screen, you will see the template window will open in JSON format. > Ctrl+F (search) > imageReference > you will get your image version in the template.