def main(): start_servers( 'ami-3f0e7d05', #get_script('run_split_standalone.bash'), get_script('run_split_standalone_strace.bash'), get_script(BASH_SCRIPT_SETUP_DISKS), 'r3.xlarge', '20131122_941_6', 'Kevin', 'Split Standalone', AWS_INSTANCES.get('r3.xlarge'), '0.10')
def main(): start_servers( 1, 'ami-3f0e7d05', #get_script('run_clean_standalone.bash'), get_script('run_clean_standalone_strace.bash'), get_script(BASH_SCRIPT_SETUP_DISKS), 'r3.4xlarge', ['vis_1136~1140'], 'Kevin', 'Standalone Clean', AWS_INSTANCES.get('r3.4xlarge'), '2.00')
def check_args(args): """ Check the arguments and prompt for new ones """ map_args = {} if args['obs_ids'] is None: return None elif len(args['obs_ids']) == 1 and args['obs_ids'][0] == '*': map_args['obs_ids'] = OBS_IDS.keys() else: map_args['obs_ids'] = args['obs_ids'] if args['instance_type'] is None: return None if args['name'] is None: return None instance_details = AWS_INSTANCES.get(args['instance_type']) if instance_details is None: LOGGER.error('The instance type {0} is not supported.'.format( args['instance_type'])) return None else: LOGGER.info( 'instance: {0}, vCPU: {1}, RAM: {2}GB, Disks: {3}x{4}GB, IOPS: {5}' .format(args['instance_type'], instance_details.vCPU, instance_details.memory, instance_details.number_disks, instance_details.size, instance_details.iops_support)) map_args.update({ 'ami_id': args['ami_id'] if args['ami_id'] is not None else AWS_AMI_ID, 'created_by': args['created_by'] if args['created_by'] is not None else getpass.getuser(), 'spot_price': args['spot_price'] if args['spot_price'] is not None else None, 'user_data': get_script(args['bash_script'] if args['bash_script'] is not None else BASH_SCRIPT_CVEL), 'setup_disks': get_script(BASH_SCRIPT_SETUP_DISKS), 'instance_details': instance_details, }) return map_args
def check_args(args): """ Check the arguments and prompt for new ones """ map_args = {} if args['obs_ids'] is None: return None elif len(args['obs_ids']) == 1 and args['obs_ids'][0] == '*': map_args['obs_ids'] = OBS_IDS.keys() else: map_args['obs_ids'] = args['obs_ids'] if args['instance_type'] is None: return None if args['name'] is None: return None instance_details = AWS_INSTANCES.get(args['instance_type']) if instance_details is None: LOGGER.error('The instance type {0} is not supported.'.format(args['instance_type'])) return None else: LOGGER.info( 'instance: {0}, vCPU: {1}, RAM: {2}GB, Disks: {3}x{4}GB, IOPS: {5}'.format( args['instance_type'], instance_details.vCPU, instance_details.memory, instance_details.number_disks, instance_details.size, instance_details.iops_support)) map_args.update({ 'ami_id': args['ami_id'] if args['ami_id'] is not None else AWS_AMI_ID, 'created_by': args['created_by'] if args['created_by'] is not None else getpass.getuser(), 'spot_price': args['spot_price'] if args['spot_price'] is not None else None, 'user_data': get_script(args['bash_script'] if args['bash_script'] is not None else BASH_SCRIPT_CVEL), 'setup_disks': get_script(BASH_SCRIPT_SETUP_DISKS), 'instance_details': instance_details, }) return map_args
def check_args(args): """ Check the arguments and prompt for new ones """ map_args = {} if args["snapshots"] is None: return None if args["instance_type"] is None: return None if args["name"] is None: return None instance_details = AWS_INSTANCES.get(args["instance_type"]) if instance_details is None: LOGGER.error("The instance type {0} is not supported.".format(args["instance_type"])) return None else: LOGGER.info( "instance: {0}, vCPU: {1}, RAM: {2}GB, Disks: {3}x{4}GB, IOPS: {5}".format( args["instance_type"], instance_details.vCPU, instance_details.memory, instance_details.number_disks, instance_details.size, instance_details.iops_support, ) ) map_args.update( { "ami_id": args["ami_id"] if args["ami_id"] is not None else AWS_AMI_ID, "created_by": args["created_by"] if args["created_by"] is not None else getpass.getuser(), "spot_price": args["spot_price"] if args["spot_price"] is not None else None, "user_data": get_script(args["bash_script"] if args["bash_script"] is not None else BASH_SCRIPT_CLEAN_ALL), "setup_disks": get_script(BASH_SCRIPT_SETUP_DISKS), "instance_details": instance_details, } ) return map_args