Rate This Document
Findability
Accuracy
Completeness
Readability

Starting SPDK

Procedure

  1. Go to the SPDK path and start the vhost process of SPDK.
    build/bin/vhost -S /var/tmp -m 0x2
    • The vhost process is used in virtualization scenarios in the SPDK framework.
    • In the preceding command, -S specifies the storage path of the resource device generated after device binding, and -m specifies the CPU core bound to the SPDK. The number of threads generated is the same as the number of CPU cores bound to the SPDK.
  2. Open a new window, go to the SPDK code path, and create Ceph cloud disk devices. The following uses eight devices as an example.
    ./scripts/rpc.py bdev_rbd_create vdbench image1 512
    ./scripts/rpc.py bdev_rbd_create vdbench image2 512
    ./scripts/rpc.py bdev_rbd_create vdbench image3 512
    ./scripts/rpc.py bdev_rbd_create vdbench image4 512
    ./scripts/rpc.py bdev_rbd_create vdbench image5 512
    ./scripts/rpc.py bdev_rbd_create vdbench image6 512
    ./scripts/rpc.py bdev_rbd_create vdbench image7 512
    ./scripts/rpc.py bdev_rbd_create vdbench image8 512
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.0 Ceph0
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.1 Ceph1
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.2 Ceph2
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.3 Ceph3
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.4 Ceph4
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.5 Ceph5
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.6 Ceph6
    ./scripts/rpc.py vhost_create_blk_controller --cpumask 0x2 vhost.7 Ceph7

    In the preceding command:

    • rpc.py is a control plane script of SPDK that is used to execute control commands.
    • --cpumask indicates the CPU core bound to the current device.
    • vhost.* indicates the name of the vsock fd generated by the current device, which is used by VMs.
    • Ceph* indicates the generated block device (bdev) of the RBD type.