Create Vhost Target

To create a Vhost target, use the command:

xnr_cli vhost create --ctrlr <vhost_name> --bdev <raid_name> --cpumask <value>

where the --ctrlr parameter specifies the name of the Vhost block target, --bdev is the name of the RAID to be exposed over this target and --cpumask is the integer number in hexadecimal format specifies which CPU cores serve this Vhost target IO. The CPU mask must be subset of the CPU mask configuration parameter specified during xiRAID Opus installation (see Installing xiRAID Opus).

The Vhost target is designed to expose a RAID block device for frontend connectivity. However, any BDEV can be exposed by Vhost target using the same “vhost create” command. If the BDEV is one of the drives managed by the Device Manager then that BDEV is re-attached at the engine restart and corresponded Vhost is also restarted. If the Vhost target is created for a BDEV that is not re-attached at the engine restart (such as malloc in-memory BDEV), then the Vhost is not restarted.

If a Vhost is configured for RAID or another BDEV that is not available anymore, for example the RAID is unloaded or destroyed the Vhost is not deleted automatically and still kept in the persisted configuration. The Vhost should be deleted if it is not longer needed.