VM Image
VM Image
VM Image
An image is a template that's used to create a VM. The image can include an OS and other software.
Yes, we can create a custom disk image to create a VM as per your organization.
An Azure virtual machine runs in the cloud, in an Azure datacenter. When you create a virtual machine,
you specify a virtual machine image to use. This image contains the operating system and (optionally)
other preconfigured software.
Azure uses this image to create a new virtual hard disk (VHD) from which it can start your virtual
machine. You can then customize the virtual machine by configuring and installing additional
applications, according to your requirements.
Yes, you can also build your own virtual machine images and VHDs from scratch by using Microsoft
Hyper-V. You can then upload these images to Azure so that your virtual machines can use them.
You can extend an existing virtual machine image with your own software. You can then use the image
as a basis for deploying additional virtual machines in your organization. For example, if you have an in-
house system that you need to roll out across all of your virtual machines, you can create an image that
includes this system, and then build your virtual machines from this image.
You can create your own custom virtual machine image in one of two ways:
1. Using Hyper-V: - If you're building an image from scratch by using Hyper-V, you first create a
blank virtual disk, and then create a virtual machine with this disk. When you start the virtual
machine, you install the operating system and any other additional software from source disks
(typically DVDs) and other packages.
2. Customizing an image from Azure Marketplace: - If you're customizing an image from Azure
Marketplace, you build a virtual machine by using an existing image. The image provides the
operating system and base functionality. You add your own software, operating system updates,
and other packages as required.
What you need to clean up after build and customize a virtual machine?
After you build and customize a virtual machine, you can save the new image as a set of VHDs. However,
you must do some cleaning up first. This is because as you create a virtual machine, the operating
system data is updated with several items, including:
You must reset these items back to a default state before you use the image to create more virtual
machines. Otherwise, you might end up with multiple virtual machines that have the same identities.
The process of resetting this data is called generalization.
A specialized virtual image is a copy of a live virtual machine after it has reached a specific state. For
example, a specialized image might contain a copy of the configured operating system, software, user
accounts, databases, connection information, and other data for your system.
You can use a specialized virtual image as a backup of your system at a particular point in time. If you
need to recover after a catastrophic failure, or you need to roll back the virtual machine, you can restore
your virtual machine from this image.
If you use a specialized image to create a new virtual machine, the new virtual machine will retain all of
the data from the image. That data includes the host name, user accounts, and other settings.
What is a snapshot?
A snapshot is a read-only copy of a VHD. You can use a snapshot to restore a VHD to the state it was in
when the snapshot was taken.
If you're taking an image of a virtual machine that spans several VHDs, you must ensure that all disk
activity has stopped, and that you take a snapshot of every VHD. Failure to do this can result in
inconsistencies if you need to restore the virtual machine from these snapshots. By stopping the virtual
machine, you can ensure that there is no disk activity and that a successful snapshot is taken.
Create an image of an Azure VM from the Azure CLI and provision a new VM
Create an image from a generalized VM