Skip to content

go-os-brick is the Go port of os-brick. provide an iSCSI initiator in your Golang Application.

License

Notifications You must be signed in to change notification settings

lovi-cloud/go-os-brick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-os-brick: go-os-brick is Go port of os-brick

Go Reference

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 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 ./...

About

go-os-brick is the Go port of os-brick. provide an iSCSI initiator in your Golang Application.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published