>> Hello there, and thank you very much for joining us
today in this new Azure Portal How To Video. Today we
learn how to capture a virtual machine image and use it
from the image gallery. And for that, we have Devin
DeCaro-Brown, who’s going to
show us how to do that. So, thank
you very much for joining us today, Devin.
>> Yes. Appreciate you for
having me again, Leon. Today we’ll
walk through capturing a virtual machine to shared image
gallery. We’ll show you how you can then use that image
to create more virtual machines and replicate it across Azure.
>> Let’s see it.
>> Let’s do it. Starting from an existing virtual machine,
you’ll notice several commands at the top, including
connect, start, stop, delete, and capture. Today’s how to
will be focused on capture. Capture is the equivalent of
saying create an image from this virtual machine. Let’s go
ahead and click this command.
One of the first things you may notice in this experience is
that you have the option to share the image to shared
image gallery or create a managed image. With shared
image gallery, you can easily replicate your image around
the world, take advantage of zone redundant storage, and
maintain versioning for the images. We’re going to stick
with the default and share the image to shared image gallery.
The next thing we want to do is select an existing gallery
or create a new gallery. You’ll notice that by default a new
gallery will be created for you if there are no valid galleries
within the resource group. You can change this name by
clicking on the create new link, or you can find existing
galleries by clicking the dropdown where you can note
their resource group. The gallery and the image must be in
the same resource group, so in this case we have no
galleries in the resource group capture VM demo, so we’ll
stick with this new gallery.
Next is operate system state. Generalizing is a process
that removes machine and user specific data from the
virtual machine. When creating a VM from a generalized
image, you will need to provide information such as host
name, admin user, and other VM setup values. Since we
have run the commands on this virtual machine already to
generalize it, we will stick
with generalized. If you have not
run those commands or know that you want a specialized
image, you can go ahead and select this option.
The next step is image definition. The image definition
carries information about the image and requirements for
using it internally. This includes whether the image is
Windows or Linux, the VM generation, release nodes, and
minimum and maximum memory requirements. Since we
are creating a new gallery, we will need to create a new
image definition.
The required fields for an image definition include name,
publisher, and SKU. You’ll notice that operating system
type, Windows or Linux, and the VM generation, 1 or 2,
is automatically prefilled for you and disabled. That data is
pulled from the virtual machine. Publisher, offer, and SKU
values are also pulled from the virtual machine if they
exist. Let’s go ahead and
give this definition a name here.
Now back on this page, you’ll see that the name of my new
image definition is filled in for me.
The next step is to give the version a number. So in this
case, this is our first image in this gallery. So, we’ll give
this 0.0.1. We can choose to exclude this version from the
latest. We can give it an end of life date. For now, we’re
not going to fill in those fields.
Moving down to the
replication section, we can see a
default replica account set to 1. This means that one
instance of this image is
created in a region by default. If
you will be concurrently
creating lots of virtual machines
from this image, you may want to consider more copies of
this image available in a region. Let’s stick with one for
this case.
Next are the replication
regions. This is where you define
the regions this image should be available in. In order to
create a virtual machine from this image, the virtual
machine and image must be in the same region. In this
case, I can only create virtual machines from this image in
U.K. South, as this is currently set up. Let’s go ahead and
add an additional region of East U.S. 2. And we’ll leave the
default target replica account and the storage account.
Now we have completed our create image experience and
we can go ahead to the review and create.
After validation, we can then create this image.
Our image has been created and we have successfully
captured the VM. We can now go to the recently created
image using the go to resource button.
We land on the image version overview where you can see
the new gallery we created. You can also see the new
image definition that we created along with some
commands at the top and menu items on the left. In the
left menu item, one of them is update replication. Here
you’ll find the same grid that we had in the create
experience, where you can add or remove replicated
regions. For now, we’ll leave the replication as is.
Returning to the overview, we have commands for creating
a virtual machine and creating a virtual machine skill set.
Let’s take a look at creating a VM.
When we click on this command, we launch the create
virtual machine experience where now we have the
subscription, the resource group, the region, and the
image all prepopulated for
us. All we have to do is give the
virtual machine a name and we can quickly deploy virtual
machines with an image that we captured from a virtual
machine previously.
>> This was great, Devin. Thank you very much for
showing us.
>> Thanks, every one of you, for watching. Please try this
out, let us know what you think. Leave us a comment in
the comment section, follow us on Twitter, and look
forward to seeing you in the next video. Thanks for watching.