Exemplo n.º 1
0
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
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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
Exemplo n.º 5
0
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
Exemplo n.º 6
0
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