Deploy the WEKA client on a KVM server
Provide WEKA storage to virtual machines through virtio-fs.
Deploy the WEKA client on the KVM server to provide storage to guest VMs. Guest VMs do not require a WEKA client installation.
The KVM administrator provisions and manages WEKA storage using virtio-fs. Each VM receives a dedicated virtio-fs device. Its source directory must contain only that VM's data.
Guest VMs use a standard virtio-fs filesystem and do not interact with WEKA directly. This model has the following properties:
VMs require no WEKA knowledge. Log collection and lifecycle management use standard Linux and KVM tools.
Day-2 VM operations such as pause, snapshot, and live migration can be performed without touching the data path.
Folder quotas set in WEKA are visible to VMs using
dfand can be resized without interrupting the VM.
Considerations
VM isolation: Export only the VM's dedicated directory. Do not export the parent WEKA mount. Protect each directory with POSIX ownership, permissions, or ACLs. Directory scoping does not isolate data from privileged users on the KVM server or from other exports.
In-flight encryption: Because virtio-fs is a shared filesystem and the KVM server is in the data path, in-flight encryption from the guest VM to the filesystem is not supported. To enable in-flight encryption, deploy the WEKA client on the VM instead. See Deploy the WEKA client on KVM virtual machines.
KVM server root access: The KVM server's root user can read guest VM filesystems directly. If strict tenant isolation is required, use the VM-based deployment model.
Per-VM processes: Each VM has a dedicated
virtiofsdprocess and a dedicated server mount point, for example/mnt/weka/vm1,/mnt/weka/vm2, and so on.
Before you begin
Prepare a KVM server and verify that the WEKA cluster is running.
KVM server: A Linux server configured as a KVM hypervisor. This procedure covers Ubuntu 24.04.
WEKA cluster: A running WEKA cluster.
WEKA client: A compatible WEKA client installed on the KVM server. Verify it with
weka version.
Workflow
Configure the KVM server, mount the WEKA filesystem, and expose it to the VM through virtio-fs.
1. Configure the KVM server
Install packages.
Install the required KVM and QEMU packages. Enable the libvirtd service.
Enable IOMMU and configure hugepages.
Use the grub.d append pattern. Do not edit GRUB_CMDLINE_LINUX_DEFAULT directly. Cloud images override this variable from /etc/default/grub.d/50-cloudimg-settings.cfg.
Set hugepages to 16384 per VM (32 GiB). For N VMs, set hugepages=(N * 16384).
Run the applicable commands on the KVM server.
2. Mount the WEKA filesystem and create a VM directory
Mount the WEKA filesystem on the KVM server using a stateless client mount. Replace the placeholders with your environment's values:
<interface-name>: the network interface to mount on<backend_IP>: the IP address or hostname of the WEKA cluster<filesystem>: the WEKA filesystem name<host_mountpoint>: the mount point on the KVM server, for example/mnt/weka
To confirm the mount was successful:
Example output:
Create a directory for the VM. Set ownership and permissions for the user and group used in the guest.
3. Create a VM with a virtio-fs filesystem
Create a VM using virt-install with the required virtio-fs options. Replace <vm_source_dir> with the VM directory created in step 2, for example /mnt/weka/vm1. Replace <guest_mountpoint> with the guest mount identifier used in step 4.
The following options are required:
memorybackingmust usesource.type=memfdandaccess.mode=shared. For details, see the libvirt virtiofs documentation.filesystemshares only the VM source directory at the specified guest mount point.
Example output:
4. Mount the virtio-fs filesystem in the VM
After the VM is running, mount the virtio-fs filesystem from within the guest. To persist the mount across reboots, add an entry to /etc/fstab. You can also use cloud-init to populate /etc/fstab automatically during VM definition.
Create a destination directory and mount the filesystem using the <guest_mountpoint> identifier set in step 3:
To confirm the mount is successful:
Expected output:
The VM sees a virtio-fs filesystem backed by its assigned source directory.
Last updated