From 36e84badcb724ba69dc6a31048197755fac484c6 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 4 Oct 2015 01:40:47 +0200 Subject: [PATCH] openstack: rackspace does not support security groups Skip security groups if running against RackSpace and document the restriction. http://tracker.ceph.com/issues/13027 Fixes: #13027 Signed-off-by: Loic Dachary --- README.rst | 17 +++++++++++++---- teuthology/openstack/__init__.py | 12 +++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index bd21e2dfdc..b8678de824 100644 --- a/README.rst +++ b/README.rst @@ -351,14 +351,23 @@ otherwise need to be created via the neutron API. Setup OpenStack at OVH ---------------------- -It is cheaper than EnterCloudSuite but does not provide volumes (as -of August 2015) and is therefore unfit to run teuthology tests that -require disks attached to the instance. Each instance has a public IP -by default. +Each instance has a public IP by default. * `create an account `_ * get $HOME/openrc.sh from `the horizon dashboard `_ +Setup OpenStack at Rackspace +---------------------------- + +There is no support for security groups. To workaround that +limitation, the setup instructions must be run from an instance that +is within the Rackspace OpenStack cluster already so it has permission +to communicate with the instances it creates. + +* `create an account `_ +* make sure your environment contains the requires OS_* variables for + ``openstack server list`` to run. + Setup ----- diff --git a/teuthology/openstack/__init__.py b/teuthology/openstack/__init__.py index 400be3ca08..8a575cc29d 100644 --- a/teuthology/openstack/__init__.py +++ b/teuthology/openstack/__init__.py @@ -336,7 +336,8 @@ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html and return its IP address. """ if not self.cluster_exists(): - self.create_security_group() + if self.provider != 'rackspace': + self.create_security_group() self.create_cluster() instance_id = self.get_instance_id(self.args.name) return self.get_floating_ip_or_ip(instance_id) @@ -392,7 +393,8 @@ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html if 'OS_AUTH_URL' not in os.environ: raise Exception('no OS_AUTH_URL environment variable') providers = (('cloud.ovh.net', 'ovh'), - ('entercloudsuite.com', 'entercloudsuite')) + ('entercloudsuite.com', 'entercloudsuite'), + ('rackspacecloud.com', 'rackspace')) self.provider = None for (pattern, provider) in providers: if pattern in os.environ['OS_AUTH_URL']: @@ -582,6 +584,10 @@ openstack security group rule create --proto udp --dst-port 53 teuthology # dns and wait for it to come up. """ user_data = self.get_user_data() + if self.provider == 'rackspace': + security_group = '' + else: + security_group = " --security-group teuthology" instance = misc.sh( "openstack server create " + " --image '" + self.image('ubuntu', '14.04') + "' " + @@ -589,7 +595,7 @@ openstack security group rule create --proto udp --dst-port 53 teuthology # dns " " + self.net() + " --key-name " + self.args.key_name + " --user-data " + user_data + - " --security-group teuthology" + + security_group + " --wait " + self.args.name + " -f json") instance_id = self.get_value(json.loads(instance), 'id') -- 2.39.5