From 4a4bb6364ec966dd4e89359542095170945c1be2 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Thu, 9 Dec 2010 16:42:52 +0000 Subject: [PATCH 1/6] raw instances can now be launched in xenapi (only as hvm at the moment) --- nova/flags.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nova/flags.py b/nova/flags.py index 1f94feb0..1cb846c1 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -234,6 +234,13 @@ DEFINE_string('default_ramdisk', 'ari-11111', 'default ramdisk to use, testing only') DEFINE_string('default_instance_type', 'm1.small', 'default instance type to use, testing only') +DEFINE_string('null_kernel', 'aki-00000000', + 'kernel image that indicates not to use a kernel, ' + ' but to use a raw disk image instead') +DEFINE_string('null_kernel_pv', 'aki-00000001', + 'kernel image that indicates not to use a kernel, ' + ' but to use a raw disk image for a paravirtualized guest') + DEFINE_string('vpn_image_id', 'ami-CLOUDPIPE', 'AMI for cloudpipe vpn server') DEFINE_string('vpn_key_suffix', From ff997b57b24b6a2cbcf55dcca25a2cebbfe2c7d2 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 13 Dec 2010 16:11:12 +0000 Subject: [PATCH 2/6] only needs work for distinguishing pv from hvm --- .project | 17 +++++++++++++++++ .pydevproject | 10 ++++++++++ cuba-ubuntu.16501 | 0 nova-api.pid | 1 + nova-api.pid.lock | 0 nova-manage.conf | 26 ++++++++++++++++++++++++++ nova-network.pid | 1 + nova-objectstore.pid | 1 + nova-scheduler.pid | 1 + 9 files changed, 57 insertions(+) create mode 100644 .project create mode 100644 .pydevproject create mode 100644 cuba-ubuntu.16501 create mode 100644 nova-api.pid create mode 100644 nova-api.pid.lock create mode 100644 nova-manage.conf create mode 100644 nova-network.pid create mode 100644 nova-objectstore.pid create mode 100644 nova-scheduler.pid diff --git a/.project b/.project new file mode 100644 index 00000000..1213c940 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Openstack-xs_raw_disk_images + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 00000000..8030d8e4 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,10 @@ + + + + +Default +python 2.6 + +/home/salvatore/xenapi + + diff --git a/cuba-ubuntu.16501 b/cuba-ubuntu.16501 new file mode 100644 index 00000000..e69de29b diff --git a/nova-api.pid b/nova-api.pid new file mode 100644 index 00000000..9bcd7ef1 --- /dev/null +++ b/nova-api.pid @@ -0,0 +1 @@ +16501 diff --git a/nova-api.pid.lock b/nova-api.pid.lock new file mode 100644 index 00000000..e69de29b diff --git a/nova-manage.conf b/nova-manage.conf new file mode 100644 index 00000000..6942b8cc --- /dev/null +++ b/nova-manage.conf @@ -0,0 +1,26 @@ +--verbose +--nodaemon +--FAKE_subdomain=ec2 +--ca_path=/home/salvatore/openstack/nova/CA +--keys_path=/home/salvatore/openstack/nova/keys +--networks_path=/home/salvatore/openstack/nova/networks +--images_path=/home/salvatore/openstack/nova/images +--buckets_path=/home/salvatore/openstack/nova/buckets +--logdir=/home/salvatore/openstack/nova +#--libvirt_type=qemu +--connection_type=xenapi +--xenapi_connection_url=http://camctxlabs-svr05.cam.eu.citrix.com +--xenapi_connection_password=_car0pet_ +--auth_driver=nova.auth.dbdriver.DbDriver +--sql_connection=mysql://root:nova@10.70.177.19/nova +--s3_host=10.70.177.19 +--network_manager=nova.network.manager.FlatManager +#--network_manager=nova.network.manager.VlanManager +--fixed_range=192.168.1.240/28 +--routing_source_ip=10.70.177.19 +--flat_network_bridge=xenbr0 +--flat_network_gateway=192.168.1.1 +--flat_network_netmask=255.255.255.0 +--flat_network_network=192.168.1.0 +--flat_network_ips=192.168.1.220,192.168.1.221,192.168.1.222 +--flat_network_broadcast=192.168.1.255 diff --git a/nova-network.pid b/nova-network.pid new file mode 100644 index 00000000..b81b1082 --- /dev/null +++ b/nova-network.pid @@ -0,0 +1 @@ +16479 \ No newline at end of file diff --git a/nova-objectstore.pid b/nova-objectstore.pid new file mode 100644 index 00000000..0967315f --- /dev/null +++ b/nova-objectstore.pid @@ -0,0 +1 @@ +16469 \ No newline at end of file diff --git a/nova-scheduler.pid b/nova-scheduler.pid new file mode 100644 index 00000000..d6bb441a --- /dev/null +++ b/nova-scheduler.pid @@ -0,0 +1 @@ +16490 \ No newline at end of file From dbdbef407987cc52de3e34dbcbc9cad90a95aa03 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 15 Dec 2010 14:27:07 +0000 Subject: [PATCH 3/6] removed temporary comment lines --- nova/flags.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nova/flags.py b/nova/flags.py index 1cb846c1..bd2fe4b9 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -237,10 +237,6 @@ DEFINE_string('default_instance_type', 'm1.small', DEFINE_string('null_kernel', 'aki-00000000', 'kernel image that indicates not to use a kernel, ' ' but to use a raw disk image instead') -DEFINE_string('null_kernel_pv', 'aki-00000001', - 'kernel image that indicates not to use a kernel, ' - ' but to use a raw disk image for a paravirtualized guest') - DEFINE_string('vpn_image_id', 'ami-CLOUDPIPE', 'AMI for cloudpipe vpn server') DEFINE_string('vpn_key_suffix', From 81a6e265c309af0bcc35cbf16889b0fd8ff569cb Mon Sep 17 00:00:00 2001 From: David Pravec Date: Thu, 16 Dec 2010 12:35:46 +0100 Subject: [PATCH 4/6] Make nova work even when user has LANG or LC_ALL configured Some commands are having different results when used in another language environment. For example ifconfig output parsing fails in my language. Also unittest using cat failed, as it didnt expect czech language in the error message. This small patch makes it work. Also adding myself to 'Authors' file. --- Authors | 1 + nova/tests/process_unittest.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Authors b/Authors index 565444ee..6e0a7735 100644 --- a/Authors +++ b/Authors @@ -4,6 +4,7 @@ Anthony Young Armando Migliaccio Chris Behrens Chmouel Boudjnah +David Pravec Dean Troyer Devin Carlen Eldar Nugaev diff --git a/nova/tests/process_unittest.py b/nova/tests/process_unittest.py index 67245af0..516b2452 100644 --- a/nova/tests/process_unittest.py +++ b/nova/tests/process_unittest.py @@ -49,7 +49,7 @@ class ProcessTestCase(test.TrialTestCase): def test_execute_stderr(self): pool = process.ProcessPool(2) - d = pool.simple_execute('cat BAD_FILE', check_exit_code=False) + d = pool.simple_execute('LC_ALL=C cat BAD_FILE', check_exit_code=False) def _check(rv): self.assertEqual(rv[0], '') From b01b8a802c28f7f48c04aa05b7a0a7e55f044e3f Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 20 Dec 2010 15:41:43 +0000 Subject: [PATCH 5/6] Fixed pep8 errors --- nova/tests/virt_unittest.py | 43 +++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/nova/tests/virt_unittest.py b/nova/tests/virt_unittest.py index 9bbba4ba..e5d5f00c 100644 --- a/nova/tests/virt_unittest.py +++ b/nova/tests/virt_unittest.py @@ -129,44 +129,41 @@ class LibvirtConnTestCase(test.TestCase): check_list.append(check) else: if expect_kernel: - check = (lambda t: t.find('./os/kernel').text.split('/' - )[1], 'kernel') + check = (lambda t: t.find('./os/kernel').text.split('/') + [1], 'kernel') else: check = (lambda t: t.find('./os/kernel'), None) check_list.append(check) if expect_ramdisk: - check = (lambda t: t.find('./os/initrd').text.split('/' - )[1], 'ramdisk') + check = (lambda t: t.find('./os/initrd').text.split('/') + [1], 'ramdisk') else: check = (lambda t: t.find('./os/initrd'), None) check_list.append(check) common_checks = [ (lambda t: t.find('.').tag, 'domain'), - (lambda t: t.find('./devices/interface/filterref/parameter' - ).get('name'), 'IP'), - (lambda t: t.find('./devices/interface/filterref/parameter' - ).get('value'), '10.11.12.13'), - (lambda t: t.findall('./devices/interface/filterref/parameter' - )[1].get('name'), 'DHCPSERVER'), - (lambda t: t.findall('./devices/interface/filterref/parameter' - )[1].get('value'), '10.0.0.1'), - (lambda t: t.find('./devices/serial/source').get('path' - ).split('/')[1], 'console.log'), + (lambda t: t.find('./devices/interface/filterref/parameter') + .get('name'), 'IP'), + (lambda t: t.find('./devices/interface/filterref/parameter') + .get('value'), '10.11.12.13'), + (lambda t: t.findall('./devices/interface/filterref/parameter') + [1].get('name'), 'DHCPSERVER'), + (lambda t: t.findall('./devices/interface/filterref/parameter') + [1].get('value'), '10.0.0.1'), + (lambda t: t.find('./devices/serial/source').get('path') + .split('/')[1], 'console.log'), (lambda t: t.find('./memory').text, '2097152')] if rescue: - common_checks += [(lambda t: t.findall('./devices/disk/source' - )[0].get('file').split('/')[1], - 'rescue-disk'), - (lambda t: t.findall('./devices/disk/source' - )[1].get('file').split('/')[1], - 'disk')] + common_checks += [(lambda t: t.findall('./devices/disk/source') + [0].get('file').split('/')[1], 'rescue-disk'), + (lambda t: t.findall('./devices/disk/source') + [1].get('file').split('/')[1], 'disk')] else: - common_checks += [(lambda t: t.findall('./devices/disk/source' - )[0].get('file').split('/')[1], - 'disk')] + common_checks += [(lambda t: t.findall('./devices/disk/source') + [0].get('file').split('/')[1], 'disk')] for (libvirt_type, (expected_uri, checks)) in type_uri_map.iteritems(): FLAGS.libvirt_type = libvirt_type From 3109d1cb3ad09a5510235bca15e2abd70a9d0ed6 Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Fri, 24 Dec 2010 19:17:02 +0000 Subject: [PATCH 6/6] remove requirement of sudo on tests --- nova/tests/test_xenapi.py | 1 + nova/tests/xenapi/stubs.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index b5d3ea39..ed2e4ffd 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -48,6 +48,7 @@ class XenAPIVolumeTestCase(test.TestCase): FLAGS.xenapi_connection_url = 'test_url' FLAGS.xenapi_connection_password = 'test_pass' fakes.stub_out_db_instance_api(self.stubs) + stubs.stub_out_get_target(self.stubs) fake.reset() self.values = {'name': 1, 'id': 1, 'project_id': 'fake', diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index 1dacad6a..a7e592fe 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -18,12 +18,13 @@ from nova.virt import xenapi_conn from nova.virt.xenapi import fake +from nova.virt.xenapi import volume_utils def stubout_session(stubs, cls): - """ Stubs out two methods from XenAPISession """ + """Stubs out two methods from XenAPISession""" def fake_import(self): - """ Stubs out get_imported_xenapi of XenAPISession """ + """Stubs out get_imported_xenapi of XenAPISession""" fake_module = 'nova.virt.xenapi.fake' from_list = ['fake'] return __import__(fake_module, globals(), locals(), from_list, -1) @@ -34,6 +35,14 @@ def stubout_session(stubs, cls): fake_import) +def stub_out_get_target(stubs): + """Stubs out _get_target in volume_utils""" + def fake_get_target(volume_id): + return (None, None) + + stubs.Set(volume_utils, '_get_target', fake_get_target) + + class FakeSessionForVMTests(fake.SessionBase): """ Stubs out a XenAPISession for VM tests """ def __init__(self, uri):