Bug 1195939
| Summary: | virt-who connecting to RHEVM registers Gluster nodes with Satellite | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Paul Armstrong <parmstro> | ||||
| Component: | virt-who | Assignee: | Radek Novacek <rnovacek> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Li Bin Liu <liliu> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 7.0 | CC: | gxing, lmiksik, ovasik, sgao, shihliu | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | virt-who-0.14-1.el7 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-11-19 11:56:07 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: | |||||||
| Attachments: |
|
||||||
Created attachment 994958 [details]
added code to select only nodes from virt_service enabled clusters for RHEVM
self.username = self.config.username
self.password = self.config.password
+ self.clusters_url = urlparse.urljoin(self.url, "/api/clusters")
self.hosts_url = urlparse.urljoin(self.url, "/api/hosts")
self.vms_url = urlparse.urljoin(self.url, "/api/vms")
...
...
mapping = {}
+ clusters = {}
+ clusters_xml = ElementTree.parse(self.get(self.clusters_url))
hosts_xml = ElementTree.parse(self.get(self.hosts_url))
vms_xml = ElementTree.parse(self.get(self.vms_url))
+ for cluster in clusters_xml.findall('cluster'):
+ cluster_id = cluster.get('id')
+ virt_service = cluster.find('virt_service').text
+ if virt_service == 'true':
+ clusters[cluster_id] = []
for host in hosts_xml.findall('host'):
id = host.get('id')
+ host_cluster = host.get('cluster')
+ host_cluster_id = host_cluster.get('id')
+ if host_cluster_id in clusters.keys():
mapping[id] = []
for host in hosts_xml.findall('host'):
id = host.get('id')
- host_cluster = host.get('cluster')
- host_cluster_id = host_cluster.get('id')
+ host_cluster = host.findall('cluster')
+ host_cluster_id = host_cluster[0].get('id')
if host_cluster_id in clusters.keys():
mapping[id] = []
(There will be only one cluster object and that object must exist)
Sorry /usr/share/virt-who/virt/rhevm/rhevm.py Thanks for the patch, I've applied it upstream and it will be part of rebased version of virt-who. https://github.com/virt-who/virt-who/commit/c579c6cffd355cba48d89b6083ca317d785d5892 Fixed in virt-who-0.14-1.el7. Verified it on virt-who-0.14-2.el7.noarch since virt-who hasn't send the gluster node to satellite.Therefore, verify it. Verified version virt-who-0.14-2.el7.noarch subscription-manager-1.15.6-1.el7.x86_64 python-rhsm-1.15.3-1.el7.x86_64 SAM-1.4.1-RHEL-6-20141113.0 Precondition: 1 Deploy satellite6.0.8 2 Deploy RHEVM3.5.4, Then create cluster which has enable Gluster service, Then add two hosts to this gluster 3 Deploy gluster server Verified process: 1 Register system to satellite6.0.8 2 Configure virt-who run at rhevm mode to monitor rhevm # cat /etc/sysconfig/virt-who | grep -v ^# | grep -v ^$ VIRTWHO_BACKGROUND=1 VIRTWHO_DEBUG=1 VIRTWHO_RHEVM=1 VIRTWHO_RHEVM_OWNER=ACME_Corporation VIRTWHO_RHEVM_ENV=Library VIRTWHO_RHEVM_SERVER=https://10.66.79.83:443 VIRTWHO_RHEVM_USERNAME=admin@internal VIRTWHO_RHEVM_PASSWORD=redhat 3. Restart virt-who system and check virt-who's log # systemctl restart virt-who # tail -f /var/log/rhsm/rhsm.log 2015-08-05 17:36:25,255 [INFO] @virtwho.py:655 - Using configuration "env/cmdline" ("rhevm" mode) 2015-08-05 17:36:25,268 [DEBUG] @virtwho.py:203 - Starting infinite loop with 3600 seconds interval 2015-08-05 17:36:25,771 [DEBUG] @rhevm.py:123 - Cluster of host a24571ac-a983-425c-b9a9-25d34fa8c49a is not virt_service, skipped 2015-08-05 17:36:25,772 [DEBUG] @rhevm.py:123 - Cluster of host ff01f1a7-76ca-4d32-8201-d509057a3b05 is not virt_service, skipped 2015-08-05 17:36:25,782 [DEBUG] @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem 2015-08-05 17:36:30,376 [DEBUG] @subscriptionmanager.py:146 - Checking if server has capability 'hypervisor_async' 2015-08-05 17:36:34,953 [DEBUG] @subscriptionmanager.py:158 - Server does not have 'hypervisors_async' capability 2015-08-05 17:36:34,953 [INFO] @subscriptionmanager.py:165 - Sending update in hosts-to-guests mapping: {} Result: virt-who hasn't send the host/guest mapping to satellite since Cluster of these two hosts are not virt_service 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://rhn.redhat.com/errata/RHBA-2015-2370.html |
Description of problem: virt-who registers Gluster Nodes to Satellite. This results in a double registration as a hypervisor and a managed Content Host. Version-Release number of selected component (if applicable): RHEL 7.0 RHEV 3.5 Satellite 6.0.8 How reproducible: Always Steps to Reproduce: 1. run virt-who in a RHEV environment with Gluster nodes 2. 3. Actual results: gluster nodes are registered in Satellite Expected results: gluster nodes should not be registered in Satellite as they are not currently allowed to run Guests and should not be treated as Hypervisors. Additional info: Issue is in /usr/share/virt-who/virt/rhevm/virt.py hosts_xml = ElementTree.parse(self.get(self.hosts_url)) vms_xml = ElementTree.parse(self.get(self.vms_url)) for host in hosts_xml.findall('host'): id = host.get('id') mapping[id] = [] The above section should filter hosts_xml based on comparing hosts clusterid with clusterid of clusters where <virt_service>true</virt_service> by definition, this will be false today for clusters that have gluster nodes. If at some time in the future gluster nodes can run VMs virt_service will be true and they should be properly included. Satellite or other products will at that time need to combine any information that they gather from virt-who much as they have to for libvirt hosts today.