From f39d6549d4e57941b14f328fa5a52a3a5f925d42 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sun, 18 Jul 2010 18:15:12 +0100 Subject: In preparation for XenAPI support, refactor the interface between nova.compute and the hypervisor (i.e. libvirt). compute.node is no longer coupled tightly with libvirt. Instead, hypervisor connections are handled through a simple abstract interface. This has the additional advantage that there is no need to riddle the code with FLAGS.fake_libvirt checks, as we now have an interface behind which we can mock. The libvirt-specific code, and the fakevirt code used for unit tests, have moved into nova.virt. The fake_libvirt flag has been replaced with a connection_type flag, that will allow us to specify different connection types. The disk image handling (S3 or local disk image fetch) has moved into nova.virt.images, where it will be easier to share between connection types. The power_state values (Instance.RUNNING etc) and the INSTANCE_TYPES dictionary have moved into their own files (nova.compute.instance_types and nova.compute.power_state) so that we can share them without mutual dependencies between nova.compute.node and nova.virt.libvirt_conn. --- nova/flags.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/flags.py') diff --git a/nova/flags.py b/nova/flags.py index 60245a349..f9ebb28f7 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -36,14 +36,13 @@ DEFINE_bool = DEFINE_bool # Define any app-specific flags in their own files, docs at: # http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#39 +DEFINE_string('connection_type', 'libvirt', 'libvirt or fake') DEFINE_integer('s3_port', 3333, 's3 port') DEFINE_integer('s3_internal_port', 3334, 's3 port') DEFINE_string('s3_host', '127.0.0.1', 's3 host') #DEFINE_string('cloud_topic', 'cloud', 'the topic clouds listen on') DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on') DEFINE_string('storage_topic', 'storage', 'the topic storage nodes listen on') -DEFINE_bool('fake_libvirt', False, - 'whether to use a fake libvirt or not') DEFINE_bool('verbose', False, 'show debug output') DEFINE_boolean('fake_rabbit', False, 'use a fake rabbit') DEFINE_bool('fake_network', False, 'should we use fake network devices and addresses') -- cgit From 1046fd21fad35fdb9922f667017937ec94774498 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sun, 18 Jul 2010 18:28:21 +0100 Subject: First commit of XenAPI-specific code (i.e. connections to the open-source community project Xen Cloud Platform, or the open-source commercial product Citrix XenServer). A new connection type has been added (xenapi) which means that libvirt calls will be replaced with calls to XenAPI. This support depends upon the XenAPI library (available from xen.org). However, the library is loaded on-demand, so there is no need for the library to be present unless you actually want to use XenAPI. The same is true of libvirt, so there is no need to have libvirt present if you are only using XenAPI. This work is incomplete. The VMs don't actually start yet, and won't until we settle on the proposed refactoring for bootable volumes. Also, VM console support is not yet refactored. Finally, xenapi.py does not support the metrics monitoring calls used by monitor.py (block_stats, interface_stats). XenAPI already includes HTTP access to RRDs for retrieving aggregated stats, so there is no need for monitor.py at all (xapi does it for you). The plan is to arrange for those RRDs to be passed straight to the reporting layer without the need for the aggregation code in nova-monitorinstance. --- nova/flags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/flags.py') diff --git a/nova/flags.py b/nova/flags.py index f9ebb28f7..caf2d2e93 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -36,7 +36,7 @@ DEFINE_bool = DEFINE_bool # Define any app-specific flags in their own files, docs at: # http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#39 -DEFINE_string('connection_type', 'libvirt', 'libvirt or fake') +DEFINE_string('connection_type', 'libvirt', 'libvirt, xenapi or fake') DEFINE_integer('s3_port', 3333, 's3 port') DEFINE_integer('s3_internal_port', 3334, 's3 port') DEFINE_string('s3_host', '127.0.0.1', 's3 host') -- cgit