Bug 1588088

Summary: RFE: Support for -o rhv-upload via Unix domain socket
Product: Red Hat Enterprise Linux 7 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.6CC: bthurber, juzhou, mtessun, mxie, ptoscano, rjones, tzheng, xiaodwan
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.38.2-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 07:45:35 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: 1585675, 1596810, 1596851    
Bug Blocks:    

Description Richard W.M. Jones 2018-06-06 15:36:11 UTC
Description of problem:

The RHV API will implement uploads via a Unix domain socket.
We will need to make small changes in virt-v2v to support that.

Comment 4 Richard W.M. Jones 2018-06-21 14:10:55 UTC
Patches posted:
https://www.redhat.com/archives/libguestfs/2018-June/msg00099.html

Comment 5 Richard W.M. Jones 2018-06-28 07:55:37 UTC
This is finally upstream.  The commits needed (for this and general
optimization and misc cleanups) are:

77a412c0a1cd0e303a072fc5088c8f3bfed36583
v2v: -o rhv-upload: Optimize http request sending

f4e0a8342dbeb2c779c76e1807a37b24a0c96feb
v2v: rvh-upload-plugin: Always read the response

0ae61ce99c351f9cda598016fb55ccc50313df67
v2v: rhv-upload-plugin: Fix name error

32ab53cecd78ee5c140f17e5792710698627d265
v2v: rhv-upload-plugin: Remove unused variables

a1e1f6ec887c2a7973612d2edf7066fd3194ba0b
v2v: -o rhv-upload: Always fetch server options when opening the connection.

b7a2e6270d53200d2df471c36a1fb2b46db8bbac
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).

In addition, 3 more patches coming soon:

RHEL 7: v2v: rhv-upload: Remove restriction on -oa sparse.

the Python 3 -> 2 patch

Disable Nagle algorithm patch

Comment 6 Richard W.M. Jones 2018-06-28 08:06:36 UTC
I have pushed rebased commits to:
https://github.com/libguestfs/libguestfs/commits/rhel-7.5-rhvpreview

Comment 8 mxie@redhat.com 2018-07-12 16:59:37 UTC
Try to reproduce the bug with builds:
virt-v2v-1.38.2-3.el7.x86_64
libguestfs-1.38.2-3.el7.x86_64

Reproduce steps:
1.Convert a guest by virt-v2v to rhv4.2 using rhv-uoload on rhv4.2 
#  virt-v2v -ic vpx://vsphere.local%5cAdministrator.73.141/data/10.73.75.219/?no_verify=1  esx6.7-rhel7.5-x86_64 -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem  -oo rhv-direct -of raw --password-file /tmp/passwd -b ovirtmgmt -v -x 

2.Check virt-v2v conversion log, there is no imageio socket info
# cat socket-v2v-1.38.2-3.log |grep imageio
nothing



Verify the bug with builds:
virt-v2v-1.38.2-6.el7.x86_64
libguestfs-1.38.2-6.el7.x86_64

Steps:
1.Convert a guest by virt-v2v to rhv4.2 using rhv-uoload on rhv4.2 
virt-v2v -ic vpx://vsphere.local%5cAdministrator.73.141/data/10.73.75.219/?no_verify=1  esx6.7-rhel7.5-x86_64 -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem  -oo rhv-direct -of raw --password-file /tmp/passwd -b ovirtmgmt -v -x 


2.Check virt-v2v conversion log, there is imageio socket info
# cat socket-v2v-1.38.2-6-rhv4.2.log |grep imageio
imageio features: flush=True trim=False zero=True unix_socket=None


Hi rjones,

   (1)I can't find imageio service in both rhv4.2 and registered host of rhv4.2, how to configure imageio to be running on the v2v conversion host?
   
    (2)And how to configure socket to connect something like below:
   
    imageio features: flush=True trim=False zero=True unix_socket='\x00/org/ovirt/imageio'

Thanks

Comment 9 Richard W.M. Jones 2018-07-12 17:10:54 UTC
I'm going to move this back to assigned because further patches are
needed to fully implement/fix this:

  8d33ff8ba415180dee8f1f91f3b4d16d72ec094e
  "v2v: improve -os documentation for rhv-upload" (Pino Toscano)

  d5f36bacf9bb6d4d244184551792989906f60896
  "v2v: rhv-upload-plugin: Remove unneeded auth" (Nir Soffer)

  f5442d2f044b398efc992fb4d56c8d3096c781e6
  "v2v: rhv-upload-plugin: Improve error handling" (Nir Soffer)

  891b5a0ec0f320acec0f06b64159eaf3dfbbfeaf
  "v2v: rhv-upload-plugin: Optimize only direct upload" (Nir Soffer)

  4ed1bc5a79a77ad3a620b339f9ac2ecc8df6fd03
  "v2v: rhv plugin - find suitable host (RHBZ#1596810) (RHBZ#1596851)" (Daniel Erez)

In answer to your question in comment 8:

>    (1)I can't find imageio service in both rhv4.2 and registered host
> of rhv4.2, how to configure imageio to be running on the v2v conversion host?

imageio is part of RHV and runs on the oVirt node.  imageio
will never be running on a v2v conversion host.  You have to
run virt-v2v on the oVirt node instead.

The idea is this is an optimization - when virt-v2v notices
it is talking to imageio and imageio is running on the same
host, it uses the Unix domain socket.  In other cases it uses
a TCP connection.

>    (2)And how to configure socket to connect something like below:
>
>    imageio features: flush=True trim=False zero=True unix_socket='\x00/org/ovirt/imageio'

This is not fully working right now, hence why the bug is back in ASSIGNED
state.  However when it's fixed it is simply a case of running virt-v2v
on the same host where imageio is running.  For RHV installations that
have a single oVirt node, just run it on the oVirt node.

Comment 10 mxie@redhat.com 2018-07-14 10:33:50 UTC
Verify the bug with builds:
virt-v2v-1.38.2-7.el7.x86_64
libguestfs-1.38.2-7.el7.x86_64
libvirt-4.5.0-2.el7.x86_64
qemu-kvm-rhev-2.12.0-7.el7.x86_64
ovirt-imageio-daemon-1.4.1-0.el7ev.noarch
RHV:4.2.5-0.1.el7ev


Steps:
1.Set up v2v conversion environment on registered host (oVirt node) of rhv4.2 and convert guest to rhv4.2 using rhv-upload on oVirt node
# export LIBGUESTFS_BACKEND=direct
# virt-v2v -ic vpx://vsphere.local%5cAdministrator.73.141/data/10.73.75.219/?no_verify=1  esx6.7-rhel7.5-x86_64 -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem  -oo rhv-direct -of raw --password-file /tmp/passwd -b ovirtmgmt -v -x 


2.Check virt-v2v conversion log, v2v is using optimizing connection " unix socket"
# cat socket-7 |grep imageio
imageio features: flush=True trim=False zero=True unix_socket='\x00/org/ovirt/imageio'
optimizing connection using unix socket '\x00/org/ovirt/imageio'

Result:
  Virt-v2v can use optimizing connection " unix socket" on oVirt node during conversion using rhv-upload, so move the bug from ON_QA to VERIFIED

Comment 12 errata-xmlrpc 2018-10-30 07:45:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3021