MIKE COLEMAN: Hi I'm Mike Coleman, a developer advocate
here at Google Cloud.
In this video, I want to walk you
through how you can use Google Cloud's Migrate for Anthos
to move some of your existing Windows workloads
from virtual machines to containers in just a few steps.
This video builds on an earlier one,
introducing Migrate for Anthos.
If you haven't checked that video out yet,
definitely go do so, as this one assumes
you performed the prerequisites we outlined there.
At the end of the last video, we had set up our service
accounts, enabled the necessary APIs,
and created a processing cluster.
Before we can do the actual migration,
we need to complete a couple of Windows-specific prerequisites.
We need to add a Windows node pool to our processing cluster,
and ensure we have a Windows Build VM.
We need the node pool to ensure that we can
analyze Windows applications.
And unlike with Linux applications,
there isn't an automated container
build step with Windows apps.
Migrate for Anthos will create a Docker file,
but you will need a VM on which you
can do the actual Docker build as well
as push the resulting image up to the Google Container
Registry.
So let's set both of those up.
I've logged into the Google Cloud console,
and I'm ready to get started.
So I'll click on Processing Cluster.
I'll go ahead and add the node pool.
We're going to go with one node.
So let's click that there.
Come over here, we're going to change this
to the Windows semiannual channel release,
so we'll click Make Changes.
I want to come down here and I want
to use an N 1 standard 4 as my machine for the node pool,
and we'll come down, and then for security, I
want to make sure that I have full platform access,
and we'll click that, and then we'll click Create.
And that will add the node pool.
So next thing I want to do is I want
to add the machine that I'll use to build my Docker images.
So we're going to come up over here,
and we're going to click on Compute Engine, Virtual Machine
Instances, we'll do Create Instance.
We'll call the machine Win Build 1.
We're going to put it in the US West 2A region,
we're going to use an N 1 standard 4,
and we'll use Windows Server 1909 Data Center Edition.
We want to come down here and ensure we have full platform
scope again, and we'll click Create,
and that will go off and create our build machine.
With those additional prerequisites set up,
let's jump into using Migrate for Anthos
to migrate a Windows application.
As a brief recap, Migrate for Anthos
has three primary components.
The first is the discovery tool, which
assesses how successful a migration of a given
application might be.
Next is the processing cluster, a kubernetes cluster
that is used to examine the source VM
and create the migration plan, as well as execute
the actual migration.
And finally, migctl, a command line tool,
like kube ctl, for interacting with the processing cluster.
We'll do most of our work in the console today,
but I will show you a bit of migctl.
And again, to quickly recap, a migration
generally consists of the following steps.
Creating a Google Cloud project, setting up service accounts,
and enabling the appropriate APIs,
creating migration processing cluster and a build
VM in the case of Windows, choosing and qualifying
your workload, defining your migration source,
creating a migration plan, and adjusting the migration plan
to ensure it meets your needs, creating the deployment
artifacts, and deploying the newly containerised
application.
We now have the first two items.
So let's jump into how you can choose the right application.
The first thing to consider is which
operating systems IIS and dot NET versions can be migrated.
We migrate Microsoft Windows Server 2008
R2 or higher, Microsoft IIS 7, or higher web applications,
and ASP.NET and dot NET framework versions
3.5 or higher.
It's important to note that after Migration,
the resulting container will run Windows Server version 1909.
In addition to specific versions of the operating system or app
stack, the following application characteristics
make them unsuitable for migration.
Applications with dependencies on GPUs or TPUs,
applications with low level networking requirements,
desktop, RDP, and VDI applications,
and applications with bring your own licensing.
In order to help determine if an application is a good fit,
we have the Application Discovery Tool.
The tool outputs a zip file that indicates whether or not
the Windows VM is a potential fit for Migration.
The name of the file indicates the results.
The zip file includes multiple files
with information on the operating system settings, IIS,
odbc config, and the global assembly cache.
I'm not going to go into the zip file contents in depth,
and would encourage you to check out the docs
if you need more information.
Let's take a look at the Migration tool in action.
But before we do that, I want to give you
an overview of the application we'll be migrating.
This is a simple ASP.NET application.
It's got this webfront end running
on IIS that connects back to a Cloud SQL instance.
So if I click on Courses, you can
see a bunch of courses come up.
Those are being pulled out of the Cloud SQL database.
The virtual machine is right here.
It's called Cymbal University, and that's
what we're going to migrate.
I've already set up an RDP session into that box,
so we'll move into that now, and I've
installed the Migrate for Anthos migration tool.
You can see it right here, collect info dot exe.
So I'll hit Enter, and we'll run that tool.
It's going to go through, it's going
to collect a bunch of system information.
That's going to take a little bit,
so I'm going to fast forward the video,
and I'll rejoin you in a second.
So the tool is finished, and if we look at the file name here,
it doesn't say no fit, which means
we actually do have a fit.
So our application is good to go,
and should be an easy migration.
We have completed our prerequisites,
and our application is a good fit.
So at this point, we're ready to go ahead and create
our migration source.
Before we start creating actual migration,
I just wanted to review a couple of points.
First, a Windows instance can only
be migrated from a Compute Engine instance.
So that's what we've got going on here.
We've got Cymbal University on a Compute Engine VM.
The second thing is, you cannot migrate a VM until you stop it.
So I'm going to come over here to Cymbal University,
I'm going to select it, and I'm going to click Stop.
With the VM stopped, I can now go
to Migrate to Containers here in the menu,
and start the migration process.
We added our processing cluster earlier, so here it is.
It's in the UI.
Now we're going to add a migration source.
So I'm going to click Add Source,
I'm going to select that processing cluster, click Next,
give it a name.
Windows Migration Source.
It's going to come off Compute Engine.
Click Next.
And now, we're going to create a service account.
So we can have this done automatically for us.
The service account is going to have the viewer and the storage
admin roles assigned to it.
So we'll go ahead and click Next.
And Add Source, and that will add our migration source.
The source is now ready.
It can handle Windows and Linux workloads.
So let's create the actual migration.
Click Create Migration, come in here,
give the migration a name.
We'll call it Windows Migration.
Select the source that we just created from the dropdown,
select the operating system as Windows,
and then type in the name of the virtual machine
that we're going to migrate, which was Cymbal University.
We'll come down here and we'll click Create Migration.
That's going to start the creation of the migration plan,
and that's going to take a few seconds.
So let me go ahead and fast forward the video,
and I'll rejoin you when that's done.
OK, the migration plan has been generated.
And the next step here would be to review and edit
that migration plan.
So we come in and we take a look at it.
We're not actually going to edit it.
We're not going to spend a lot of time here.
I'll just point out some highlights.
You can see here we're running a dot NET 4 5
classic application, here's the web
route directory, information like that, port 80.
So all of that looks good.
So let's go ahead and save that and generate our artifacts.
Now, this is going to go out and create our Docker file.
Again, this is going to take a couple seconds,
so I'm going to go ahead and pause the video,
and I'll rejoin you when it's finished.
The artifacts have been generated,
and those are actually stored in a Google Cloud Storage bucket.
And there's a couple different ways you could get at them.
You could go to the bucket directly,
or you can actually use migctl to give you the location,
and then copy the file down.
And that's what we're going to do.
So I'm going to open up a Cloud Shell,
and I'm going to issue that migctl Get Artifacts command,
and point at the migration we just did,
and that's going to give me the command that I need to run.
So I'm going to copy that command, gs util cp,
gs util copy, and we're going to run that in our Windows
build machine where we're going to build our Docker image.
So let's run that copy command, and that's
going to bring down the artifacts dot zip
file, so it's been copied.
Let's look at the directory and make sure it's there.
Clear the screen, and we'll do a DIR,
and there's our artifacts file.
So let's expand that archive to get to the Docker file.
So Expand Archive, artifacts dot zip,
hit Enter, archive will get expanded out,
and we will have our Docker file.
All right, let's clear the screen.
Let's take a look at that artifacts directory
to make sure we got our Docker file.
So do the directory, and there's the Docker file.
So now let's issue our Docker build command,
and tag it so it can be pushed up to Google Container Registry
after the build is finished.
So we'll go ahead and get that build done.
There it is, it's been tagged and ready to get pushed up
to the Container Registry, so let's do that next.
So we'll clear the screen, and we'll
issue the Docker push command.
And that will push it up to Google Container Registry.
This is going to take a few seconds,
so I'm going to fast forward the video,
and rejoin you when it's done.
As that gets pushed to your Container Registry,
the next thing to do is to actually deploy it
to our production cluster.
So I've got two clusters, a processing cluster
and a production cluster, and I'm
going to go into Cloud Shell and I'm
going to log into my production cluster.
And then, to make sure I am on the right cluster,
I'm going to do a get nodes, and make sure
that I see all the nodes of my production cluster, which I do.
So now let's take a look at our deployment yaml,
and you can see nothing special here.
I'm deploying that Container Registry image
that I pushed up earlier, and so let's go ahead and do that.
kube ctl apply minus F, symbol deployment
dot yaml will create my kubernetes deployment.
So give that a minute to settle down,
and then we'll check the status here.
Clear the screen.
And let's check and see if our pods are there.
And there's our pod.
Check our deployments.
And the deployment is there.
Now let's go ahead and expose that deployment
behind a load balancer.
This will take a couple seconds.
I'm going to pause the video and I'll rejoin you
when it's up and running.
All right, let's do a kube ctl get services,
and that will list out the IP address of our load balancer,
so we're going to grab that IP address,
we're going to come up here into Chrome and open a new tab,
paste in that address, click there, paste the address in,
and that will open the Cymbal University website.
So let's hit Enter.
There's the website.
Let's click Courses.
We're still connected to our database,
and if I go back into Google Cloud platform,
and I look at the VM instance, I'll
see that it's still stopped, meaning
that I am in fact serving my application now
off of the kubernetes cluster, out of that container.
So there you have it.
In this video, you learned about using Migrate for Anthos
to move Windows workloads into containers, including
how to assess your application, create the migration plan,
execute the migration plan, and deploy your newly
containerised application.
Be sure to like and subscribe because we'll
be posting subsequent videos in this series
to cover topics such as best practices
for evaluating your applications,
how to migrate Linux workloads, and more.
And to get started on Migrate for Anthos today,
visit Cloud.Google.com/Migrate/Anthos.
[MUSIC PLAYING]