Bug 1375408
Summary: | [TestOnly] libvirt json backing support for ssh/ftp/ftps/sheepdog/glusterfs(unix socket) | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Han Han <hhan> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Han Han <hhan> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.3 | CC: | dyuan, jsuchane, pkrempa, rbalakri, xuzhang |
Target Milestone: | rc | Keywords: | TestOnly |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 11:12:16 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1372143, 1373710, 1373786, 1457088 | ||
Bug Blocks: |
Description
Han Han
2016-09-13 03:26:03 UTC
Move this BZ to 7.5, due to the depend on BZ1140166 is moved to next release. Failed QA since the depend on BZ1140166 is moved to next release. The JSON part of the SSH protocol was already implemented: commit 29f06ff548e8910ba48c207591788b32c3544e40 Author: Peter Krempa <pkrempa> Date: Tue Sep 9 17:56:04 2014 +0200 util: storage: Add 'ssh' network storage protocol Allow using 'ssh' protocol in backing chains and later for disks themselves. And with the JSON syntax since commit commit bc225b1b5fe3e02eac76f12792aac16d00a7de1d Author: Peter Krempa <pkrempa> Date: Fri Jul 15 15:12:10 2016 +0200 util: storage: Add JSON backing volume parser for 'ssh' protocol gluster with unix socket transport works since: commit 2ed772cd635bfc0fa332c1122aea3f489b879b1a Author: Peter Krempa <pkrempa> Date: Wed Jul 13 15:35:29 2016 +0200 util: storage: Add json pseudo protocol support for gluster volumes Along with the legacy URI based syntax add support for the brand-new fully object based syntax. And (t)ftp(s)/http(s): commit ba05b5b7e78476497fb2222f449b8cad2738acb1 Author: Peter Krempa <pkrempa> Date: Tue Jul 12 17:59:58 2016 +0200 util: storage: Add support for URI based backing volumes in qemu's JSON pseudo-protocol http(s), ftp(s) and tftp use URIs for volume definitions in the JSON pseudo protocol so it's pretty straightforward to add support for them. Removing the dependency on BZ1140166 and moving back. tftp has been dropped from http://lists.nongnu.org/archive/html/qemu-block/2016-11/msg00054.html So I will not test tftp json backing. I will not test attach/detach. Because ftp/ftps/sheepdog are not support by qemu-kvm-rhev and ssh is not supported due to BZ1140166. gluster unix hot-plug fails due to the permission of gluster.socket. Verify on libvirt-3.9.0-9.el7.x86_64 qemu-kvm-rhev-2.10.0-18.el7.x86_64 1. Verify ftp protocol: Prepare a ftp server with pyftpdlib and create a image on ftp server Create backing image: # qemu-img create --object secret,id=sec,data=$(echo -n "12345"|base64),format=base64 -b 'json:{"file.driver":"ftp", "file.url":"ftp://172.17.0.6:2121/A","file.username":"user", "file.password-secret":"sec"}' /var/lib/libvirt/images/ftp.qcow2 -f qcow2 Formatting '/var/lib/libvirt/images/ftp.qcow2', fmt=qcow2 size=104857600 backing_file=json:{"file.driver":"ftp",, "file.url":"ftp://172.17.0.6:2121/A",,"file.username":"user",, "file.password-secret":"sec"} cluster_size=65536 lazy_refcounts=off refcount_bits=16 Refresh the pool: # virsh pool-dumpxml default <pool type='dir'> <name>default</name> <uuid>03a38a8d-a7fc-4f6a-be13-b9c4b6935758</uuid> <capacity unit='bytes'>150297640960</capacity> <allocation unit='bytes'>109206401024</allocation> <available unit='bytes'>41091239936</available> <source> </source> <target> <path>/var/lib/libvirt/images</path> <permissions> <mode>0711</mode> <owner>0</owner> <group>0</group> <label>system_u:object_r:virt_image_t:s0</label> </permissions> </target> </pool> # virsh pool-refresh default Pool default refreshed ftp protocol works well. 2. Verify sheepdog protocol: i. Prepare a sheepdog env from the docker of sheepdog ii. Create a sheepdog image and refresh the pool # qemu-img create sheepdog:172.17.0.2:7000:Alice 100M Formatting 'sheepdog:172.17.0.2:7000:Alice', fmt=raw size=104857600 # virsh pool-refresh default Pool default refreshed 3. Verify gluster(unix) socket i. Prepare a gluster server on the local host ii. Create the glutser unix json backing file and refresh the pool # qemu-img create -b 'json:{"file":{"driver":"gluster","server":[{"type":"unix", "socket":"/var/run/glusterd.socket"}],"volume":"gv0","path":"a"}}' -o backing_fmt=raw /var/lib/libvirt/images/gluster_unix.qcow2 -f qcow2 Formatting '/var/lib/libvirt/images/gluster_unix.qcow2', fmt=qcow2 size=104857600 backing_file=json:{"file":{"driver":"gluster",,"server":[{"type":"unix",, "socket":"/var/run/glusterd.socket"}],,"volume":"gv0",,"path":"a"}} backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16 # virsh pool-refresh default Pool default refreshed Verify ftps protocal 1. Prepare a ftps server accourding to https://www.digitalocean.com/community/tutorials/how-to-configure-vsftpd-to-use-ssl-tls-on-a-centos-vps with implicit_ssl yes. Then upload a image to the ftps server. 2. Create the json backing file: # qemu-img create --object secret,id=sec,data=$(echo -n "12345"|base64),format=base64 -b 'json:{"file.driver":"ftps", "file.url":"ftps://172.17.0.5:21/%2Fhome/ftpuser/a","file.username":"ftpuser", "file.password-secret":"sec", "file.sslverify":"off"}' -o backing_fmt=raw /var/lib/libvirt/images/ftps.qcow2 -f qcow2 Formatting '/var/lib/libvirt/images/ftps.qcow2', fmt=qcow2 size=27832320 backing_file=json:{"file.driver":"ftps",, "file.url":"ftps://172.17.0.5:21/%2Fhome/ftpuser/a",,"file.username":"ftpuser",, "file.password-secret":"sec",, "file.sslverify":"off"} backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16 Refresh the pool # virsh pool-refresh default Pool default refreshed Verified ssh on openssh-clients-7.4p1-16.el7.x86_64: 1. Prepare ssh env # eval `ssh-agent` Agent pid 19057 # ssh-add ~/.ssh/id_rsa Enter passphrase for /root/.ssh/id_rsa: Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa) 2. Create ssh backing image and refresh the pool # qemu-img info --image-opts driver=raw,file.driver=ssh,file.host=xx.xx.xx.xx,file.path=/tmp/a,file.host_key_check=no,file.user=hhan image: json:{"driver": "raw", "file": {"host": "xx.xx.xx.xx", "host_key_check": "no", "driver": "ssh", "path": "/tmp/a", "user": "hhan"}} file format: raw virtual size: 100M (104857600 bytes) disk size: unavailable # virsh pool-refresh default Pool default refreshed |