Ejemplo n.º 1
0
def ec2_launch_instance(name, configname=None):
    """
    Launch new EC2 instance.

    :param name: The name to tag the EC2 instance with (required)
    :param configname: Name of the configuration in
        ``awsfab_settings.EC2_LAUNCH_CONFIGS``. Prompts for input if not
        provided as an argument.
    """
    launcher = Ec2LaunchInstance(extra_tags={"Name": name}, configname=configname)
    launcher.confirm()
    instance = launcher.run_instance()
    wait_for_running_state(instance.id)
Ejemplo n.º 2
0
def ec2_launch_instance(name, configname=None):
    """
    Launch new EC2 instance.

    :param name: The name to tag the EC2 instance with (required)
    :param configname: Name of the configuration in
        ``awsfab_settings.EC2_LAUNCH_CONFIGS``. Prompts for input if not
        provided as an argument.
    """
    launcher = Ec2LaunchInstance(extra_tags={'Name': name},
                                 configname=configname)
    launcher.confirm()
    instance = launcher.run_instance()
    wait_for_running_state(instance.id)
Ejemplo n.º 3
0
def ec2_start_instance(nowait=False):
    """
    Start EC2 instance.

    :param nowait: Set to ``True`` to let the EC2 instance start in the
        background instead of waiting for it to start. Defaults to ``False``.
    """
    instancewrapper = Ec2InstanceWrapper.get_from_host_string()
    instancewrapper.instance.start()
    if nowait:
        print ('Starting: {id}. This is an asynchronous operation. Use '
                '``ec2_list_instances`` or the aws dashboard to check the status of '
                'the operation.').format(id=instancewrapper['id'])
    else:
        wait_for_running_state(instancewrapper['id'])
Ejemplo n.º 4
0
def ec2_start_instance(nowait=False):
    """
    Start EC2 instance.

    :param nowait: Set to ``True`` to let the EC2 instance start in the
        background instead of waiting for it to start. Defaults to ``False``.
    """
    instancewrapper = Ec2InstanceWrapper.get_from_host_string()
    instancewrapper.instance.start()
    if nowait:
        print(
            'Starting: {id}. This is an asynchronous operation. Use '
            '``ec2_list_instances`` or the aws dashboard to check the status of '
            'the operation.').format(id=instancewrapper['id'])
    else:
        wait_for_running_state(instancewrapper['id'])