Exemple #1
0
def do_boot(cs, args):
    """Boot a new server."""
    boot_args, boot_kwargs = _boot(cs, args)

    extra_boot_kwargs = utils.get_resource_manager_extra_kwargs(do_boot, args)
    boot_kwargs.update(extra_boot_kwargs)

    server = cs.servers.create(*boot_args, **boot_kwargs)

    # Keep any information (like adminPass) returned by create
    info = server._info
    server = cs.servers.get(info['id'])
    info.update(server._info)

    flavor = info.get('flavor', {})
    flavor_id = flavor.get('id', '')
    info['flavor'] = _find_flavor(cs, flavor_id).name

    image = info.get('image', {})
    image_id = image.get('id', '')
    info['image'] = _find_image(cs, image_id).name

    info.pop('links', None)
    info.pop('addresses', None)

    utils.print_dict(info)
Exemple #2
0
def do_boot(cs, args):
    """Boot a new server."""
    boot_args, boot_kwargs = _boot(cs, args)

    extra_boot_kwargs = utils.get_resource_manager_extra_kwargs(do_boot, args)
    boot_kwargs.update(extra_boot_kwargs)

    server = cs.servers.create(*boot_args, **boot_kwargs)

    # Keep any information (like adminPass) returned by create
    info = server._info
    server = cs.servers.get(info['id'])
    info.update(server._info)

    flavor = info.get('flavor', {})
    flavor_id = flavor.get('id', '')
    info['flavor'] = _find_flavor(cs, flavor_id).name

    image = info.get('image', {})
    image_id = image.get('id', '')
    info['image'] = _find_image(cs, image_id).name

    info.pop('links', None)
    info.pop('addresses', None)

    utils.print_dict(info)
Exemple #3
0
def do_zone_boot(cs, args):
    """Boot a new server, potentially across Zones."""
    boot_args, boot_kwargs = _boot(cs,
                                   args,
                                   reservation_id=args.reservation_id,
                                   min_count=args.min_instances,
                                   max_count=args.max_instances)

    extra_boot_kwargs = utils.get_resource_manager_extra_kwargs(
        do_zone_boot, args)
    boot_kwargs.update(extra_boot_kwargs)

    reservation_id = cs.zones.boot(*boot_args, **boot_kwargs)
    print "Reservation ID=", reservation_id
Exemple #4
0
def do_zone_boot(cs, args):
    """Boot a new server, potentially across Zones."""
    boot_args, boot_kwargs = _boot(cs,
                                   args,
                                   reservation_id=args.reservation_id,
                                   min_count=args.min_instances,
                                   max_count=args.max_instances)

    extra_boot_kwargs = utils.get_resource_manager_extra_kwargs(
            do_zone_boot, args)
    boot_kwargs.update(extra_boot_kwargs)

    reservation_id = cs.zones.boot(*boot_args, **boot_kwargs)
    print "Reservation ID=", reservation_id