Skip to content

BidGithub2022/OpenShiftVirtualization

Repository files navigation

OpenShift Virtualization

Contents


Defining File System Configurations for VM:

Create the rhel9 guest image:

Screenshot 2024-04-03 at 6 12 32 PM

Screenshot 2024-04-03 at 6 15 34 PM

Screenshot 2024-04-03 at 6 18 08 PM

Screenshot 2024-04-03 at 6 18 59 PM

Screenshot 2024-04-03 at 6 29 29 PM

Download the qcow2 image to your local system once ready:

Screenshot 2024-04-03 at 6 34 24 PM

Copy the image to your working server

Screenshot 2024-04-03 at 6 37 31 PM

Compress the qcow2 image for faster performance:

Screenshot 2024-04-03 at 6 41 04 PM

Login to OCP cli:

Screenshot 2024-04-03 at 6 47 16 PM

Use below command to upload the image:

virtctl image-upload dv rhel9-with-fs --size=30Gi --image-path=/home/bsahu/composer-api-37841dfb-f81c-4a11-be2f-e463f59dcf29-disk.qcow2.gz --force-bind --storage-class=lvms-vg1 --access-mode=ReadWriteOnce --insecure

Screenshot 2024-04-03 at 6 58 59 PM

*** I was using 4.15 OCP and topolvm.io as my storage class and was getting "Data Volume failed to initiate upload" while doing through the OCP console. Checked with experts and got to know that "since TopoLVM is WaitForFIrstConsumer, I suspect the issue is that there is no consumer and thus the volume won't bind and the pod won't start". The suggestion was to use "--force-bind" flag.

You will see PVC , PV and cdi-upload pod status on OCP console:

Screenshot 2024-04-03 at 8 05 25 PM

Screenshot 2024-04-03 at 8 05 37 PM

Screenshot 2024-04-03 at 8 05 46 PM

Create a VM:

Virtualization -> VirtualMachines -> Create from Template -> Select rhel9 -> Customize VM -> Select Disk -> Edit rootdisk -> Use existing PVC -> Create VM

Go to Scripts and update the cloud-init data to initialize with your specific username.

Screenshot 2024-04-03 at 7 00 36 PM

Screenshot 2024-04-03 at 7 11 12 PM

You will see PVC , PV and virt-launcher pod status on OCP console:

Screenshot 2024-04-03 at 7 12 40 PM

Screenshot 2024-04-03 at 7 13 02 PM

Screenshot 2024-04-03 at 7 13 11 PM

You will see VM is running.

Screenshot 2024-04-03 at 7 13 59 PM

Login to console and check the rhel version and file system:

Screenshot 2024-04-03 at 7 16 01 PM

File system on console:

Screenshot 2024-04-03 at 7 17 28 PM

Resource usage of VM:

Screenshot 2024-04-03 at 8 07 59 PM

Links to refer:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/creating_customized_images_by_using_insights_image_builder/index#proc_creating-a-customized-rhel-guest-system-image-using-image-builder_assembly_creating-a-customized-rhel-guest-image-using-red-hat-image-builder

https://docs.openshift.com/container-platform/4.15/virt/getting_started/virt-using-the-cli-tools.html

https://docs.openshift.com/container-platform/4.15/cli_reference/openshift_cli/getting-started-cli.html

https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/creating_vms_custom/virt-creating-vms-uploading-images.html

Windows VM

This is a 3 mins video which will walk you through creating an windows VM: https://youtu.be/Kty3hUBwk54

Supported and Certified guests: https://access.redhat.com/articles/973163#thirdpartyguests

Automating Windows VM creation with OpenShift Virtualization: https://www.youtube.com/watch?v=-xBSW8bNb-U

Creating a Golden Image for Windows VMs in OpenShift Virtualization: https://www.redhat.com/en/blog/creating-a-golden-image-for-windows-vms-in-openshift-virtualization

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published