 This video will focus on creating a Windows Server 2019 template to be used for creating additional virtual machines and OpenShift virtualization. Please note that this process will be the most labor intensive of creating templates. We're doing this the long way, the hard way if you will, in order to show that it is possible. However, keep in mind that there's a lot of other tools and a lot of other ways to do this that make it much simpler and much easier. The first thing that we need to do when provisioning a virtual machine or a new template in this instance is to upload the ISO that we'll use to install the operating system. We do this by browsing to the persistent volume claims. We'll click this, create with data upload form. This will utilize the containerized data importer or CDI to upload the disk from my local system into a persistent volume claim. The first step is to choose the disk that we're going to use. We see here I have a Server 2019 eval ISO that I'm going to use. I'll give it a very simple name, ISO-Server 2019, so I can identify it. We'll give it a size. The size is not particularly important so long as it is large enough to hold the ISO. Then the access mode and file system down here, if I need to choose those or change those from the default for my storage class. After clicking the upload button, the containerized data importer is going to request the PVC. We'll wait for our CSI provisioner to create the volume. It will then create a pod and that pod will be used to upload the data from my system into the persistent volume claim, which is the process going on now. I'll accelerate this process so we don't have to wait for it to complete in the video. With the ISO uploaded to a PVC, we can now continue with the process. To quickly review, we now have a PVC named ISO-Server 2019 that contains the disk that we want to use to provision new virtual machines. Next step is to provision a virtual machine, a 2019 Server 2019 virtual machine using that ISO. These templates provide a lot of hints and a lot of configuration to the underlying KVM utilized by OpenShift Virtualization. We want to choose a template here that matches the operating system we're going to be installing. When you use this Server 2019 VM template, even though I don't have a source here, I can still choose to create a virtual machine based off of it and provide my own source. Here I'm going to boot by cloning an existing persistent volume claim. I will point it to the PVC that we just created, ISO-Server 2019, and we do want to mount the CD-ROM as a boot source. I'll customize this virtual machine. I'm going to give it a name in this instance, TMPL or Template Server 2019. We do need to mount the Windows guest tools. We will need access to those for drivers etc. when we install the operating system. I'm going to keep the default flavor one CPU, four gigabytes of memory as well as the default workload type. If I need to change the networking, we can see here that it defaults to using the pod network. If I want to connect it directly to an external layer two for example a VLAN interface, I can do that from here and I can modify the disk information. Notice that we have three disks available here. The first one, root disk is going to be the CD-ROM that we are cloning from that PVC. We then have the Windows guest tools down here at the bottom, and in the middle we have the disk that will actually be used to install the operating system. Now I can modify some information for this by clicking Edit. For example, if I want to select a storage class, you can see that lab-silver is default, so it would automatically be used even if I hadn't selected it. I'm going to do things like change the size, etc. I'm going to change the name of this disk to make it a little bit easier to identify. You can see I'm just using TMPL Server 2019 disk. We do want to ensure that the boot source here is selected as the root disk, which is our ISO, our Server 2019 install ISO. I don't need to provide any additional information at this point, I'm going to click Next. We do want to start this virtual machine after it's created, so we'll leave that checkbox there, and we will go ahead and review our virtual machine. Now see that it is stuck in this, or it is currently in this importing process. Now what's happening here is in behind the scenes, containerized data importer has cloned that ISO PVC, and it has attached it. We have also waited for it to provision the second, the OS install disk. It has provisioned that disk as well. And now the virtual machine has been scheduled and is running. If we come over here to the console, we'll see it going through the bootup process. I'm going to click this open console in the window so that we have a dedicated tab specifically for our Server 2019 install. So I'm going to step through the install process here. More or less, we're going to accept the defaults until we get to the point where it wants us to select a disk to install to. At that point, we will leverage the Windows tools ISO that has been attached to the virtual machine to then choose which one of the, or to choose a driver for the disk. Notice I am choosing the desktop experience. This is simply for illustrative purposes. It's easier to interact with a GUI than it is to do things on the command line for Windows. But you can absolutely use Server Core, Server 2019 Core if you want to for your templates. Now notice here that there are no disks listed as available for B4 installs. I need to load a driver to do that. Going to click load driver and then browse. I will choose this VertIO Win ISO that is attached. In the first directory AMD64, I'll choose the folder for 2K19 because I'm using Server 2019. Once doing that, we have two drivers available, the SCSI controller and the SCSI pass-through controller. We're not using pass-through, so I'll select the top one. After a moment, it will load the driver, rescan the drives, and it will offer that 20 gigabyte disk that we attached through the GUI a few moments ago. With that, I'm going to click next to begin the Windows installation process. This will take a few minutes, so I'm going to accelerate the video. After the installation process is completed, we'll finish the out-of-box experience and log into the server. Once logged in, we'll finish installing the remainder of the QMU drivers and other integration tools. We do this by selecting the VertIO Win CD drive just as we did during the installation process. On this drive, we have the VertIO Win guest tools. We'll select the 64-bit version since this is a 64-bit version of Windows. We're going to choose the default throughout this process. I will accelerate it so that we don't have to wait on the install. With that complete, we can now perform a sysprep of the system so that it can be used for a template. We'll close these other windows. We're going to browse to the start menu, select Windows System, and then right-click on the Command Prompt option. Once right-clicked, we will select More, Run as Administrator, and then execute the sysprep process. This sysprep process will take a moment or two to finish. I will accelerate that, after which the virtual machine will shut down. I'll close this console window. I want to see when the virtual machine shuts down here. I did not change the run strategy for this virtual machine, which means that when the guest shuts down, OpenShift will automatically restart it. It does not know that it is supposed to be shut down. It thinks that it should be running at all times, so we just need to catch it and not let it restart the virtual machine. Also note that during this sysprep process, I did not specify an unattended.xml or other customization options to be used with the sysprep. You can absolutely take advantage of that if you need to do things like set other passwords, create other users, domain membership, licensing, KMS, so on and so forth. We're just not doing that for this particular template. So at this point, we're done with this template virtual machine. We have installed Windows, we've sysprepped it, it's ready for the disk to be used for additional VMs. So I'm going to go ahead and delete the virtual machine. However, I want to make sure to uncheck this box to delete the disk along with the virtual machine definition. We can browse to our storage and persistent volume claims. When we look at these PVCs, we see two additional ones that were just created. One is the root disk. This was the clone of our ISO PVC. We can go ahead and remove that one. The other one is the server 2019 template disk. This is the one that we want to use. This one will be used for the image of any additional cloned virtual machines based off of the disk. The next step is going to be creating a custom template for our virtual machines. Now, I could modify this. I could add a source to our server 2019 VM template here. What will happen then is I will choose the PVC that we just created and the background Openshift virtualization will copy that data. It will clone that data into a specific namespace into the OS image template namespace. When we then create virtual machines based off of that template, it would copy that data into the new disk. There's nothing wrong with this process. It just takes a little bit longer. Instead, by creating a custom template and pointing it to the PVC in the same namespace, we'll be able to take advantage of CSI clones of that source PVC. This will be much faster when we create additional VMs in the future. To use that process, we'll select the three-dot menu over here and we'll select Create New Template From for our Windows Server 2019 VM template. We'll give our template a name. I'm going to very simply call this Temple Template Server 2019. The provider here I'm going to provide is my organization name. This can be any arbitrary value. We do want to keep the operating system set to Server 2019. However, we do not need to mount the Windows guest tools. We did that when we installed the operating system before. Next, we'll select the boot source, which is to clone an existing PVC and we will select the PVC that we created a moment ago. This is our template Server 2019 disk. We can choose a default flavor to be used with this template, along with workload type. I'm not going to modify those. We can modify the network interface that will be associated with virtual machines created for the template. Again, I will keep this connected to the pod network. And my disk, I will keep connected a 20 gigabyte disk connected to the lab silver storage class. Don't need to provide any customization here. And last but not least, we review and create the template. At this point, when I come down in my template list, I see we see we have this template Server 2019 that was just created. This time I'll select create on this option. This will create a virtual machine based off of this template. We'll change the name here. We're using notable alligator, the generated name. And from here, we simply create virtual machine. Now the reason for creating the template that way was so that we could do CSI clones. We can see that our virtual machine is already up and running. If I select notable alligator here and I select the console, we see that Windows is booting. Now this will go through the out of box experience is going to set up a few things. So I'm going to accelerate this first boot for the virtual machine. Okay, the first boot is complete. We now complete the out of box experience for Windows Server 2019. Again, you could choose to automatically answer these using an unattended.xml file if you wanted to. You can also attach that unattended.xml through a secret or a config map so that it can be read during the initial setup process. You can attach those dynamically when the virtual machine is created. Just as before, we'll quickly log into the virtual machine using the password that we just set and see that it is a unique instance. This video has demonstrated how to create a Windows Server 2019 template by installing the operating system using an ISO to a new virtual machine and then converting that virtual machine into a template. Thank you for watching and please keep an eye out for additional videos on OpenShift virtualization in the future.