summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2011-03-21 18:46:59 +0000
committerTarmac <>2011-03-21 18:46:59 +0000
commit246b146a46474266d7568b5df5cef8864cdaaa6b (patch)
tree1c219808a8c113bf09b090c32f2aef3c6a5ff7ec
parentfb8b0636d02e3663485d4c386a362c7d5ef35041 (diff)
parentb3bb847e3dc20611c4a975d3c772256700b2d018 (diff)
downloadnova-246b146a46474266d7568b5df5cef8864cdaaa6b.tar.gz
nova-246b146a46474266d7568b5df5cef8864cdaaa6b.tar.xz
nova-246b146a46474266d7568b5df5cef8864cdaaa6b.zip
Provide more useful exception messages when unable to load the virtual driver.
-rw-r--r--nova/compute/manager.py14
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance3
2 files changed, 12 insertions, 5 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index c2781f6fb..576937cd8 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -39,6 +39,7 @@ import os
import random
import string
import socket
+import sys
import tempfile
import time
import functools
@@ -114,7 +115,13 @@ class ComputeManager(manager.Manager):
# and redocument the module docstring
if not compute_driver:
compute_driver = FLAGS.compute_driver
- self.driver = utils.import_object(compute_driver)
+
+ try:
+ self.driver = utils.import_object(compute_driver)
+ except ImportError:
+ LOG.error("Unable to load the virtualization driver.")
+ sys.exit(1)
+
self.network_manager = utils.import_object(FLAGS.network_manager)
self.volume_manager = utils.import_object(FLAGS.volume_manager)
super(ComputeManager, self).__init__(*args, **kwargs)
@@ -221,8 +228,9 @@ class ComputeManager(manager.Manager):
instance_id,
{'launched_at': now})
except Exception: # pylint: disable=W0702
- LOG.exception(_("instance %s: Failed to spawn"), instance_id,
- context=context)
+ LOG.exception(_("Instance '%s' failed to spawn. Is virtualization"
+ " enabled in the BIOS?"), instance_id,
+ context=context)
self.db.instance_set_state(context,
instance_id,
power_state.SHUTDOWN)
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index db39cb0f4..0a45f3873 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -216,8 +216,7 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type):
'x-image-meta-status': 'queued',
'x-image-meta-disk-format': 'vhd',
'x-image-meta-container-format': 'ovf',
- 'x-image-meta-property-os-type': os_type,
- }
+ 'x-image-meta-property-os-type': os_type}
for header, value in headers.iteritems():
conn.putheader(header, value)