Activity log for bug #1288617

Date Who What changed Old value New value Message
2014-03-06 08:51:40 Vincent Ladeuil bug added bug
2014-03-06 08:51:48 Vincent Ladeuil ubuntu-ci-services-itself: assignee Vincent Ladeuil (vila)
2014-03-06 09:21:24 Vincent Ladeuil summary testbed nova instance selection testbed nova instance flavor selection
2014-03-07 10:54:29 Vincent Ladeuil tags airline
2014-03-26 15:02:33 Chris Johnston bug task added uci-engine
2014-03-26 15:02:40 Chris Johnston uci-engine: status New Confirmed
2014-03-26 15:02:42 Chris Johnston uci-engine: importance Undecided High
2014-03-26 15:02:49 Chris Johnston uci-engine: assignee Vincent Ladeuil (vila)
2014-03-26 15:02:51 Chris Johnston uci-engine: milestone backlog
2014-03-31 14:01:40 Evan bug task deleted ubuntu-ci-services-itself
2014-10-07 12:07:58 Vincent Ladeuil description Selecting the testbed nova instance flavor broke when we moved from canonistack to hpcloud because those clouds use different names. In the general case, tests don't consume a lot of resources so we can default to m1.small for canonistack and standard.small for hpcloud (fix in progress for bug #1287955). Points to consider: - we want a sane default that works for supported clouds, - we need that default to be in some config file so we can quickly fix re-occurrence of bug #1287955), - we need a way to override that default for specific packages/tickets while providing some way to avoid abuses (how do we prevent someone from picking an xxl image so their tests complete faster than everyone elses) Selecting the testbed nova instance flavor broke when we moved from canonistack to hpcloud because those clouds use different names. In the general case, tests don't consume a lot of resources so we can default to m1.small for canonistack and standard.small for hpcloud (fix in progress for bug #1287955). Points to consider: - we want a sane default that works for supported clouds (see below), - we need a way to override that default for specific packages/tickets while providing some way to avoid abuses (how do we prevent someone from picking an xxl image so their tests complete faster than everyone elses) ev proposed: from novaclient.v1_1 import client import os import sys def find_flavour(client, min_vcpu, min_mem): '''Find the most minimal flavour that meets the vCPU and memory constraints.''' flavors = nova_client.flavors.list() filtered = [x for x in flavors if x.vcpus >= min_vcpu and x.ram >= min_mem] if len(filtered) < 1: msg = 'Could not find any flavors that matched the constraints' msg = '%s (%d vCPU, %d mem)' % (msg, min_vcpu, min_mem) raise KeyError, msg by_cpu = sorted(filtered, cmp=lambda x, y: cmp(x.vcpus, y.vcpus)) by_mem = sorted(by_cpu, cmp=lambda x, y: cmp(x.ram, y.ram)) return by_mem[0] if __name__ == '__main__': args = [ os.environ['OS_USERNAME'], os.environ['OS_PASSWORD'], os.environ['OS_TENANT_NAME'], os.environ['OS_AUTH_URL'], ] nova_client = client.Client(*args) print find_flavour(client, int(sys.argv[1]), int(sys.argv[2])) Which would give us a cloud agnostic default (well, based on min_vcpu and min_mem but that's better than using cloud specific names).