https://github.com/lovi-cloud/go-os-brick
go-os-brick is the Go port of os-brick. provide an iSCSI initiator in your Golang Application.
https://github.com/lovi-cloud/go-os-brick
golang iscsi iscsi-initiator os-brick
Last synced: 5 months ago
JSON representation
go-os-brick is the Go port of os-brick. provide an iSCSI initiator in your Golang Application.
- Host: GitHub
- URL: https://github.com/lovi-cloud/go-os-brick
- Owner: lovi-cloud
- License: mit
- Created: 2020-05-08T03:28:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-03T20:34:07.000Z (over 4 years ago)
- Last Synced: 2025-10-13T09:20:03.430Z (9 months ago)
- Topics: golang, iscsi, iscsi-initiator, os-brick
- Language: Go
- Homepage:
- Size: 127 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-os-brick: go-os-brick is Go port of [os-brick](https://github.com/openstack/os-brick)
[](https://pkg.go.dev/github.com/lovi-cloud/go-os-brick)
## Usage
go-os-brick provide function that connect / disconnect iSCSI volume.
- for multi path
- `ConnectMultiPathVolume()`
- `DisconnectVolume()`
- for single path
- `ConnectSinglePathVolume()`
- `DisconnectSinglePathVolume()`
### Prepare
go-os-brick execute a some commands. please install before use.
- `iscsiadm(8)`
- `blockdev(8)`
- `qemu-img(1)`
- if you use `QEMUToRaw()`
- `multipath(8)`
- if you use multi path
## Testing
### using gostor/gotgt
backend is [gostor/gotgt](https://github.com/gostor/gotgt) via goroutine.
This test need some kernel modules.
```
$ sudo go test -v ./...
```
### using open-iscsi targetd in a host machine
**WARNING: DO NOT EXECUTE YOUR WORKSPACE!!**
This test execute script in a host.
backend is open-iscsi targetd in a host machine.
This test need some kernel modules.
```
$ sudo go test -tags=host -v ./...
```
### using real iSCSI target endpoint
you can use real iSCSI target as backend for testing.
please set environment value
- `OS_BRICK_TEST_PORTAL_ADDRESS`
- `OS_BRICK_TEST_TARGET_IQN`
```
$ export OS_BRICK_TEST_PORTAL_ADDRESS="192.0.2.1"
$ export ...
$ sudo go test -v ./...
```