def blk_dev_map(opts, conf, itype, snapshots): if not int(conf.get('NO_EBS', '0')): bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping() snap = project_ebs_snapshot(conf) snap_id = translate_snapshot_name(conf, snap, snapshots) snap_description = [] if snap_id: dev = utils.blkdev(0) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType( snapshot_id=snap_id, delete_on_termination=True) snap_description.append((snap, snap_id, dev)) i = 0 for k in additional_ebs_iterator(conf): i += 1 snap = parse_ebs_url(conf[k].split(',')[0]) snap_id = translate_snapshot_name(conf, snap, snapshots) if snap_id: dev = utils.blkdev(i) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType( snapshot_id=snap_id, delete_on_termination=True) snap_description.append((snap, snap_id, dev)) istore_dev = add_instance_store(opts, conf, bdm, itype) return bdm, snap_description, istore_dev else: return None, None, None
def mount_additional_ebs(conf, proj_dir): i = 0 for k in additional_ebs_iterator(conf): i += 1 dir = os.path.realpath(os.path.join(proj_dir, conf[k].split(',')[1])) dev = utils.blkdev(i, mount_form=True) utils.mount(dev, dir)
def blk_dev_map(opts, conf, itype, snapshots): if not int(conf.get('NO_EBS', '0')): bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping() snap = project_ebs_snapshot(conf) snap_id = translate_snapshot_name(conf, snap, snapshots) snap_description = [] if snap_id: dev = utils.blkdev(0) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType(snapshot_id=snap_id, delete_on_termination=True) snap_description.append((snap, snap_id, dev)) i = 0 for k in additional_ebs_iterator(conf): i += 1 snap = parse_ebs_url(conf[k].split(',')[0]) snap_id = translate_snapshot_name(conf, snap, snapshots) if snap_id: dev = utils.blkdev(i) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType(snapshot_id=snap_id, delete_on_termination=True) snap_description.append((snap, snap_id, dev)) istore_dev = add_instance_store(opts, conf, bdm, itype) return bdm, snap_description, istore_dev else: return None, None, None
def add_instance_store(opts, conf, bdm, itype): if not itype.startswith('t1.'): dev = utils.blkdev(0, istore=True) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType(ephemeral_name='ephemeral0') return dev
def add_instance_store(opts, conf, bdm, itype): if not itype.startswith('t1.'): dev = utils.blkdev(0, istore=True) bdm[dev] = boto.ec2.blockdevicemapping.EBSBlockDeviceType( ephemeral_name='ephemeral0') return dev