Problems with init of cinder driver
I am currently running into an issue with making my Cinder driver work. Here is my basic implementation:
import requests
import json
from cinder import interface
from cinder.volume import driver
from oslo_config import cfg
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
ENABLE_TRACE = False
volume_opts = [
cfg.StrOpt('hera_api_endpoint',
default='http://0.0.0.0:12956/hera/volume/',
help='the api endpoint at which the hera system sits')
]
CONF = cfg.CONF
CONF.register_opts(volume_opts)
@interface.volumedriver
class HeraDriver2(driver.VolumeDriver):
VERSION = '3.0.0'
def __init__(self, *args, **kwargs):
super(HeraDriver2, self).__init__(*args, **kwargs)
self.configuration.append_config_values(volume_opts)
self.endpoint = self.configuration.safe_get('hera_api_endpoint')
def _get_req_vol_name(self, volume):
name = volume['display_name']
return name
def _get_req_vol_size(self, volume):
size = volume.get('size')
return size
def _get_req_vol_descrition(self, volume):
pass
def create_volume(self, volume):
pass
def update_volume(self, volume): # extend_volume
pass
def delete_volume(self, volume):
pass
def get_vol_by_id(self, volume):
pass
def get_vols(self):
pass
def attach_volume(self):
pass
def check_for_setup_error(self):
pass
def clone_image(self):
pass
def copy_image_to_volume(self):
pass
def copy_volume_to_image(self):
pass
def detach_volume(self):
pass
def do_setup(self, context):
pass
def check_for_setup_error(self):
pass
def extend_volume(self):
pass
def get_volume_stats(self):
pass
I am running into the issue, that if I try to run the cinder_volume process, I receive following errors:
2017-03-13 11:11:37.851 10463 INFO cinder.volume.manager [req-7dee48c2-e3f3-4729-ab05-200a75678f07 - - - - -] Initializing RPC dependent components of volume driver HeraDriver2 (3.0.0)
2017-03-13 11:11:37.852 10463 ERROR cinder.utils [req-7dee48c2-e3f3-4729-ab05-200a75678f07 - - - - -] Volume driver HeraDriver2 not initialized
2017-03-13 11:11:37.853 10463 ERROR cinder.volume.manager [req-7dee48c2-e3f3-4729-ab05-200a75678f07 - - - - -] Cannot complete RPC initialization because driver isn't initialized properly.
I fail to see where I am going wrong, the do_setup
and check_for_setup_error
can be left like they are, since other drivers have left them empty aswell.
Help is greatly appreciated! Thank you!