Skip to contentSkip to conversation

block/vxhs: Add Veritas HyperScale VxHS block device support

PATCH Superseded Ashish Mittal 4 participants 7 messages Oct 26, 2016 – Oct 31, 2016 Block layer

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block/vxhs: Add Veritas HyperScale VxHS block device support

This patch adds support for a new block device type called "vxhs". Source code for the library that this code loads can be downloaded from:
https://github.com/MittalAshish/libqnio.git

Sample command line using JSON syntax:
./qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on 'json:{"driver":"vxhs","vdisk_id":"{c3e9095a-a5ee-4dce-afeb-2a59fb387410}","server":[{"host":"172.172.17.4","port":"9999"}]}'

Sample command line using URI syntax:
qemu-img convert -f raw -O raw -n /var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad vxhs://192.168.0.1:9999/%7Bc6718f6b-0401-441d-a8c3-1f0064d75ee0%7D

---
v2 changelog:
(1) Changes done in response to v1 comments.

 block/Makefile.objs |   2 +
 block/trace-events  |  22 ++
 block/vxhs.c        | 682 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |  41 ++++
 4 files changed, 747 insertions(+)
 create mode 100644 block/vxhs.c
block/Makefile.objs +2 -0
index 67a036a..58313a2 100644
@@ -18,6 +18,7 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
 block-obj-$(CONFIG_CURL) += curl.o
 block-obj-$(CONFIG_RBD) += rbd.o
 block-obj-$(CONFIG_GLUSTERFS) += gluster.o
+block-obj-$(CONFIG_VXHS) += vxhs.o
 block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o
 block-obj-$(CONFIG_LIBSSH2) += ssh.o
 block-obj-y += accounting.o dirty-bitmap.o
@@ -38,6 +39,7 @@ rbd.o-cflags       := $(RBD_CFLAGS)
 rbd.o-libs         := $(RBD_LIBS)
 gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
 gluster.o-libs     := $(GLUSTERFS_LIBS)
+vxhs.o-libs        := $(VXHS_LIBS)
 ssh.o-cflags       := $(LIBSSH2_CFLAGS)
 ssh.o-libs         := $(LIBSSH2_LIBS)
 archipelago.o-libs := $(ARCHIPELAGO_LIBS)
block/trace-events +22 -0
index 05fa13c..aea97cb 100644
@@ -114,3 +114,25 @@ qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s
 qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
 qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
 qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
+
+# block/vxhs.c
+vxhs_iio_callback(int error, int reason) "ctx is NULL: error %d, reason %d"
+vxhs_setup_qnio(void *s) "Context to HyperScale IO manager = %p"
+vxhs_iio_callback_chnfail(int err, int error) "QNIO channel failed, no i/o %d, %d"
+vxhs_iio_callback_unknwn(int opcode, int err) "unexpected opcode %d, errno %d"
+vxhs_open_fail(int ret) "Could not open the device. Error = %d"
+vxhs_open_epipe(int ret) "Could not create a pipe for device. Bailing out. Error=%d"
+vxhs_aio_rw_invalid(int req) "Invalid I/O request iodir %d"
+vxhs_aio_rw_ioerr(char *guid, int iodir, uint64_t size, uint64_t off, void *acb, int ret, int err) "IO ERROR (vDisk %s) FOR : Read/Write = %d size = %lu offset = %lu ACB = %p. Error = %d, errno = %d"
+vxhs_get_vdisk_stat_err(char *guid, int ret, int err) "vDisk (%s) stat ioctl failed, ret = %d, errno = %d"
+vxhs_get_vdisk_stat(char *vdisk_guid, uint64_t vdisk_size) "vDisk %s stat ioctl returned size %lu"
+vxhs_qnio_iio_open(const char *ip) "Failed to connect to storage agent on host-ip %s"
+vxhs_qnio_iio_devopen(const char *fname) "Failed to open vdisk device: %s"
+vxhs_complete_aio(void *acb, uint64_t ret) "aio failed acb %p ret %ld"
+vxhs_parse_uri_filename(const char *filename) "URI passed via bdrv_parse_filename %s"
+vxhs_qemu_init_vdisk(const char *vdisk_id) "vdisk_id from json %s"
+vxhs_qemu_init_numservers(int num_servers) "Number of servers passed = %d"
+vxhs_parse_uri_hostinfo(int num, char *host, int port) "Host %d: IP %s, Port %d"
+vxhs_qemu_init(char *of_vsa_addr, int port) "Adding host %s:%d to BDRVVXHSState"
+vxhs_qemu_init_filename(const char *filename) "Filename passed as %s"
+vxhs_close(char *vdisk_guid) "Closing vdisk %s"
block/vxhs.c new file +682 -0

682 lines not on this page · raw message

configure +41 -0

77 lines not on this page · raw message

Signature · 1 line
2.5.5
#1 lore raw
Quoted 7 lines · Ashish Mittal

This patch adds support for a new block device type called "vxhs". Source code for the library that this code loads can be downloaded from:
https://github.com/MittalAshish/libqnio.git

Sample command line using JSON syntax:
./qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on 'json:{"driver":"vxhs","vdisk_id":"{c3e9095a-a5ee-4dce-afeb-2a59fb387410}","server":[{"host":"172.172.17.4","port":"9999"}]}'

Quoted 7 lines

Sample command line using URI syntax:
qemu-img convert -f raw -O raw -n /var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad vxhs://192.168.0.1:9999/%7Bc6718f6b-0401-441d-a8c3-1f0064d75ee0%7D

---
v2 changelog:
(1) Changes done in response to v1 comments.

Yet again you've ignored the request to include the QAPI schema changes

Quoted 6 lines
 block/Makefile.objs |   2 +
 block/trace-events  |  22 ++
 block/vxhs.c        | 682 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |  41 ++++
 4 files changed, 747 insertions(+)
 create mode 100644 block/vxhs.c

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#2 lore raw

Hi Daniel,

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

I think this version still does not address Daniel's concerns regarding a QAPI schema for vxhs.

We are working on QAPI schema changes and will submit them in separate patch.

They should be part of the main patch, not a separate patch as they are a pre-requisite for any new block driver.

I guess what Madhav meant was that this patch (v2) is missing the QAPI changes, and we will provide those in the next version ASAP.

Regards,
Ashish

Quoted 31 lines · Daniel P. Berrange
Quoted 7 lines · Ashish Mittal

This patch adds support for a new block device type called "vxhs". Source code for the library that this code loads can be downloaded from:
https://github.com/MittalAshish/libqnio.git

Sample command line using JSON syntax:
./qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on 'json:{"driver":"vxhs","vdisk_id":"{c3e9095a-a5ee-4dce-afeb-2a59fb387410}","server":[{"host":"172.172.17.4","port":"9999"}]}'

Quoted 7 lines

Sample command line using URI syntax:
qemu-img convert -f raw -O raw -n /var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad vxhs://192.168.0.1:9999/%7Bc6718f6b-0401-441d-a8c3-1f0064d75ee0%7D

---
v2 changelog:
(1) Changes done in response to v1 comments.

Yet again you've ignored the request to include the QAPI schema changes

Quoted 6 lines
 block/Makefile.objs |   2 +
 block/trace-events  |  22 ++
 block/vxhs.c        | 682 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |  41 ++++
 4 files changed, 747 insertions(+)
 create mode 100644 block/vxhs.c

Regards,
Daniel
--

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#3 lore raw

Hi Jeff etc al,

Thanks a lot for your due diligence to review the code changes throughly and providing comments, suggestions to improve. We are completely on top of this and have already started to expedite the overall development.

We would like to get you help regarding the applicability of qemu-iotests test harness against a QEMU block driver which doesn¹t support create operation. Where we can find the detailed document regarding qemu-iotests test harness and and it¹s dependency on a particular block driver?

We have enhanced the test server utility (qnio_server) a bit and conducted manual tests, which mainly includes qemu-img convert and qemu-io read and write operations.

# libqnio/src/test/

@ Create vDisk file of size 10G

	# ./create_vdisk.sh
	Usage: create_vdisk <filename> <size in MB>
	# ./create_vdisk.sh /qemublk_test/vDisk1 10240
	# ls -lhs /qemublk_test/vDisk1
	1.1M -rw-r--r-- 1 root root 10G Oct 27 17:02 /qemublk_test/vDisk1

@ Start qnio_server

	# ./qnio_server -h
	Usage: qnio_server [-d <directory>] [-p] [-v] [-h]
	d -> Vdisk directory
	p -> Run commands in separate thread
	h -> Help
	v -> Verbose
	# ./qnio_server -d /qemublk_test/

@ Convert qcow2 image to vxhs raw format

# ./qemu-img convert -f qcow2 -O raw -n /qemublk_test/centos-64.qcow2
vxhs://127.0.0.1:9999/vDisk1

-Rakesh

Quoted 63 lines · ashish mittal

Hi Daniel,

Quoted 10 lines
Quoted 6 lines
Quoted 1 line

I think this version still does not address Daniel's concerns

regarding a

Quoted 1 line

QAPI schema for vxhs.

We are working on QAPI schema changes and will submit them in separate patch.

They should be part of the main patch, not a separate patch as they are a pre-requisite for any new block driver.

I guess what Madhav meant was that this patch (v2) is missing the QAPI changes, and we will provide those in the next version ASAP.

Regards,
Ashish

Quoted 42 lines · Daniel P. Berrange
Quoted 17 lines · Ashish Mittal

This patch adds support for a new block device type called "vxhs". Source code for the library that this code loads can be downloaded from:
https://github.com/MittalAshish/libqnio.git

Sample command line using JSON syntax:
./qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on 'json:{"driver":"vxhs","vdisk_id":"{c3e9095a-a5ee-4dce-afeb-2a59fb387410 }","server":[{"host":"172.172.17.4","port":"9999"}]}'

Sample command line using URI syntax:
qemu-img convert -f raw -O raw -n /var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad vxhs://192.168.0.1:9999/%7Bc6718f6b-0401-441d-a8c3-1f0064d75ee0%7D

Quoted 4 lines

---
v2 changelog:
(1) Changes done in response to v1 comments.

Yet again you've ignored the request to include the QAPI schema changes

Quoted 7 lines
 block/Makefile.objs |   2 +
 block/trace-events  |  22 ++
 block/vxhs.c        | 682
++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |  41 ++++
 4 files changed, 747 insertions(+)
 create mode 100644 block/vxhs.c

Regards,
Daniel
--
|: http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o-
http://virt-manager.org :|
|: http://entangle-photo.org -o-
http://search.cpan.org/~danberr/ :|

#4 lore raw
Quoted 41 lines · Rakesh Ranjan

Hi Jeff etc al,

Thanks a lot for your due diligence to review the code changes throughly and providing comments, suggestions to improve. We are completely on top of this and have already started to expedite the overall development.

We would like to get you help regarding the applicability of qemu-iotests test harness against a QEMU block driver which doesn¹t support create operation. Where we can find the detailed document regarding qemu-iotests test harness and and it¹s dependency on a particular block driver?

We have enhanced the test server utility (qnio_server) a bit and conducted manual tests, which mainly includes qemu-img convert and qemu-io read and write operations.

# libqnio/src/test/

@ Create vDisk file of size 10G

	# ./create_vdisk.sh
	Usage: create_vdisk <filename> <size in MB>
	# ./create_vdisk.sh /qemublk_test/vDisk1 10240
	# ls -lhs /qemublk_test/vDisk1
	1.1M -rw-r--r-- 1 root root 10G Oct 27 17:02 /qemublk_test/vDisk1

@ Start qnio_server

	# ./qnio_server -h
	Usage: qnio_server [-d <directory>] [-p] [-v] [-h]
	d -> Vdisk directory
	p -> Run commands in separate thread
	h -> Help
	v -> Verbose
Quoted 9 lines
	# ./qnio_server -d /qemublk_test/

@ Convert qcow2 image to vxhs raw format

# ./qemu-img convert -f qcow2 -O raw -n /qemublk_test/centos-64.qcow2
vxhs://127.0.0.1:9999/vDisk1

Hi Rakesh,

The qemu-iotests are located in the qemu tree, under 'tests/qemu-iotests'.

I don't know of any formal documenation out here, but here are the basics:

To run an individual iotest, you can run the test from within the tests/qemu-iotests directory, e.g.:

# cd tests/qemu-iotests
# ./check -qcow2 002

What this will do is run the test case 002 with the format qcow2. The output of that test is checked against 002.out, and if there are differences, an error is reported.

What is implicit in the above check command is the protocol type of 'file'. If you wanted to run that test using a different protocol (for instance, 'nfs'), you can do:

# ./check -qcow2 -nfs 002

You need to extend qemu-iotests to be aware of the vxhs:// protocol.

To do this, you'll need to modify these files:

tests/qemu-iotests/common.rc
tests/qemu-iotests/common

If you search for some of the other protocol drivers, you should see what you need to change; for instance, 'sheepdog', 'nfs', 'ssh', etc.. are all protocol drivers.

One difference is, as you noted, that you cannot create an image using your protocol.

This means you will need to either:

A) Let the test framework create the test image like normal, and then have the test script launch the test QNIO server,

B) Do the image creation, and server launch, manually outside the script. This isn't optimal because then the testers (e.g. me, and other block maintainers) need to remember what steps to perform.

For the basis of a simple test, you can look at test 002. It should be a good starting point. You'll need to create a new test as a file named after the existing tests (you need the ??? and ???.out files), and then modify the 'group' file to include the test).

Generally, it is best if the test if a separate patch in the series.

Jeff

#5 lore raw

Hi Jeff,

Thanks for your very useful information! We will take a look at it to do the needful.

-Rakesh

Quoted 118 lines · Jeff Cody
Quoted 45 lines · Rakesh Ranjan

Hi Jeff et al,

Thanks a lot for your due diligence to review the code changes throughly and providing comments, suggestions to improve. We are completely on top of this and have already started to expedite the overall development.

We would like to get you help regarding the applicability of qemu-iotests
test harness against a QEMU block driver which doesn¹t support create operation. Where we can find the detailed document regarding qemu-iotests
test harness and and it¹s dependency on a particular block driver?

We have enhanced the test server utility (qnio_server) a bit and conducted
manual tests, which mainly includes qemu-img convert and qemu-io read and
write operations.

# libqnio/src/test/

@ Create vDisk file of size 10G

	# ./create_vdisk.sh
	Usage: create_vdisk <filename> <size in MB>
	# ./create_vdisk.sh /qemublk_test/vDisk1 10240
	# ls -lhs /qemublk_test/vDisk1
	1.1M -rw-r--r-- 1 root root 10G Oct 27 17:02 /qemublk_test/vDisk1

@ Start qnio_server

	# ./qnio_server -h
	Usage: qnio_server [-d <directory>] [-p] [-v] [-h]
	d -> Vdisk directory
	p -> Run commands in separate thread
	h -> Help
	v -> Verbose
Quoted 9 lines
	# ./qnio_server -d /qemublk_test/

@ Convert qcow2 image to vxhs raw format

# ./qemu-img convert -f qcow2 -O raw -n /qemublk_test/centos-64.qcow2
vxhs://127.0.0.1:9999/vDisk1

Hi Rakesh,

The qemu-iotests are located in the qemu tree, under 'tests/qemu-iotests'.

I don't know of any formal documenation out here, but here are the basics:

To run an individual iotest, you can run the test from within the tests/qemu-iotests directory, e.g.:

# cd tests/qemu-iotests
# ./check -qcow2 002

What this will do is run the test case 002 with the format qcow2. The output of that test is checked against 002.out, and if there are differences, an error is reported.

What is implicit in the above check command is the protocol type of 'file'.
If you wanted to run that test using a different protocol (for instance, 'nfs'), you can do:

# ./check -qcow2 -nfs 002

You need to extend qemu-iotests to be aware of the vxhs:// protocol.

To do this, you'll need to modify these files:

tests/qemu-iotests/common.rc
tests/qemu-iotests/common

If you search for some of the other protocol drivers, you should see what you need to change; for instance, 'sheepdog', 'nfs', 'ssh', etc.. are all protocol drivers.

One difference is, as you noted, that you cannot create an image using your
protocol.

This means you will need to either:

A) Let the test framework create the test image like normal, and then have the test script launch the test QNIO server,

B) Do the image creation, and server launch, manually outside the script. This isn't optimal because then the testers (e.g. me, and other block maintainers) need to remember what steps to perform.

For the basis of a simple test, you can look at test 002. It should be a good starting point. You'll need to create a new test as a file named after
the existing tests (you need the ??? and ???.out files), and then modify the
'group' file to include the test).

Generally, it is best if the test if a separate patch in the series.

Jeff

#6 lore raw
In reply to ashish mittal

I have submitted v3 with the QAPI schema changes.

Regards,
Ashish

Quoted 51 lines · ashish mittal

Hi Daniel,

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

I think this version still does not address Daniel's concerns regarding a QAPI schema for vxhs.

We are working on QAPI schema changes and will submit them in separate patch.

They should be part of the main patch, not a separate patch as they are a pre-requisite for any new block driver.

I guess what Madhav meant was that this patch (v2) is missing the QAPI changes, and we will provide those in the next version ASAP.

Regards,
Ashish

Quoted 31 lines · Daniel P. Berrange
Quoted 7 lines · Ashish Mittal

This patch adds support for a new block device type called "vxhs". Source code for the library that this code loads can be downloaded from:
https://github.com/MittalAshish/libqnio.git

Sample command line using JSON syntax:
./qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on 'json:{"driver":"vxhs","vdisk_id":"{c3e9095a-a5ee-4dce-afeb-2a59fb387410}","server":[{"host":"172.172.17.4","port":"9999"}]}'

Quoted 7 lines

Sample command line using URI syntax:
qemu-img convert -f raw -O raw -n /var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad vxhs://192.168.0.1:9999/%7Bc6718f6b-0401-441d-a8c3-1f0064d75ee0%7D

---
v2 changelog:
(1) Changes done in response to v1 comments.

Yet again you've ignored the request to include the QAPI schema changes

Quoted 6 lines
 block/Makefile.objs |   2 +
 block/trace-events  |  22 ++
 block/vxhs.c        | 682 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |  41 ++++
 4 files changed, 747 insertions(+)
 create mode 100644 block/vxhs.c

Regards,
Daniel
--

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|