Preparing NVMe devices

After some preparation steps on the host, NVMe devices can be used as virtio block devices on virtual servers.

Before you begin

  • You need to know the function address of the NVMe device.

Procedure

The following steps describe a setup on the host that does not persist across host reboots. For a persistent setup, see your host administration documentation.
  1. Ensure that the NVMe device is connected to the host LPAR and online by listing your PCI devices with lspci.
    If the device is not listed in the command output, perform the following steps:
    1. Confirm that, in the hardware configuration, the device is assigned to the LPAR.
    2. Obtain the slot specification for the device.
    3. Write 1 to the power attribute of the slot representation in sysfs.
  2. Obtain a persistent device node for the NVMe device.
    Use this node to configure the device to the virtual server. Perform all actions on the device from the guest. In particular, do not proceed to format or partition the device from the host.

Example

This example assumes that an NVMe device at slot 00000017 is offline, but assigned to the LPAR with function address 1003:00:00.0.
  1. Set the NVMe device online.
    # echo 1 > /sys/bus/pci/slots/00000017/power
    1
  2. The lspci output now includes the device.
    # lspci
    ...
    1003:00:00.0 Non-Volatile memory controller: ...
    ...
  3. Find a device node. There might be multiple nodes for this device. This example uses a udev-created node that includes the function address.
    # ls /dev/**
    ...
    /dev/disk/by-path/pci-1003:00:00.0-nvme-1

What to do next

Configure the NVMe devices as described in Configuring a DASD, SCSI, or NVMe disk.