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

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래