This step is to create VM Disk image using Kubevirt, this is a one time activity to create bootdisk, install required drivers and ensure SR-IOV is enabled on guest VM images. Once after disk image is created, image can be used for deployment of guest VMs
Manifest is provided in sample-application/create-bootdisk/manifest/vm1.yaml
Pre-requisites:
- Windows 10/11 ISO
- Virtio ISO for drivers
- Latest Intel GPU & Zero Copy drivers - Create ISO file with the drivers / Download directly on VM when Ethernet driver is installed and VM is able to connect to internet
- Convert the ISO files to RAW disk image
qemu-img convert -f raw -O raw file.iso disk.img
- Place the RAW disk images derived from above ISO files in these locations
Image PersistantVolume Name Path to store RAW disk Image Windows ISO cdisk-vm1-iso1-pv /opt/disk_imgs/iso/os-iso-disk/disk.img Virtio ISO cdisk-vm1-iso2-pv /opt/disk_imgs/iso/virtio-iso-disk/disk.img Drivers ISO (If ISO is created) cdisk-vm1-folder-pv /opt/disk_imgs/iso/drivers/disk.img Note: size of VM image is set to 60GB by default, edit storageparameter invm1.yamlundercdisk-vm1-bootdiskto change it - Primary display considered in manifest is HDMI-1, hence deploy the Sidecar configmap of HDMI-1 and then apply manifest
kubectl apply -f sample-application/discrete/sidecar/hdmi1.yaml kubectl apply -f sample-application/create-bootdisk/manifest/vm1.yaml
- Now you should see prompt to install OS on HDMI-1, now continue installation
- Refer Multi-OS with Graphics SR-IOV Virtualization on Ubuntu User Guide PDF Section
5.2.1 Windows* Guest VM Manual Setup- Note: Use the latest Intel GPU and Zero drivers from link mentioned in Pre-requisites section
- Continue from Section
5.2.1.2 Create Windows Guest VM Image from ISO>Step 2 Follow the Windows installation steps until you see the Windows Setup screen. - And complete installtion till
Section 5.2.1.12 Resume Windows Update
- Once after OS installation is complete, shutdown the VM, remove the manifest
kubectl delete -f sample-application/create-bootdisk/manifest/vm1.yaml kubectl delete -f sample-application/discrete/sidecar/hdmi1.yaml
- Copy the
disk.imgfrom/opt/disk_imgs/create-vm-bootdiskto desired location to deploy
Pre-requisites:
- Ubuntu 22.04/24.04 ISO
- Convert the Ubuntu ISO file to RAW disk image
qemu-img convert -f raw -O raw file.iso disk.img
- Place the RAW disk images derived from above ISO files in these locations
Image PersistantVolume Name Path to store RAW disk Image Ubuntu ISO cdisk-vm1-iso1-pv /opt/disk_imgs/iso/os-iso-disk/disk.img - Primary display considered in manifest is HDMI-1, hence deploy the Sidecar configmap of HDMI-1 and then apply manifest
kubectl apply -f sample-application/discrete/sidecar/hdmi1.yaml kubectl apply -f sample-application/create-bootdisk/manifest/vm1.yaml
- Now you should see prompt to install OS on HDMI-1, now continue installation
- Once after OS is installed, ensure internet is available and set the proxy if required.
- Open a
Terminalin the guest VM. Run the command shown below to upgrade Ubuntu software to the latest in the guest VM.# Upgrade Ubuntu software sudo apt -y update sudo apt -y upgrade sudo apt -y install openssh-server - Copy setup_bsp.sh to home directory of Ubuntu Guest
- Run
./setup_bsp.shin Ubuntu guest VM. Please be patient, it will take a few hours# in the guest cd ~ sudo chmod +x setup_bsp.sh sudo ./setup_bsp.sh -kp 6.6-intel
- Do reboot, after rebooting, check if the kernel is the installed version.
Output
uname -r
6.6-intel
- Verify SR-IOV is enabled
Output
sudo dmesg | grep SR-IOV[6.026008] i915 0000:00:02.0: Running in SR-IOV VF mode - Once after OS installation is complete, shutdown the VM, remove the manifest
sh kubectl delete -f sample-application/create-bootdisk/manifest/vm1.yaml kubectl delete -f sample-application/discrete/sidecar/hdmi1.yaml - Copy the
disk.imgfrom/opt/disk_imgs/create-vm-bootdiskto desired location to deploy