Creating virtual machines (VMs) from golden images is a common practice. It minimizes the deployment time for new VMs and provides a familiar environment for the VM's owner. The admin benefits from creating golden images in an automated manner because it reflects the current configuration.

This blog post will show how to deploy KubeVirt Tekton tasks with example pipelines and how to run the windows-bios-installer pipeline. Prerequisites for this post are OpenShift (version 4.13), OpenShift Pipelines, and OpenShift Virtualization (version 4.13).

OpenShift Pipelines provides automation to create golden images for Windows VMs in OpenShift Virtualization.

Since this integration of OpenShift Virtualization with OpenShift Pipelines is still in tech preview, the OpenShift cluster administrator must enable it. Here's the command:

oc edit hco -n openshift-cnv kubevirt-hyperconverged

Set the spec.featureGates.deployTektonTaskResources field to true:

apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
spec:
featureGates:
  deployTektonTaskResources: true

 

After the deployment succeeds, three example pipelines exist.

The example pipelines can be found through OpenShift administration under the Pipelines tab in the openshift-cnv namespace. Each pipeline can be triggered by clicking on the Options menu on the right side of the screen and then selecting the Start button. This starts the pipeline window, where the user must insert a URL to the Windows 10 ISO file.



Other pipelines will be described in a follow-up blog post. The  windows-bios-installer pipeline shows how to create your own Windows 10 golden image with VirtIO drivers installed in the OpenShift cluster. The pipeline's only required parameter is a URL to a Windows 10 ISO file; all other parameters have default values, which can be changed.

In addition to the pipeline, an example sysprep answer file named autounattend.xml is deployed in a config map. This answer file works with Microsoft's Windows installation multi-edition ISO for English United States and x64. Users can apply their own customizations to the Windows image with the sysprep answer file, as seen here

The pipeline consists of multiple steps:

  • Downloading the Windows ISO into a PVC
  • Creating a virtual machine that uses the sysprep answer file to install Windows
  • Copying the resulting disk image into the default Windows 10 boot source of the cluster

The result of this pipeline is a DataVolume in the openshift-virtualization-os-images namespace. When a user wants a new Windows 10 VM, the VM will be created from this DataVolume without any additional configuration required.


 

Wrap up

You have seen how to use a sample pipeline to automatically deploy golden VM images in an OpenShift environment. Golden images are a critical part of deploying consistent and current VMs. Automating this process helps maintain that consistency.


关于作者

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Virtualization icon

虚拟化

适用于您的本地或跨云工作负载的企业虚拟化的未来