Bug 20983 - Warnung bei fehlender "KVM-Fähigkeit" einer CPU
Warnung bei fehlender "KVM-Fähigkeit" einer CPU
Status: CLOSED WONTFIX
Product: UCS
Classification: Unclassified
Component: Virtualization - UVMM
UCS 4.4
Other Linux
: P2 normal (vote)
: ---
Assigned To: UCS maintainers
:
: 25633 25969 41042 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-15 16:40 CET by Moritz Muehlenhoff
Modified: 2023-06-28 10:45 CEST (History)
8 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, External feedback, Usability
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Muehlenhoff univentionstaff 2010-12-15 16:40:30 CET
Bei einem Kundenworkshop sollte UVMM auf einem Testserver eingerichtet werden, von dem initial unbekannt war, ob die CPU KVM-fähig ist.

Wir sollten ein kleines Tool ala "uvmm-check-kvm-capabilities" mitliefern, dass /proc/cpuinfo auswertet und eine Rückmeldung gibt.

Außerdem wäre es nett, wenn diese Angabe auch im Installer (z.B. bei der Hardwareerkennung) erscheinen würde.
Comment 1 Philipp Hahn univentionstaff 2010-12-15 17:01:24 CET
#!/bin/sh
if grep -q '\<\(svm\|vmx\)\>' /proc/cpuinfo
then
  echo 'Ja :-)'
  exit 0
elif xm dmesg | grep -qs 'HVM: \<\(SVM\|VMX\)\> enabled' # VMX ist geraten, s.u.
then
  echo 'Ja :-|'
  exit 0
else
  echo 'Nein :-('
  exit 1
fi

NICHT getestet auf Intel-Xen-Rechner, die xen*-Recher haben alle AMD nur CPUs. Intel ohne Xen ist gestestst (Notebook).
Comment 2 Philipp Hahn univentionstaff 2012-01-30 16:10:15 CET
(In reply to comment #1)

Ggf. sind die CPU-Erweiterungen im BIOS deaktiviert:
arch/x86/kvm/x86.c:3147 printk(KERN_ERR "kvm: disabled by bios\n");
Ohne root-Rechte lässt sich das aber nicht überprüfen (modprobe + dmesg-grep bzw. CPU-Machine-Register auslesen).

#!/bin/sh
if [ -c /dev/kvm ]
then
  echo 'Ja, KVM wird bereits genutzt :-)'
  exit 0
elif grep -qs '\<hvm-' /sys/hypervisor/properties/capabilities
then
  echo 'Ja, Xen wird bereits genutzt :-)'
  exit 0
elif xm dmesg 2>/dev/null | grep -q 'HVM: \<\(SVM\|VMX\)\> enabled'
then
  echo 'Ja, Xen wird bereits genutzt :-)'
  exit 0
elif grep -q '\<\(svm\|vmx\)\>' /proc/cpuinfo
then
  echo 'Hmm, CPU unterstützt Features, aber derzeiit nicht aktiviert ?'
  exit 1
else
  echo 'Nein :-('
  exit 1
fi

> NICHT getestet auf Intel-Xen-Rechner, die xen*-Recher haben alle AMD nur CPUs.
> Intel ohne Xen ist gestestst (Notebook).

Laut Quellcode steht dort VMX.
Comment 3 Stefan Gohmann univentionstaff 2013-02-21 13:30:30 CET
Meines Wissens wird das mittlerweile direkt in UVMM / UMC angezeigt.
Comment 4 Philipp Hahn univentionstaff 2013-04-10 12:23:57 CEST
(In reply to comment #3)
> Meines Wissens wird das mittlerweile direkt in UVMM / UMC angezeigt.

(In reply to comment #2)
> Ggf. sind die CPU-Erweiterungen im BIOS deaktiviert:

Das ist bei der Technik-Schulung in Stuttgart negativ aufgefallen: Bei den dortigen Rechnern war VMX/SVM im BIOS deaktiviert. Trotzdem stand in /proc/cpuinfo "vmx".
Das ist dann erst sehr viel später aufgefallen, als beim Versuch einen neue VM anzulegen plötzlich die 64-Bit-Profile fehlten.
Legt man dann trotzdem eine VM mit dem noch angezeigten (32-Bit?) Profil an, so lässt sich die VM zwar anlegen, aber das Starten schlägt dann fehl, weil KVM nicht funktioniert.

Hier sollten eine bessere Überprüfung auf funktionierendes VMX / SVM stattfinden und eine deutlich sichtbare Warnung ausgegeben werden, daß Virtualisierung im BIOS deaktiviert ist.
Comment 5 Moritz Muehlenhoff univentionstaff 2013-05-16 13:20:57 CEST
(In reply to comment #4)
> (In reply to comment #3)
> > Meines Wissens wird das mittlerweile direkt in UVMM / UMC angezeigt.
> 
> (In reply to comment #2)
> > Ggf. sind die CPU-Erweiterungen im BIOS deaktiviert:
> 
> Das ist bei der Technik-Schulung in Stuttgart negativ aufgefallen: Bei den
> dortigen Rechnern war VMX/SVM im BIOS deaktiviert. Trotzdem stand in
> /proc/cpuinfo "vmx".
> Das ist dann erst sehr viel später aufgefallen, als beim Versuch einen neue VM
> anzulegen plötzlich die 64-Bit-Profile fehlten.
> Legt man dann trotzdem eine VM mit dem noch angezeigten (32-Bit?) Profil an, so
> lässt sich die VM zwar anlegen, aber das Starten schlägt dann fehl, weil KVM
> nicht funktioniert.
> 
> Hier sollten eine bessere Überprüfung auf funktionierendes VMX / SVM
> stattfinden und eine deutlich sichtbare Warnung ausgegeben werden, daß
> Virtualisierung im BIOS deaktiviert ist.

Das trat bei der Schulung in Wien ebenfalls auf: Die CPUs waren so alt, das kein Support für HVM vorhanden war. In dem Fall gibt es bei KVM nur die Fehlermeldung

Unknown OS type: hvm 

beim Start einer Maschine.

Unter Xen werden nur die UCS-Profile angezeigt (Windows nicht, da Support für Hardwarevirt. benötigt wird)
Comment 6 Philipp Hahn univentionstaff 2013-06-06 09:56:36 CEST
*** Bug 25633 has been marked as a duplicate of this bug. ***
Comment 7 Philipp Hahn univentionstaff 2013-06-06 09:56:40 CEST
*** Bug 25969 has been marked as a duplicate of this bug. ***
Comment 8 Philipp Hahn univentionstaff 2013-07-23 11:19:01 CEST
# Successfully testes on xen4(AMD) and xen12(Intel)
ucr set repository/online/unmaintained=yes
apt-get install msr-tools

modprobe msr
if grep --word --quiet vmx /proc/modules
then # <xen/arch/x86/hvm/vmx/vmcx.c>
  echo -n "Intel CPU supporting VMX detected, "
  case "$(rdmsr -f 2:0 0x3a)" in # IA32_FEATURE_CONTROL_MSR
  0|2|4|6) echo "Not yet locked by BIOS" ; return 0 ;;
  1) echo "bocked by BIOS" ; return 1 ;;
  3) echo "bocked by BIOS outside Trusted Environments" ; return 1 ;;
  5) echo "enabled by BIOS outside Trusted Environment" ; return 0 ;;
  7) echo "enabled by BIOS irrepective Trusted Environments" ; return 0 ;;
  esac
elif grep --word --quiet svm /proc/modules
then # <xen/arch/x86/hvm/svm/svm.c>
  echo -n "AMD CPU supporting SVM detected, "
  case "$(rdmsr -f 4:4 0xc0010114)" in # MSR_K8_VM_CR
  0) echo "enabled by BIOS" ; return 0 ;;
  1) echo "disabled by BIOS" ; return 1 ;;
  esac
else
  echo "Neither an Intel nor an AMD CPU supporting virtualization were detected."
  return 1
fi
Comment 9 Philipp Hahn univentionstaff 2016-04-13 08:46:50 CEST
*** Bug 41042 has been marked as a duplicate of this bug. ***
Comment 10 Philipp Hahn univentionstaff 2016-07-28 11:02:44 CEST
Erneut in einer internen UCS-Schulung aufgetreten: Im BIOS was die HW-Unterstützung für die Virtualisierung deaktiviert. UVMM hat dann nicht alle Profile angezeigt und bei der Verwendung von Other bzw. UCS-3.2 wurde dann fehlende Unterstützung für "hvm" moniert.
Comment 11 Philipp Hahn univentionstaff 2016-07-28 12:59:28 CEST
(In reply to Philipp Hahn from comment #10)
> Erneut in einer internen UCS-Schulung aufgetreten:

Es war eine "richtige" UCS-Schulung
Comment 12 Stefan Gohmann univentionstaff 2019-01-03 07:20:53 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 13 Philipp Hahn univentionstaff 2023-06-28 10:44:07 CEST
UVMM and virtualization with UCS is deprecated and will no longer be developed in UCS 4.4; they have already been removed from UCS 5.0.