when it comes to updating your VMs in the cloud there's basically two choices
you can either patch VMs in place which is more of a traditional way of doing
things or you can focus on a rip and replace strategy of some kind where
you're going to roll out new systems and then throw the old ones away with that
in mind we want to build on a previous video that we had done on image
management and take our images into the new Azure portal and be able to use them
to more easily and automatically update our session hosts in our pools so that
we can stay as up-to-date as possible so in the past when I've shown how to roll
out new images I've used a custom template that I wrote which is up on my
github and that method will totally work however in the new azure portal there is
an even easier way to add new session hosts the limiting factor has been that
once you build that very first VM in that host pool the Add button will build
more of the same so you can't yet use that process to upgrade to new image
versions but with what we're going to cover today we solve that issue and get
you to the latest version of your images without having to do any extra work so
stick around for the next few minutes as we show you how to use the shared image
gallery to automatically update your wvd host pools
I'm Dean Cefola and this is the Azure Academy and the shared image gallery is
a service that helps us to build structure around our custom images in
Azure that allow us to scale up within a single region as well as scale out
across multiple regions now we have covered the shared image gallery
previously at the Azure Academy and I'll link that up at the top you can go check
that out if you miss that but today we're gonna focus on how we can use the
gallery with wvd so over in our azure documentation we'll scroll down just a
little bit and go to Windows virtual machines and over on the Left will go
into concepts and then go to images this is where you can find all the stuff
about the shared image gallery one thing that I'll call out for you is over here
on the right we'll click the link for limits when thinking about your virtual
machines at scale one shared image gallery can have 1,000 images and of
each of those thousand images we can have 10,000 versions and then each one
of those versions can have 10 replicas now how we end up deploying systems from
the gallery will have something else to do with a kind of scale that we can get
so the way that this would work today is you've gone through and built your
windows 10 multi-session image and you've configured it however you want to
and we've captured that image now and we have a shared image gallery in the cloud
so what we're going to do is we're going to take this image and inject it into
the shared image gallery and then when we do it's going to become an image
definition from that definition we will then create versions and each one of
those versions can have replicas when we store those in a particular region now
we can also scale out from there into multiple regions and that makes
deploying wvd anywhere in the world from the same image very simple now as you go
through your image management and update process you're going to then have a new
version of that image which we can replicate out just as easily and the wvd
admin portal will be able to spawn new VMs from that latest image version
automatically so here we have a virtual machine that I've configured with
multiple applications and other system settings now we're ready to capture it
and so I'm running the Sysprep and if you're unfamiliar with how this
process works you can go check out the video up here on the top where we
covered how to do image management for wvd back in the azure portal on the same
VM will now go to capture and we'll set the name of our image as wvd - new
portal - 0 5 that way we know which host pool this belonged to and what month it
was created we've got our resource group selected where we're going to store this
and we've checked the box to automatically delete the VM once we've
created this image and we'll go ahead and click create and there you can see
our completed image so if we click on that we should do a test deployment to
make sure that everything works and since we've done this several times
we'll just run through this real fast we'll just call it test image 1 and you
can see our image is pre-selected building B - MS and there's all of our
credentials we'll skip past the discs and go to the network building it on our
wvd network and we'll set up our boot diagnostics as well as add all of our
appropriate tags and then create and our VM is complete so let's go to connect
and we're able to login with no problem we're on the right BM all the
information looks correct and there's all of our apps so we can throw this VM
away now and as we're deleting all that stuff let's open our shared image
gallery and a first step is to add our image as a new definition file so we'll
be putting this in the east us we've got our image already named here as wvd -
wind 10 multi it is a Windows image and it's for VMs that our Gen 1 it already has
been generalized and we've got a publisher offer and SKU setup here for
our environment we'll click Next and now we need to add the version of this image
and we'll call it 0 5.0.1 because this is created in May and this is the first
iteration or our image source will select our Azure VM image that we've
just captured and we want to be sure that we do not exclude this from latest
we'll need that latest feature flag in order for this process to work and I'll
set your life first as the end-of-life date for this image version we'll scroll
down here is where we can set the different replica counts and replicas
are for the purpose of being able to scale
out how many vm's we can spawn from this image so the way that it works right now
is that you can create 20 virtual machines from a single replica at any
one time so if you wanted to build a hundred VMs at a time then you're going
to need five replicas but for my use case today I just need one so I'll click
Next and have filled out my publishing details here and you can fill that out
how that makes sense in your environment we'll scroll down for our VM deployments
and this is the recommendations when you deploy this image as to the system
resources that should be there for this workload what I want you to be able to
use anything from two CPUs up to 64 and with 8 gigs of ram up to 2 terabytes
building on a premium SSDs and I'm setting the end-of-life date for this
particular image definition to be the end of June and we'll hit next and then
add our tags and we'll hit the review and create button and everything looks
good so we'll create now that that process is complete we've got our new
image definition so we'll click on that and we can check out the particular
configuration that we had when we built it and of course we can change it if we
need to and under our image versions we've got our 05.0.1 image
and I'll click on that and from here we can create new VMs or VM scale sets over
on the Left we'll go to update replication and here's where you can
build out the number of replicas in your primary region as well as scale out into
multiple regions and notice that the maximum that you can go is 10 replicas
per region so just keep that in mind back in the wvd admin portal we go to
our host pools and we go to an existing host pool and then we go to our session
host and we click the Add button here this again is being locked by the
version of the image that we had spawned this from initially so you can't change
the image after you've built that first VM so we'll have to take a step back and
create a new host pool and since you're watching this video you can avoid that
by creating a host pool from your shared image gallery in the first place and
I'll put this in my new portal resource group and we'll call this host pool sig
- HP - 0 and sig stands for shared image gallery we'll make this a pool
post-poll with a 15 user max session limit in breath mode and we'll hit next
and we'll go to add a virtual machine here and we'll build our VM in the east
us since that's where our images aren't we'll build two VMs with the prefix of
SIG-WVD and we'll scroll down we'll come back to the image in a second we're
building this on our existing WVD network and we're joining to a specific
OU and we're leveraging our ad join account that has specific delegation
over that OU for the joining process scrolling back up to the image we have
basically two choices the gallery and storage blobs so if your V HD is sitting
in a storage account then you can get the exact URI for that image so that you
can reference it the way that I recommend that you be managing your
images is as official as your images that means you would take that VHD file
deploy a new VM from it and then capture that as a proper Azure image like we did
a few moments ago when you do that then you can use the gallery section now the
three images that are here in the gallery drop-down are part of the azure
marketplace image and that's how our other host pool was set up so how can we
reference our own custom images well we just click this link to browse all
images and at the top here we go to my items and we can see our image that we
captured earlier and under shared images there's our image in the shared image
gallery now the difference between using these two images is that this image much
like the azure gallery images is a fixed static version if you use those than the
session host that you're provisioning will always be from that particular
version of the image and at least as far as things are today
you can't update them with the shared image gallery there is a feature flag
that's part of using the image in the gallery that says that we're always
going to use the latest version of the image therefore all of the updates that
we make to the image in the gallery is then going to be reflected here in our
hosts pools and if you want to REALLY go do this at scale then you can do this
across multiple Azure AD Tenants
as well though several large enterprises manage multiple azure ad tenants with
lots of subscriptions you can actually span your shared image gallery across
all of them and go take a look at my original shared image gallery video for
how to do that I'll just click on our Windows 10 multi image here and we'll
click Next and we'll add a new workspace for this and we'll call up the SIG-WVD-WS
for workspace and then we'll hit next and add some tags and for those of you
who aren't using tags yet I gotta say you're doing it wrong tags are a way to
add extra information to your systems so that you can leverage that later either
in discovering costs finding specific applications that span multiple resource
groups or subscriptions and they can even be used for automation so if you're
not using tags you really should start and we've got a whole video series on
Azure governance to help you through that process you can go check that out
in the top right so we'll hit the review and create button and everything looks
good so let's hit create our session hosts have finished building and now
we're gonna log in and I've got my client open here with the user black
Adam we'll go to log on to that desktop and thanks to FSlogix our profile
loaded automatically and everything looks good so now what we want to do is
we want to create a new image version it will just go through and uninstall a few
applications just so we know that this is going to be a different version of
our image back in the wvd portal we go to session hosts we can see that we've
got an active session on number one here and we can see that is user black Adam
it will send him a console message and we'll hit OK to that and that instantly
pops up inside our session telling us it's time to log out but before we do we
go back to the portal and we'll go to the users section and type in black Adam
and we'll click on him and we can see our assignments and under sessions there
we can see that he's logged on to the m1 with ID number two you want to see
something cool we're gonna shadow that existing session of black Adam and this
is a normal function of the RDP tool where we use the /v to call out the IP
address or the DNS name of the system on a target with the shadow
and the session ID which is number two we just got that from the wvd portal and
depending on your group policy setup you can do this with no consent and now
you're watching my shadow session of the black Adam so whatever it is that he's
doing I can see what's going on that includes opening any kind of
applications or command prompts so anything that's going on we can now
observe which would allow us to help diagnose issues or we could just as
easily take control over the system depending on how your group policies are
set up and from the system that I'm shadowing from here you see I don't have
actual control over the system so that all depends on your group policy
configuration but the window does support dynamic resizing so that no
matter how big I make the window I can still see everything that I need to all
right so you can enjoy that one for free so if you'd like to see this feature
baked right into the WVD Admin Portal making this a lot easier to do go ahead
and leave me some comments down below and I'll be sure to pass them on to the
product group and just in case you're interested in what it looks like when
you request consent that's what it would look like to the end-user saying
whatever domain you're in your user name is trying to request access do you want
to accept or decline alright so the next thing that we need to do in order to
update our image version is we need to capture this through sysprep again and
that's located in the c windows system32 sysprep folder now we want to run this
as administrator and we're gonna set it to generalise and then shut down which
kind of takes us full circle here and that process will be done in a moment
and then we'll capture it as our new image let's go into that virtual machine
and we'll just boot this out of our pool all right and with that cleaned up we'll
go back to our virtual machines and we'll take VM one where we were logged
into and hit our capture button just like we did in the beginning we'll give
it a name sort in a resource group check the box to automatically delete the VM
this time we're gonna store it as a zone redundant image and then we'll hit
create and with the capture process complete we're now ready to add our new
image version so we'll click on our image definition and then over on the
left we'll go to image versions and we'll add
a new version we'll select the region where our image is located this will be
the zero 5.0.2 image and then we'll select the azure VM image that we just
created again we do not want to exclude this as the latest set the date for the
end of the image life to be August and we'll scroll down we just need one
replica at this point and we will make this zone redundant and hit next and the
default encryption is fine with me and if you are interested in us doing a new
video on disk encryption because there are some cool new features give me some
comments down below and we'll be happy to do that well it next and add our tags
and then hit next and we'll create our new image version tag in the shared
image gallery now we've still got our single image definition we click on that
and then on the Left we go to our versions and there is our new version
back in the wvd admin portal we'll go back to our hosts pool and we'll click
on our sig wvd and we'll go to our session hosts and at the top we'll click
to add a new host and since we're adding a new host to an existing pool these
settings are already chosen for us and we'll hit next and we'll just provision
one new VM and notice again that these settings around the image cannot be
altered but that's ok because the shared image gallery is gonna pull the latest
version of that image and the rest of the settings here are exactly the same
as they were before but we'll click Next and add our tags and we'll hit the
review button to validate everything it all looks good so let's hit create back
in our hosts pool we've got our second session host registered and just to be
sure that we log onto the right machine we'll change the drain mode on our 0
machine to on and I've reopened the wvd client and I'm logged in this time with
the user Nova and we'll launch our SIG VM and there you can see our sign in details
we're logged on to the SIG-WVD-1 VM and our add/remove programs shows all of the
appropriate apps so we are definitely working with the latest version of our
image so I hope you've enjoyed looking at this quick video on how we can update
our host pools automatically with the latest version of an image
using the shared image gallery definitely a way to help you not only
manage your images but also to scale your WVD instances whether that's more
instances per region or you need to scale out to multiple regions so if you
thought that this video was good or learned something new go ahead and hit
that thumbs up and let me know that you appreciated that and if you have a
question about this or anything else around Azure go ahead and leave us a
comment down below and while you're down there if you see a question that's being
asked and you know the answer feel free to respond to it we're all just here to
help each other learn about Azure and while you're down there go ahead and
click that subscribe button if you haven't done so already and join us here
in our community and if you want to get a email when our new videos come out
which is about once a week you can click that email notification bell as well and
we have been premiering our videos so you can join us for watching the live
premiere at midnight on Mondays Eastern Time and I'll be happy to chat with you
as we're watching the new premieres and if you're looking for something more to
help you keep learning about Azure check out our newest video over here on the
right as well as a video we picked out just for you down here at the bottom and
thanks for joining us for today's video and we will catch you in the next one
happy learning