from nvmf_client import NvmfTgt from py_spdk import pyspdk py = pyspdk('nvmf_tgt') if py.is_alive(): nvmf_tgt = NvmfTgt(py) my_bdevs = nvmf_tgt.get_bdevs() for index in range(len(my_bdevs)): my_bdev = my_bdevs[index] if (index == 0): print my_bdev else: raise Exception('nvmf_tgt server is dead.')
def run_client(): py = pyspdk('nvme') if py.is_alive(): val = py.exec_rpc('get_vhost_blk_controllers', '127.0.0.1') return val
def run_client(): py = pyspdk('nvme') if py.is_alive(): val = py.exec_rpc('get_bdevs', '127.0.0.1') return val
from py_spdk import pyspdk from vhost_client import VhostTgt py = pyspdk('vhost') if py.is_alive(): vhost_tgt = VhostTgt(py) my_luns = vhost_tgt.get_luns() for index in range(len(my_luns)): my_lun = my_luns[index] if (index == 0): print my_lun else: raise Exception('vhost_tgt server is dead.')