Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

EUCA-3399 #18

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion tools/eucalyptus-nc.in
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,44 @@ do_start() {
$EUCALYPTUS/usr/sbin/euca-generate-fault -c nc 1008 daemon ntp
fi

# fixes #469984
# check for virt extensions in CPU
# First, lets check CPU flags to see if we have hardware support

HYPERVISOR=$(grep ^HYPERVISOR ${EUCALYPTUS}/etc/eucalyptus/eucalyptus.conf | cut -d'"' -f 2)
CPU_MODEL=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)')

# Be heavy-handed, exit with failure on lack of CPU virtualization support.

egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)'
if [ $? -ne 0 ] ; then
echo "Terminating! This Node Controller does not have CPU virtualization support. You will not be able to run instances."
echo
$EUCALYPTUS/usr/sbin/euca-generate-fault -c nc 1012 component nc
exit 1
fi

# Now we check to see if it's enabled in BIOS by loading the kvm modules. Warn rather than exit and suggest the user enables this.
# For Intel systems
if [ $CPU_MODEL == vmx -a $HYPERVISOR == kvm ] ; then
modprobe kvm_intel
if [ $? -ne 0 ] ; then
echo "Unable to load KVM module, VT-x may be disabled in your systems BIOS, please enable it. You will not be able to launch instances."
echo
$EUCALYPTUS/usr/sbin/euca-generate-fault -c nc 1012 component nc
fi
fi

# For AMD systems
if [ $CPU_MODEL == svm -a $HYPERVISOR == kvm ] ; then
modprobe kvm_amd
if [ $? -ne 0 ] ; then
echo "Unable to load KVM module, AMD-V may be disabled in your systems BIOS, please enable it. You will not be able to launch instances."
echo
$EUCALYPTUS/usr/sbin/euca-generate-fault -c nc 1012 component nc
fi
fi

# fixes #469984
IPTABLES="`which iptables 2> /dev/null`"
if [ -n "$IPTABLES" ]; then
[ -x $IPTABLES ] && $IPTABLES -L -n > /dev/null 2> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion tools/libvirt.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ that describes a Eucalyptus instance to be launched.
<console type="pty"/>
</xsl:when>
</xsl:choose>
<!-- <graphics type='vnc' port='-1' autoport='yes' keymap='en-us' listen='0.0.0.0'/> -->
<!-- <graphics type='vnc' port='-1' autoport='yes' keymap='en-us' -->
</devices>
</domain>
</xsl:template>
Expand Down
46 changes: 46 additions & 0 deletions util/faults/en_US/1012.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012 Eucalyptus Systems, Inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta
CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need
additional information or have any questions.
-->
<eucafaults version="1" description="Templates for the fault subsystem">
<fault
id="1012"
message="no virtualization support on host.">

<condition
message="The check for virtualization extensions has failed."/>

<cause
message="CPU virtualization extensions are disabled in the BIOS."/>

<initiator
message="${component}"/>

<location
message="CPU capabilities on ${component}"/>

<resolution>
<message>
1) Check your CPU supports vendor virtualization extensions.
2) Enable CPU virtualization extensions in the systems BIOS.
3) Ensure KVM modules can be loaded.
</message>
</resolution>
</fault>
</eucafaults>