Manage Portworx RWX Block Volumes on SUSE Virtualization for KubeVirt VMs
This page provides step-by-step instructions for managing Portworx RWX block volumes with KubeVirt virtual machines on SUSE Virtualization.
RWX block volumes allow shared access to raw block devices, enabling features such as live migration, high availability, and persistent VM storage across SUSE Virtualization nodes.
Portworx RWX block volumes are intended only for the KubeVirt VM use case. For other scenarios, contact support before deployment.
Portworx does not support the following configurations when using shared raw block volumes for KubeVirt VMs:
- Synchronous disaster recovery
- Asynchronous disaster recovery for virtual machines (VMs) on Portworx raw block volumes that were migrated from another environment, such as VMware
Prerequisites
- An operational SUSE Virtualization cluster.
- Portworx Enterprise version 3.3.0 or later.
- Portworx Operator version 25.2.1 or later.
- Portworx Stork version 25.2.0 or later.
- Administrative access to the SUSE Virtualization dashboard and the underlying Kubernetes cluster.
- Review the known issues before proceeding.
Create a StorageClass
Create a StorageClass if one does not already exist. The following is an example StorageClass.
-
Create the
px-kubevirt-sc.yamlfile:StorageClassapiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: px-rwx-block-kubevirtprovisioner: pxd.portworx.comparameters:cdi.kubevirt.io/storage.contentType: kubevirtrepl: "3"nodiscard: "true" # Disables discard operations on the block devicevolumeBindingMode: ImmediateallowVolumeExpansion: true -
Run the following command to apply your StorageClass:
kubectl apply -f px-kubevirt-sc.yaml
Create a PVC
-
Using the above StorageClass, define a PVC with the following configuration:
accessModes:ReadWriteManyfor shared volume access.volumeMode:Blockto create a raw block device volume
PersistentVolumeClaimapiVersion: v1kind: PersistentVolumeClaimmetadata:name: rwx-disk-1labels:portworx.io/app: kubevirtspec:accessModes:- ReadWriteManyresources:requests:storage: 100GistorageClassName: px-rwx-block-kubevirtvolumeMode: Block -
Apply this PVC to your cluster:
kubectl apply -f pvc.yaml
When deploying KubeVirt VMs, reference the PVC created in the previous step to attach the Portworx RWX raw block volume to the VM. Ensure the VM configuration specifies the correct StorageClass and volume.
Once the VM is running with the specified PVC, you can perform live migration using SUSE Virtualization’s native functionality. The shared RWX volume ensures data consistency during the migration process by allowing simultaneous read/write operations for the source and destination nodes.
If you are manually creating a PVC and attaching it to a VM, ensure the following:
- Add the
portworx.io/app: kubevirtannotation to the PVC spec. This ensures that Portworx will apply KubeVirt-specific logic when processing the volume. - Maintain the same HA or replication factor for all volumes associated with a VM.
VM configuration guidelines for Portworx raw block volumes
When using Portworx RWX block volumes VMs, specific configurations are required to ensure compatibility and performance. The following guidance outlines considerations for root and data disks, block sizes, and bootloaders.
Block size and bootloader compatibility
The VM disk configuration defaults to a 512-byte block size. The hypervisor makes it compatible so that 512-byte operations work over a provisioned Portworx storage disk with a 4096-byte block size. Therefore, no changes are needed because block size compatibility is ensured.
- Portworx block volumes always use a 4096-byte block size.
- VM disks default to a 512-byte block size unless otherwise specified. Specifying a logical block size of 512-byte and a physical block size of 4096-byte in the VM disk specification is an optional configuration detail within the VM that may help applications or file systems optimize performance, if supported.
- VM root disks also contain a bootloader, which can be either EFI or BIOS. BIOS supports booting only from disks with a 512-byte block size. EFI supports booting from disks with either a 4096-byte or 512-byte block size. They are independent bootloading mechanisms. The root disk configuration determines which bootloader is used.
- You can identify the root disk configuration by examining the QCOW2 image or the disk partition table.
- EFI requires an EFI system partition, a GPT partition table, and related components.
- BIOS requires a partition marked as bootable.
- For example, RHEL configures its QCOW2 cloud images to boot using both EFI and BIOS by creating two partitions that contain the required information. Note that not all distributions support this configuration.