def destroy(name): """Destroy an existing OpenStack deployment.""" deployment = data.load_deployment(name) data.load_config(name) logger.info(deployment) deployment.destroy() database.remove_key(deployment.name)
def retrofit(name='autotest', retro_branch='dev', ovs_bridge='br-eth1', x_bridge='lxb-mgmt', iface='eth0', del_port=None): """Retrofit a deployment.""" data.load_config(name) deployment = data.load_deployment(name) logger.info(deployment) deployment.retrofit(retro_branch, ovs_bridge, x_bridge, iface, del_port)
def add_nodes(name, compute_nodes=0, controller_nodes=0, cinder_nodes=0, request=None): """Add a node (or nodes) to an existing deployment.""" data.load_config(name) deployment = data.load_deployment(name) node_request = request or list([['compute']] * compute_nodes + [['controller']] * controller_nodes + [['cinder']] * cinder_nodes) deployment.add_nodes(node_request) database.store(deployment)
def ha(name, iterations=1, progress=False): """Test an OpenStack deployment.""" data.load_config(name) deployment = data.load_deployment(name) test_object = HATest(deployment, progress) local = "./results/{0}/".format(deployment.name) run_cmd("mkdir -p {}".format(local)) for controller in deployment.controllers: ip, user, password = (controller.ipaddress, controller.user, controller.password) remote = "{0}@{1}:~/*.xml".format(user, ip) get_file(ip, user, password, remote, local) for i in xrange(iterations): logger.info(Color.cyan('HA: running iteration {0} of {1}!' .format(i + 1, iterations))) test_object.test(iterations) logger.info(Color.cyan("HA tests completed..."))
def tempest(name, iterations=1): """Test an OpenStack deployment.""" data.load_config(name) deployment = data.load_deployment(name) branch = TempestQuantum.tempest_branch(deployment.branch) if "grizzly" in branch: test_object = TempestQuantum(deployment) else: test_object = TempestNeutron(deployment) local = "./results/{}/".format(deployment.name) run_cmd("mkdir -p {}".format(local)) for controller in deployment.controllers: ip, user, password = (controller.ipaddress, controller.user, controller.password) remote = "{0}@{1}:~/*.xml".format(user, ip) get_file(ip, user, password, remote, local) for i in range(iterations): logger.info(Color.cyan('Tempest: running iteration {0} of {1}!' .format(i + 1, iterations))) test_object.test() logger.info(Color.cyan("Tempest tests completed..."))
def cloudcafe(cmd, name, network=None): """Run CloudCafe test suite against a deployment.""" deployment = data.load_deployment(name) data.load_config(name) CloudCafe(deployment).config(cmd, network_name=network)
def explore(name): """Explore a deployment in IPython.""" data.load_config(name) deployment = data.load_deployment(name) from IPython import embed; embed()
def show(name): """Show details about an OpenStack deployment.""" data.load_config(name) deployment = data.load_deployment(name) return deployment
def horizon(name): """Open Horizon in a browser tab.""" data.load_config(name) deployment = data.load_deployment(name) deployment.horizon()
def tmux(name): """Load OpenStack nodes into a new tmux session.""" data.load_config(name) deployment = data.load_deployment(name) deployment.tmux()
def openrc(name): """Export OpenStack credentials into shell environment.""" data.load_config(name) deployment = data.load_deployment(name) deployment.openrc()
def artifact(name): """Artifact a deployment (configs/running services).""" data.load_config(name) deployment = data.load_deployment(name) deployment.artifact()
def upgrade(name, upgrade_branch='v4.1.3rc'): """Upgrade a current deployment to the new branch / tag.""" data.load_config(name) deployment = data.load_deployment(name) logger.info(deployment) deployment.upgrade(upgrade_branch)
def update(name): """Runs package updates on all nodes in a deployment, in addition to running chef-client (or the equivalent) on all non-orchestrator nodes.""" data.load_config(name) deployment = data.load_deployment(name) deployment.update()
def load(name): """Helper function for loading a deployment object in iPython.""" return data.load_deployment(name)
def explore(name): """Explore a deployment in IPython.""" data.load_config(name) deployment = data.load_deployment(name) IPython.embed()