diff --git a/docker-compose.yml b/docker-compose.yml index e2dd3a1..0b0251a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,11 @@ services: ./rpc.py nvmf_subsystem_add_host nqn.2016-06.io.spdk:cnode1 nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c && \ ./rpc_http_proxy.py 0.0.0.0 9009 spdkuser spdkpass' healthcheck: - test: ["CMD-SHELL", "python3 /usr/libexec/spdk/scripts/rpc.py spdk_get_version || exit 1"] + test: + [ + "CMD-SHELL", + "python3 /usr/libexec/spdk/scripts/rpc.py spdk_get_version || exit 1" + ] interval: 6s retries: 5 start_period: 20s @@ -53,7 +57,7 @@ services: depends_on: spdk: condition: service_healthy - command: /opi-spdk-bridge -port=50051 -spdk_addr=/var/tmp/spdk.sock + command: /opi-spdk-bridge -grpc_port=50051 -http_port=8082 -spdk_addr=/var/tmp/spdk.sock healthcheck: test: grpcurl -plaintext localhost:50051 list || exit 1 diff --git a/go.mod b/go.mod index 5b1c748..ac56a34 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/lithammer/fuzzysearch v1.1.8 github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 - github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071 + github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 golang.org/x/net v0.15.0 diff --git a/go.sum b/go.sum index 4d1fbe0..3474904 100644 --- a/go.sum +++ b/go.sum @@ -58,6 +58,8 @@ github.com/opiproject/opi-api v0.0.0-20230908135156-02d38276b0f2 h1:ye6T8WPpLHuk github.com/opiproject/opi-api v0.0.0-20230908135156-02d38276b0f2/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071 h1:PMWBd94I5QEtwt4t+GzHI+qMeSDwgLOeuawiwsz/kx8= github.com/opiproject/opi-api v0.0.0-20230918073146-388467d72071/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= +github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac h1:L4OT2ftfG2YhKdBNVLICUzRUmrVS0O054KkJj+0ERcU= +github.com/opiproject/opi-api v0.0.0-20230919105335-6a20f2a254ac/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/storage/backend.go b/storage/backend.go index 77e6efb..b33684f 100644 --- a/storage/backend.go +++ b/storage/backend.go @@ -56,8 +56,10 @@ func executeNvmeRemoteController(ctx context.Context, c4 pb.NvmeRemoteController NvmeRemoteControllerId: resourceID, NvmeRemoteController: &pb.NvmeRemoteController{ Multipath: pb.NvmeMultipath_NVME_MULTIPATH_MULTIPATH, - Hdgst: false, - Ddgst: false, + Tcp: &pb.TcpController{ + Hdgst: false, + Ddgst: false, + }, }}) if err != nil { return err @@ -131,9 +133,11 @@ func executeNvmePath(ctx context.Context, c5 pb.NvmeRemoteControllerServiceClien NvmeRemoteControllerId: ctrlrResourceID, NvmeRemoteController: &pb.NvmeRemoteController{ Multipath: pb.NvmeMultipath_NVME_MULTIPATH_MULTIPATH, - Hdgst: false, - Ddgst: false, - Psk: psk, + Tcp: &pb.TcpController{ + Hdgst: false, + Ddgst: false, + Psk: psk, + }, }}) if err != nil { return err @@ -145,12 +149,14 @@ func executeNvmePath(ctx context.Context, c5 pb.NvmeRemoteControllerServiceClien NvmePathId: resourceID, NvmePath: &pb.NvmePath{ Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, Traddr: addr[0].String(), - Trsvcid: int64(port), - Subnqn: "nqn.2016-06.io.spdk:cnode1", - Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c", ControllerNameRef: rr0.Name, + Fabrics: &pb.FabricsPath{ + Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Trsvcid: int64(port), + Subnqn: "nqn.2016-06.io.spdk:cnode1", + Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c", + }, }}) if err != nil { return err @@ -175,12 +181,14 @@ func executeNvmePath(ctx context.Context, c5 pb.NvmeRemoteControllerServiceClien NvmePath: &pb.NvmePath{ Name: np0.Name, Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, Traddr: addr[0].String(), - Trsvcid: int64(port), - Subnqn: "nqn.2016-06.io.spdk:cnode1", - Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c", ControllerNameRef: rr0.Name, + Fabrics: &pb.FabricsPath{ + Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Trsvcid: int64(port), + Subnqn: "nqn.2016-06.io.spdk:cnode1", + Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c", + }, }}) if err != nil { return err diff --git a/storage/goopicsi.go b/storage/goopicsi.go index ef2d839..a6fb116 100644 --- a/storage/goopicsi.go +++ b/storage/goopicsi.go @@ -69,11 +69,13 @@ func NvmeControllerConnect(id string, trAddr string, subnqn string, trSvcID int6 NvmePath: &pb.NvmePath{ ControllerNameRef: response.Name, Traddr: trAddr, - Subnqn: subnqn, - Trsvcid: trSvcID, - Hostnqn: hostnqn, Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Fabrics: &pb.FabricsPath{ + Subnqn: subnqn, + Trsvcid: trSvcID, + Hostnqn: hostnqn, + Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + }, }, }) if err != nil {