Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
def rpcs_build(
        name, template="ubuntu-default", branch="master",
        config="pubcloud-neutron.yaml", provisioner="rackspace",
        orchestrator="chef", secret="secret.yaml", dry=False, log=None,
        destroy_on_failure=False):
    """Build a Rackspace Private Cloud deployment."""
    data.load_config(name)
    deployment = rpcs.Deployment(name)
    with cleanup_on_failure(deployment):
        deployment.build()
    return deployment
Beispiel #5
0
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..."))
Beispiel #6
0
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..."))
Beispiel #7
0
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)
Beispiel #8
0
def explore(name):
    """Explore a deployment in IPython."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    from IPython import embed; embed()
Beispiel #9
0
def show(name):
    """Show details about an OpenStack deployment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    return deployment
Beispiel #10
0
def horizon(name):
    """Open Horizon in a browser tab."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.horizon()
Beispiel #11
0
def tmux(name):
    """Load OpenStack nodes into a new tmux session."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.tmux()
Beispiel #12
0
def openrc(name):
    """Export OpenStack credentials into shell environment."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.openrc()
Beispiel #13
0
def artifact(name):
    """Artifact a deployment (configs/running services)."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    deployment.artifact()
Beispiel #14
0
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)
Beispiel #15
0
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()
Beispiel #16
0
def explore(name):
    """Explore a deployment in IPython."""
    data.load_config(name)
    deployment = data.load_deployment(name)
    IPython.embed()