Create a KubeVirt VM using a Fusion Preset
After you enable Portworx Fusion Controller and create a Fusion preset, you can provision storage by creating a KubeVirt VM in your Portworx cluster. The Portworx Fusion Controller automatically creates the corresponding workload in Fusion and provisions volumes on the appropriate FlashArray.
For information on how to create a Kubevirt VM, see the applicable version of the OpenShift documentation and KubeVirt user guide.
- In a Fusion-integrated environment, you don’t need to manually create volumes, manage
pure.json, or configure storage arrays. Instead, you define storage requirements using Fusion presets and consume them through KubernetesStorageClassobjects. - The VM must be created using a data volume template that references a Fusion-backed
StorageClass.
When you create a VM that references a Fusion-backed StorageClass, the Portworx Fusion Controller automatically handles storage provisioning. It detects the StorageClass reference, creates a corresponding workload in Fusion, and provisions volumes based on the preset configuration. Portworx Fusion Controller uses its placement API to recommend the appropriate FlashArray for volume creation and provisions the volumes through the Fusion Coordinator, eliminating the need to interact with individual arrays. The volumes are then attached to the VM. A corresponding FusionWorkload CR is created in the Portworx cluster to represent and track the workload, ensuring consistent state between Portworx and Fusion.
The following example shows how to reference a Fusion-backed StorageClass in a VM:
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: fusion-vm
spec:
running: true
template:
spec:
domain:
devices:
disks:
- name: os-disk
disk:
bus: virtio
volumes:
- name: os-disk
dataVolume:
name: fusion-vm-dv
dataVolumeTemplates:
- metadata:
name: fusion-vm-dv
spec:
pvc:
storageClassName: fleet-testing-gold-tier
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
Replace fleet-testing-gold-tier with the StorageClass generated from your Fusion preset.
Create a VM using customizable Fusion presets
If you use a Fusion preset that includes customizable values (for example, size or count ranges), you must provide these values when creating the VM. To do this perform the following steps:
- Create a Kubernetes ConfigMap that defines the required volume parameters such as size and count.
apiVersion: v1
kind: ConfigMap
metadata:
name: my-vm-parameters
namespace: portworx
data:
parameters.json: |
{
"qos_configurations": [
{
"name": "default-qos",
"iops_limit": "50000",
"bandwidth_limit": "1G"
}
],
"volume_configurations": [
{
"name": "vol-1",
"count": "2",
"provisioned_size": "100G"
}
],
"placement_configurations": [
{
"name": "placement-1",
"storage_class": {
"name": "flasharray-x",
"resource_type": "storage-class"
}
}
]
}
- Reference the ConfigMap in the VM metadata.
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: my-vm
annotations:
fusion.purestorage.com/parameters-configmap: "my-vm-parameters"
spec:
# ... VM spec
Portworx validates the values against the preset constraints. If the values do not match the preset’s allowed values or defined range, workload creation fails and the VM remains in the Provisioning state. To view the failure reason, check the events for the corresponding workload custom resource.
For QoS parameters, such as IOPS and bandwidth, Portworx uses the values defined in the customized preset if default, minimum, or maximum values are set in the preset. Portworx uses these QoS values from the ConfigMap only when the preset does not define them.