Skip to content

whereisrysmind/cinder-storage-backend-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Using template to create a storage backend.

  1. Clone template:

sudo apt -y install cookiecutter
cookiecutter https://github.com/openstack-charmers/cinder-storage-backend-template
  1. Edit src/config.yaml

  • In the src/config.yaml add any options that should be configurable by the user. In most cases this is details for connecting to the storage array. Where appropriate the charm will pass these to the cinder principle charm for inclusion in cinder.conf.
  • If the storage driver is to be installed from a ppa then uncomment the driver-* options, otherwise delete them.
  1. Update 'cinder_configuration' in src/lib/charm/openstack/cinder_*

The 'cinderr_configuration' method controls configuration options are sent to the principle cinder charm for inclusion in cinder.conf. For example:

If a 'superarray' driver was being configured in step 3 and superarray-username, superarray-password and superarray-hostname config options were added to config.yaml and the array needs driver XXX then 'cinder_configuration' might look like:

def cinder_configuration(self):
    volume_driver = 'cinder.volume.drivers.ARRAYVENDOR.iscsi.ARRAYISCSIDriver'
    driver_options = [
        ('volume_driver', volume_driver),
        ('username', self.config.get('superarray-username')),
        ('password', self.config.get('superarray-password')),
        ('hostname', self.config.get('superarray-hostname'))]
    return driver_options

Which will result in the following section being added to cinder.conf:

    [cinder-superarray]
    volume_driver = cinder.volume.drivers.ARRAYVENDOR.iscsi.ARRAYISCSIDriver
    username = root
    password = password
    hostname = 10.5.0.13
  1. Update unit tests

Edit unit_tests/test_lib_charm_openstack_cinder* and update unit tests.

  1. Update functional tests

Update the bundles in tests/bundles/*yaml as needed and edit tests/tests_cinder_*py to add functional testing.

TODO:

  • Add basic zaza tests
  • Add unit tests
    • Add skeleton readme for generated charm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Shell 1.1%