Displaying 18 results from an estimated 18 matches for "hosts_service".
2018 Jul 05
4
[PATCH] v2v: rhv plugin - find suitable host
...if len(data_centers) == 0:
+ # The storage domain is not attached to a datacenter
+ # (shouldn't happen, would fail on disk creation).
+ return None
+
+ datacenter = data_centers[0]
+ debug("hw_id = %r, datacenter = %s" % (vdsm_id, datacenter.name))
- hosts_service = connection.system_service().hosts_service()
+ hosts_service = system_service.hosts_service()
hosts = hosts_service.list(
- search="hw_id=%s" % vdsm_id,
+ search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),
case_sensiti...
2018 Jul 05
2
[PATCH v2] v2v: rhv plugin - find suitable host
...ed, 24 insertions(+), 4 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index da309e288..931fcfaa2 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -69,14 +69,34 @@ def find_host(connection):
debug("hw_id = %r" % vdsm_id)
- hosts_service = connection.system_service().hosts_service()
+ system_service = connection.system_service()
+ storage_name = params['output_storage']
+ data_centers = system_service.data_centers_service().list(
+ search='storage=%s' % storage_name,
+ case_sensitive=False,
+...
2018 Jul 25
1
[PATCH] v2v: rhv plugin - case-sensitive search queries
....data_centers_service().list(
search='storage.name=%s' % storage_name,
- case_sensitive=False,
+ case_sensitive=True,
)
if len(data_centers) == 0:
# The storage domain is not attached to a datacenter
@@ -84,7 +84,7 @@ def find_host(connection):
hosts_service = system_service.hosts_service()
hosts = hosts_service.list(
search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),
- case_sensitive=False,
+ case_sensitive=True,
)
if len(hosts) == 0:
# This oVirt host is not registe...
2018 Jul 31
1
[PATCH] v2v: -o rhv-upload: PEP8 fixes for rhv-upload-plugin.py
...v2v/rhv-upload-plugin.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index 4fad27fb8..bdc1e104a 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -86,7 +86,8 @@ def find_host(connection):
hosts_service = system_service.hosts_service()
hosts = hosts_service.list(
- search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),
+ search="hw_id=%s and datacenter=%s and status=Up"
+ % (vdsm_id, datacenter.name),
case_sensi...
2018 Jul 05
0
Re: [PATCH] v2v: rhv plugin - find suitable host
...# The storage domain is not attached to a datacenter
> + # (shouldn't happen, would fail on disk creation).
> + return None
> +
> + datacenter = data_centers[0]
> + debug("hw_id = %r, datacenter = %s" % (vdsm_id, datacenter.name))
>
> - hosts_service = connection.system_service().hosts_service()
> + hosts_service = system_service.hosts_service()
> hosts = hosts_service.list(
> - search="hw_id=%s" % vdsm_id,
> + search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id, datacenter.name),...
2018 Jul 05
0
Re: [PATCH] v2v: rhv plugin - find suitable host
...n).
>
A debug message here would be helpful.
> + return None
> +
> + datacenter = data_centers[0]
> + debug("hw_id = %r, datacenter = %s" % (vdsm_id, datacenter.name))
>
And log only the datacenter here, to match other logs in the plugin.
>
> - hosts_service = connection.system_service().hosts_service()
> + hosts_service = system_service.hosts_service()
> hosts = hosts_service.list(
> - search="hw_id=%s" % vdsm_id,
> + search="hw_id=%s and datacenter=%s and status=Up" % (vdsm_id,
> datacenter.nam...
2018 Jul 05
0
Re: [PATCH v2] v2v: rhv plugin - find suitable host
...; diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
> index da309e288..931fcfaa2 100644
> --- a/v2v/rhv-upload-plugin.py
> +++ b/v2v/rhv-upload-plugin.py
> @@ -69,14 +69,34 @@ def find_host(connection):
>
> debug("hw_id = %r" % vdsm_id)
>
> - hosts_service = connection.system_service().hosts_service()
> + system_service = connection.system_service()
> + storage_name = params['output_storage']
> + data_centers = system_service.data_centers_service().list(
> + search='storage=%s' % storage_name,
> +...
2018 Jun 25
1
Re: [PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...; + host = None
> + try:
> + with builtin_open("/etc/vdsm/vdsm.id") as f:
>
Why use builtin_open() instead of open() or io.open()?
> + vdsm_id = f.readline().strip()
>
debug log with the host hardware id would be nice here.
> +
> + hosts_service = connection.system_service().hosts_service()
> + hosts = hosts_service.list(
> + search="hw_id=%s" % vdsm_id,
> + case_sensitive=False,
> + )
> + if len(hosts) > 0:
> + host = hosts[0]
> + debug(&quo...
2018 Jun 26
2
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
v2 was here:
https://www.redhat.com/archives/libguestfs/2018-June/msg00109.html
v3:
- Added/fixed all suggestions from Nir in previous review.
Q: I wasn't sure if we still need the "UnsupportedError" class so I
left it in.
Q: Does the Unix socket always have the same name? What happens if
there's more than one transfer happening?
I tested this both ways, and it worked both
2018 Jun 26
2
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...later. Without this you will have to detect this case
by not seeing the next debug line. Possible but require more effort.
> + debug("hw_id = %r" % vdsm_id)
> +
>
A comment abut looking up the host id would be nice. The code is not
explaining it self very well.
> + hosts_service = connection.system_service().hosts_service()
> + hosts = hosts_service.list(
> + search="hw_id=%s" % vdsm_id,
> + case_sensitive=False,
> + )
> + if len(hosts) == 0:
> + return None
>
Debug message about unknown host would be nice.
Did...
2018 Jun 21
0
[PATCH 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...raise RuntimeError("timed out waiting for disk to become unlocked")
+ # Get the current host. If it fails, don't worry.
+ host = None
+ try:
+ with builtin_open("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw_id=%s" % vdsm_id,
+ case_sensitive=False,
+ )
+ if len(hosts) > 0:
+ host = hosts[0]
+ debug("host.id = %r" % host.id)
+...
2018 Jun 26
0
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...+ """Return the current host object or None."""
+ try:
+ with builtin_open("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+ except Exception as e:
+ return None
+ debug("hw_id = %r" % vdsm_id)
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw_id=%s" % vdsm_id,
+ case_sensitive=False,
+ )
+ if len(hosts) == 0:
+ return None
+
+ host = hosts[0]
+ debug("host.id = %r" % host.id)
+
+ return type...
2018 Jun 22
0
[PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...raise RuntimeError("timed out waiting for disk to become unlocked")
+ # Get the current host. If it fails, don't worry.
+ host = None
+ try:
+ with builtin_open("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw_id=%s" % vdsm_id,
+ case_sensitive=False,
+ )
+ if len(hosts) > 0:
+ host = hosts[0]
+ debug("host.id = %r" % host.id)
+...
2018 Jun 22
4
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-June/msg00099.html
v2:
- Just fixes the two problems noted in the review of the previous version.
Rich.
2018 Jun 21
6
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
These two patches add support for using a Unix domain socket to
directly access imageio in the case where imageio is running on the
conversion host (usually that means virt-v2v is running on the RHV
node and something else -- eg. CFME scripts -- arranges that the RHV
node is the same one running imageio).
Conversions in the normal case are not affected - they happen over TCP
as usual.
This was
2018 Jun 27
0
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...#39;builtin_open' is not defined
We are paying the price of python :-)
>
>
>> + debug("hw_id = %r" % vdsm_id)
>> +
>>
>
> A comment abut looking up the host id would be nice. The code is not
> explaining it self very well.
>
>
>> + hosts_service = connection.system_service().hosts_service()
>> + hosts = hosts_service.list(
>> + search="hw_id=%s" % vdsm_id,
>> + case_sensitive=False,
>> + )
>> + if len(hosts) == 0:
>> + return None
>>
>
> Debug message a...
2018 Jun 29
0
[PATCH] v2v: rhv-upload-plugin: Improve error handling
...vdsm.id") as f:
vdsm_id = f.readline().strip()
except Exception as e:
+ # This is most likely not an oVirt host.
+ debug("cannot read /etc/vdsm/vdsm.id, using any host: %s" % e)
return None
+
debug("hw_id = %r" % vdsm_id)
hosts_service = connection.system_service().hosts_service()
@@ -72,6 +75,8 @@ def find_host(connection):
case_sensitive=False,
)
if len(hosts) == 0:
+ # This oVirt host is not registered with engine.
+ debug("cannot find host with hw_id=%r, using any host" % vdsm_id)...
2019 Nov 17
23
[PATCH 00/18] rvh-upload: Various fixes and cleanups
This series extract oVirt SDK and imageio code to make it eaiser to follow the
code and improve error handing in open() and close().
The first small patches can be consider as fixes for downstream.
Tested based on libguestfs v1.41.5, since I had trouble building virt-v2v and
libguestfs from master.
Nir Soffer (18):
rhv-upload: Remove unused exception class
rhv-upload: Check status more