New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ovirt_nic errors with exception "Network 'infra-prod' was not found in datacenter 'BUA'." #65190
Comments
|
Files identified in the description: If these files are inaccurate, please update the |
|
Hi @Timoses, |
|
Thanks for the quick response @mnecas . I went ahead and tested below reduced example against our RHEV: Result: On the VM when selecting "Edit" in RHEV-M it shows:
In RHEV-M under Compute -> Clusters:
Under Network -> Networks / vNIC Profiles: Even when creating the VM in another cluster (e.g. I've checked at this point: https://github.com/ansible/ansible/blob/v2.9.1/lib/ansible/modules/cloud/ovirt/ovirt_nic.py#L259 and it correctly sets the cluster name. ovirt-engine-sdk-python version is 4.3.3 . Edit: retrieves more than one result, with |
|
Sorry for the late response. |
|
@mnecas : This is the structure (names changed slightly):
What does "cannot" mean? I'm quite sure when I debugged it that it returned multiple results. I'll try to reproduce above once again (earliest on Monday/Tuesday next week) Please let me know if you need any more information. |
|
I tried it once more. I added the following to https://github.com/ansible/ansible/blob/v2.9.2/lib/ansible/modules/cloud/ovirt/ovirt_nic.py#L261 : Result: I'm not sure why the Bug in ovirt SDK? Something else happening? |
|
Can you please try to run following script: cls_service = connection.system_service().clusters_service()
dcs_service = connection.system_service().data_centers_service()
cls = cls_service.list()
dcs = dcs_service.list(search='Clusters.name=%s' % cluster_name)
dcs_all = dcs_service.list()
raise Exception("Available Clusters: %s | Searched cluster: %s | DCs found(%s): %s | DCs: %s" % ([cl.name for cl in cls], cluster_name, len(dcs), [{'name': dc.name, 'clusters': [c.name for c in connection.follow_link(dc.clusters)]} for dc in dcs], [{'name': dc.name, 'clusters': [c.name for c in connection.follow_link(dc.clusters)]} for dc in dcs_all]))Where
|
|
@machacekondra |
|
@Timoses Hmm, as you can see both outputs for: dcs = dcs_service.list(search='Clusters.name=%s' % cluster_name)and for dcs_all = dcs_service.list()are the same. So for cluster |
@machacekondra : Isn't exactly that the problem? (That it returns all dcs for the search?): dcs_found: dcs_all: According to https://github.com/ansible/ansible/blob/v2.9.2/lib/ansible/modules/cloud/ovirt/ovirt_nic.py#L261 we would expect to return only 1 DC (the DC which contains the relevant cluster). Then we can load the correct network interfaces. !!! However: It appears that So:
According to ovirt-sdk documentation the
On the contrary, it appears to return all DCs although the search result should have been restricted to only the DC containing the cluster with the searched name. Am I missing something? |
|
Created a bug report at Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1792209 |
|
It turns out that the RHEVM user used with the |
SUMMARY
ovirt_nic reports exception "Network 'infra-prod' was not found in datacenter 'BUA'.".
However, the VM resides in cluster "Default" which is located in datacenter "BAF".
The datacenter "BAF" does have a network named "infra-prod".
Hence, the
ovirt_nicmodule should not throw the exception.It is possible to manually assign the correct network to an interface for the VM via the GUI (in fact, the drop-down list only lists those networks which are available in datacenter "BAF")
ISSUE TYPE
COMPONENT NAME
ovirt_nic
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEV-Manager version: 4.3.4.3-0.1.el7
STEPS TO REPRODUCE
EXPECTED RESULTS
NIC 'testif' should be created with profile 'infra-prod' in network 'infra-prod'.
ACTUAL RESULTS
Module
ovirt_nicerrors with exception.The text was updated successfully, but these errors were encountered: