Bug 1268001 - [patch] Make virt-manager recognize RHEL Atomic Host
[patch] Make virt-manager recognize RHEL Atomic Host
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager (Show other bugs)
7.2
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
: FutureFeature, Upstream
Depends On:
Blocks: 1288337
  Show dependency treegraph
 
Reported: 2015-10-01 10:31 EDT by Alexander Todorov
Modified: 2016-11-03 21:58 EDT (History)
11 users (show)

See Also:
Fixed In Version: virt-manager-1.3.2-1.el7
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 21:58:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexander Todorov 2015-10-01 10:31:08 EDT
Please apply these changes:

--- .treeinfo.orig	2015-10-01 10:10:27.218978154 -0400
+++ .treeinfo	2015-10-01 10:26:12.159677094 -0400
@@ -1,9 +1,9 @@
 [general]
-name = RHEL Atomic Host-7
-family = RHEL Atomic Host
+name = Red Hat Enterprise Linux Atomic Host 7.2
+family = Red Hat Enterprise Linux Atomic Host
 timestamp = 1443626400.77
 variant = 
-version = 7
+version = 7.2
 packagedir = 
 arch = x86_64
 
@@ -14,7 +14,7 @@
 kernel = images/pxeboot/vmlinuz
 initrd = images/pxeboot/initrd.img
 upgrade = images/pxeboot/upgrade.img
-installer.iso = images/installer.iso
+boot.iso = images/installer.iso
 
 [images-xen]
 kernel = images/pxeboot/vmlinuz



This makes Atomic Host similar to RHEL and virt-manager is able to detect the OS type/version properly.

Note: As of now virt-manager detects both RHEL 7.2 and Atomic 7.2 (with the patch applied) as "Red Hat Enterprise Linux 7.0". It's probably a bug in virt-manager but I have not been able to find it yet. Will update Bugzilla when I have more info.
Comment 1 Colin Walters 2015-10-01 10:36:16 EDT
The change to use installer.iso is intentional, as it is different from boot.iso - it includes content.  AFAIK virt-manager just uses the kernel/initrd, and the initrd retrieves squashfs, right?

Unfortunately I can't change the name/family because of ISO length limit restrictions.  "Red Hat Enterprise Linux" is close to the limit already, and anything after that would break it.

So we'll have to teach virt-manager about this.
Comment 2 Colin Walters 2015-10-01 13:00:53 EDT
See also https://bugzilla.redhat.com/show_bug.cgi?id=1193268 for the first hunk.
Comment 3 Giuseppe Scrivano 2015-10-01 13:23:46 EDT
I think this is the change required in virt-manager to recognize the Atomic Host ISO as RHEL:

diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index ed062fe..e4a85f0 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -818,7 +818,7 @@ class RHELDistro(RedHatDistro):
 
     def isValidStore(self):
         if self.treeinfo:
-            m = re.match(".*Red Hat Enterprise Linux.*",
+            m = re.match(".*(Red Hat Enterprise Linux|RHEL).*",
                          self.treeinfo.get("general", "family"))
             ret = (m is not None)
 

Could you confirm if it works for you?
Comment 4 Alexander Todorov 2015-10-02 04:54:22 EDT
Yes, this patch works for me.
Comment 5 Alexander Todorov 2015-10-02 04:57:56 EDT
(In reply to Colin Walters from comment #2)
> See also https://bugzilla.redhat.com/show_bug.cgi?id=1193268 for the first
> hunk.

I'm looking at it:
https://bugzilla.redhat.com/show_bug.cgi?id=1193268#c14

Looks like the name is truncated and it looks good. Is this going to update .treeinfo as well ?
Comment 6 Pavel Hrdina 2015-10-05 02:11:58 EDT
It's too late for RHEL-7.2, moving to RHEL-7.3.
Comment 7 Giuseppe Scrivano 2015-10-05 04:02:11 EDT
I sent the patch upstream:

https://www.redhat.com/archives/virt-tools-list/2015-October/msg00001.html
Comment 8 Giuseppe Scrivano 2015-10-05 15:59:54 EDT
fixed upstream by:

commit c0a27bb9b4d24ae94ceda2d4823d0038188ae505
Author: Giuseppe Scrivano <gscrivan@redhat.com>
Date:   Mon Oct 5 09:41:09 2015 +0200

    urlfetcher: Recognize RHEL Atomic Host ISOs
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1268001
    
    Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Comment 9 Mike McCune 2016-03-28 19:17:33 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 11 Alex Jia 2016-05-04 06:35:04 EDT
I gave a try for installing rhel-atomic-installer-7.1-1.x86_64.iso and rhel-atomic-installer-7.2-13.x86_64.iso w/ virt-manager-1.3.2-1.el7.noarch, but the result is failed, it exists sevaral questions.


1. automatically detect OS based on install media

it's okay for rhel-atomic-installer-7.1-1

it's not okay for rhel-atomic-installer-7.2-13
OS type: Unknown
Version: Unknown

2. customize OS type to Linux (for rhel-atomic-installer-7.2-13)

Version only provides Red Hat Enterprise Linux Atomic Host 7.0 and 7.1, there is no 7.2, which should be in production since Nov 11, 2015.

3. can't succesfully install rhel-atomic-installer-7.1-1 or rhel-atomic-installer-7.2-13, got error as follows.

Unable to complete install: 'internal error: process exited while connecting to monitor: 2016-05-04T10:10:56.815367Z qemu-kvm: -chardev pty,id=charserial0: Failed to create PTY: Operation not permitted'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 90, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2277, in _do_async_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 501, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 416, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3585, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2016-05-04T10:10:56.815367Z qemu-kvm: -chardev pty,id=charserial0: Failed to create PTY: Operation not permitted

# rpm -q virt-manager virt-install libvirt qemu-kvm-rhev libosinfo
virt-manager-1.3.2-1.el7.noarch
virt-install-1.3.2-1.el7.noarch
libvirt-1.3.4-1.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64
libosinfo-0.2.12-4.el7.x86_64
Comment 12 tingting zheng 2016-05-04 22:48:48 EDT
Hi,Pavel

Would you pls help to check comment 11,thanks.
Comment 13 Pavel Hrdina 2016-06-01 08:52:45 EDT
Hi, the information is obtained from libosinfo package so I guess that you need to create a bug to update libosinfo to include the new version of RHEL Atomic.
Comment 14 zhoujunqin 2016-06-02 01:54:57 EDT
(In reply to Pavel Hrdina from comment #13)
> Hi, the information is obtained from libosinfo package so I guess that you
> need to create a bug to update libosinfo to include the new version of RHEL
> Atomic.

Thanks for your reply.
File a bug against libosinfo:
https://bugzilla.redhat.com/show_bug.cgi?id=1341940
Comment 15 XiaoyunHu 2016-06-19 22:46:21 EDT
Bug 1268001 - [patch] Make virt-manager recognize RHEL Atomic Host

Verify with new build:
virt-manager-1.3.2-1.el7.noarch

Steps:
1. Prepare install media rhel-atomic-installer-7.1-1.x86_64.iso .
2. Lauch virt-manager.
3. Click Create A New Virtual Machine and Select "Local Install Media".
4. In step 2 of 5, Browse "rhel-atomic-installer-7.1-1.x86_64.iso", check automatically detect OS.
5. Then untick automatically detect OS based on install media. Select linux as OS type, check version drop list.
6. Continue the installation to check if it can be installed successfully.

Result:
After step4, automatically detect OS as as "Red Hat Enterprise Linux Atomic Host 7.1".
After step5, there are "Red Hat Enterprise Linux Atomic Host 7.0" and "Red Hat Enterprise Linux Atomic Host 7.1" in drop list.
After step6, the guest can be installed successfully.

According to the result above in the latest version of virt-manager, move this bug from ON_QA to VERIFIED.
Comment 17 errata-xmlrpc 2016-11-03 21:58:45 EDT
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-2016-2269.html

Note You need to log in before you can comment on or make changes to this bug.