cinder.volume.targets.nvmeof module

class NVMeOF(*args, **kwargs)

Bases: Target

Target object for block storage devices with RDMA transport.

static are_same_connector(A, B)

Whether 2 connectors belong to the same host or not.

This is used for multi attach volumes, to be able to know when there are no more attachments on a given host.

This is the generic implementation, but specific targets may overwrite it. For example iSCSI would check the the “initiator” key instead, and NVMe-oF would check the “nqn” key.

create_export(context, volume, volume_path)

Creates export data for a logical volume.

create_nvmeof_target(volume_id, subsystem_name, target_ips, target_port, transport_type, nvmet_port_id, ns_id, volume_path)

Targets that don’t override create_export must implement this.

delete_nvmeof_target(target_name)

Targets that don’t override remove_export must implement this.

ensure_export(context, volume, volume_path)

Synchronously recreates an export for a volume.

get_nvmeof_location(nqn, target_ips, target_port, nvme_transport_type, nvmet_ns_id)

Serializes driver data into single line string.

initialize_connection(volume, connector)

Returns the connection info.

In NVMeOF driver, :driver_volume_type: is set to ‘nvmeof’, :data: is the driver data that has the value of _get_connection_properties_from_vol.

Example return value:

{
    "driver_volume_type": "nvmeof",
    "data":
    {
        "target_portal": "1.1.1.1",
        "target_port": 4420,
        "nqn": "nqn.volume-0001",
        "transport_type": "rdma",
        "ns_id": 10
    }
}
protocol = 'nvmeof'
remove_export(context, volume)

Removes an export for a Target/Volume.

target_protocol_map = {'nvmet_rdma': 'rdma', 'nvmet_tcp': 'tcp'}
terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.

validate_connector(connector)
exception UnsupportedNVMETProtocol(message: str | tuple | None = None, **kwargs)

Bases: Invalid

message = "An invalid 'target_protocol' value was provided: %(protocol)s"