Driver to use BeeGFS as cinder storage target
This project is about developing and maintaining a driver which allows cinder to connect to the beegfs filesystem. For the moment there will be only simple features implemented to have the driver as soon as possible available and develop more features in a next step.
Blueprint information
- Status:
- Not started
- Approver:
- Sean McGinnis
- Priority:
- Undefined
- Drafter:
- Sven Rath
- Direction:
- Needs approval
- Assignee:
- Sven Rath
- Definition:
- Approved
- Series goal:
- Proposed for alpha-trunk
- Implementation:
-
Deferred
- Milestone target:
-
ongoing
- Started by
- Completed by
Whiteboard
#######
First idea/draft of the driver to use beegfs
#######
# Copyright. 2016 All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
BeeGFS Volume Driver.
"""
import math
import os
import re
import shutil
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import units
import six
from cinder import context
from cinder import exception
from cinder.i18n import _, _LE, _LI
from cinder.image import image_utils
from cinder import interface
from cinder.objects import fields
from cinder import utils
from cinder.volume import driver
from cinder.
from cinder.
from cinder.
LOG = logging.
beegfs_options = [
cfg.
cfg.
]
CONF = cfg.CONF
CONF.register_
@interface.
class BeeGFSDriver(
#Basic configuration
def __init__(self, *args, **kwargs):
def _check_
#Ensure that the flags we care about are set.
for attr in required_config:
if not getattr(
def _beegfs_
if 'run_as_root' not in kwargs:
return utils.execute(*cmd, **kwargs)
#Volumes
def _create_
#Now we have to verify that BeeGFS is mounted!
volume_path = self._get_
volume_size = volume['size']
def delete_volume(self, volume):
# Check if BeeGFS is mounted
volume_path = self._get_
def _create_
#Snapshots
def create_
def delete_
snapshot_path = self._get_
snapshot_
self.
self.
#Clone and copy
def clone_image(self, context, volume, image_location, image_meta, image_service):
#Create a volume from the specified image.
return self._clone_
def copy_image_
# Check if BeeGFS is mounted
def copy_volume_
#Copy the volume to the specified image.
#Resizing
def extend_volume(self, volume, new_size):
#Extend an existing volume.
def _resize_
#Resize volume file to new size.
try:
except processutils.
data = image_utils.
return data.virtual_size
#GET methods and verification
def _get_snapshot_
return snapshot_path
def _get_volume_
return self.local_
def get_volume_
#If 'refresh' is True, or stats have never been updated, run update
#the stats first.
if not self._stats or refresh:
return self._stats
def _update_
data = {}
for share in self._mounted_
def _verify_
try:
except processutils.
msg = (_('%s cannot be accessed. Verify that BeeGFS is active and '
def _is_beegfs_
If not part of a beegfs file system, raise ProcessExecutio
"""
try:
except processutils.