Ejemplo n.º 1
0
from nova import datastore
from nova import exception
from nova import flags
from nova import rpc
from nova import utils
from nova import validate

FLAGS = flags.FLAGS
flags.DEFINE_string('storage_dev', '/dev/sdb',
                    'Physical device to use for volumes')
flags.DEFINE_string('volume_group', 'nova-volumes',
                    'Name for the VG that will contain exported volumes')
flags.DEFINE_string('aoe_eth_dev', 'eth0',
                    'Which device to export the volumes on')
flags.DEFINE_string('storage_name', socket.gethostname(), 'name of this node')
flags.DEFINE_integer('shelf_id', utils.last_octet(utils.get_my_ip()),
                     'AoE shelf_id for this node')
flags.DEFINE_string('storage_availability_zone', 'nova',
                    'availability zone of this node')
flags.DEFINE_boolean('fake_storage', False,
                     'Should we make real storage volumes to attach?')

# TODO(joshua) Index of volumes by project


def get_volume(volume_id):
    """ Returns a redis-backed volume object """
    volume_class = Volume
    if FLAGS.fake_storage:
        volume_class = FakeVolume
    if datastore.Redis.instance().sismember('volumes', volume_id):
Ejemplo n.º 2
0
Archivo: storage.py Proyecto: jxta/cc
from nova import rpc
from nova import utils


FLAGS = flags.FLAGS
flags.DEFINE_string('storage_dev', '/dev/sdb',
                    'Physical device to use for volumes')
flags.DEFINE_string('volume_group', 'nova-volumes',
                    'Name for the VG that will contain exported volumes')
flags.DEFINE_string('aoe_eth_dev', 'eth0',
                    'Which device to export the volumes on')
flags.DEFINE_string('storage_name',
                    socket.gethostname(),
                    'name of this node')
flags.DEFINE_integer('shelf_id',
                    utils.last_octet(utils.get_my_ip()),
                    'AoE shelf_id for this node')
flags.DEFINE_string('storage_availability_zone',
                    'nova',
                    'availability zone of this node')
flags.DEFINE_boolean('fake_storage', False,
                     'Should we make real storage volumes to attach?')

class BlockStore(object):
    def __init__(self):
        super(BlockStore, self).__init__()
        self.volume_class = Volume
        if FLAGS.fake_storage:
            self.volume_class = FakeVolume
        self._init_volume_group()
        self.keeper = datastore.Keeper('storage-')
Ejemplo n.º 3
0
from nova import utils
from nova import validate


FLAGS = flags.FLAGS
flags.DEFINE_string('storage_dev', '/dev/sdb',
                    'Physical device to use for volumes')
flags.DEFINE_string('volume_group', 'nova-volumes',
                    'Name for the VG that will contain exported volumes')
flags.DEFINE_string('aoe_eth_dev', 'eth0',
                    'Which device to export the volumes on')
flags.DEFINE_string('storage_name',
                    socket.gethostname(),
                    'name of this node')
flags.DEFINE_integer('first_shelf_id',
                    utils.last_octet(utils.get_my_ip()) * 10,
                    'AoE starting shelf_id for this node')
flags.DEFINE_integer('last_shelf_id',
                    utils.last_octet(utils.get_my_ip()) * 10 + 9,
                    'AoE starting shelf_id for this node')
flags.DEFINE_string('aoe_export_dir',
                    '/var/lib/vblade-persist/vblades',
                    'AoE directory where exports are created')
flags.DEFINE_integer('slots_per_shelf',
                    16,
                    'Number of AoE slots per shelf')
flags.DEFINE_string('storage_availability_zone',
                    'nova',
                    'availability zone of this node')
flags.DEFINE_boolean('fake_storage', False,
                     'Should we make real storage volumes to attach?')