PowerVC

 View Only

How to register pluggable storage devices to PowerVC

By Jagdish Choudhary posted Wed February 06, 2019 06:13 AM

  
PowerVC lets you register several storage drivers directly (called integrated storage devices), but it also supports registering pluggable storage devices. A pluggable storage device is just an OpenStack supported storage device. Any storage device supported by an OpenStack driver can be registered with PowerVC, but the level of functionality that it has within PowerVC depends on the driver. You can run this suite of tests on your driver to determine functionality: PowerVC Test Suite For Pluggable Storage Driver Validation.

Additionally, there are some differences in the availability of PowerVC functions on pluggable and integrated storage devices, as listed in this topic: Functions available on pluggable and integrated storage drivers.

Add a pluggable volume driver



1. Obtain the OpenStack driver installable, documentation, and any dependencies. PowerVC 1.4.2 supports the OpenStack Queens release. If you are running a different version of PowerVC, refer to the Hardware and Software requirements topic in the Knowledge Center to determine the supported release of OpenStack. You can use the dropdown to change to the appropriate version of the topic.

  • Check if the OpenStack compatible driver is shipped with PowerVC. On the PowerVC management server, check the /usr/lib/python2.7/site-packages/cinder/volume/drivers directory.


    • If the driver exists there after the installation of PowerVC, then it is already available at the correct level.



    • If the driver does not exist, then continue with the rest of the steps.







  • If the driver is a Cinder community driver, run the git command to clone the stable branch:
    git clone --branch stable/queens https://git.openstack.org/openstack/cinder.git
    Copy the driver directory and its contents from cinder/cinder/volume/drivers/ to /usr/lib/python2.7/site-packages/cinder/volume/drivers/.

  • If the storage driver is not in the Cinder community, follow the vendor's instructions for downloading and installing the storage driver.



2. Review the dependencies listed for the driver. For any dependencies that PowerVC does not meet, install and configure them in accordance with the driver's instructions.


  • To determine the driver's dependencies, review the OpenStack Cinder driver documentation.


  • To determine whether the dependencies are already met by PowerVC, run rpm -aq and review the output.





3. Prepare a properties file for use with the powervc-register command by creating a file with a section called backend_defaults, followed by any driver specific key/value pairs. For example, this might be a file for an IBM Storwize
[backend_defaults] 
san_password = passw0rd
san_login = svcuser
san_ip = 1.2.3.4
storwize_svc_volpool_name = pool_0


The OpenStack driver documentation might list properties that should be set in /etc/cinder/cinder.conf. Do not modify cinder.conf directly. Instead, put all of the driver specific configuration properties in the properties file that is passed to the command.

Note: Do not set the following properties in the properties file because they will be overridden by the arguments specified on the command line: volume_driver, volume_backend_name, enabled_backends, or host_type.

4. Register the storage driver by running the powervc-register command:

powervc-register -o add -r resource_type -d volume_driver -n display_name                                    

-p properties_file


The command uses the following parameters:
resource_type
Use "storage" or "fabric" as the resource type, as appropriate.

volume_driver
The path to the volume driver's Python class. If the driver exists in the standard location, this value may be documented by the OpenStack driver. Otherwise, it depends on where you placed the module. For example, "cinder.volume.drivers.dell_emc.unity.driver.UnityDriver".

display_name
Optional: The driver's display name

properties_file
The file used to specify the device specific configuration properties.
For instructions to use the command, run powervc-register -h.

Example: Registering a Pure Array storage device



This driver is available in the OpenStack stable branch, so we will add it to PowerVC as a pluggable driver.

Test #git clone --branch stable/queens https://git.openstack.org/openstack/cinder.git 

Cloning into 'cinder'...

remote: Counting objects: 180029, done.

remote: Compressing objects: 100% (88683/88683), done.

remote: Total 180029 (delta 136675), reused 122162 (delta 81523)

Receiving objects: 100% (180029/180029), 62.92 MiB | 8.28 MiB/s, done.

Resolving deltas: 100% (136675/136675), done.

Test #ls
cinder
Test #
Test #cp cinder/cinder/volume/drivers/pure.py /usr/lib/python2.7/site-packages/cinder/volume/drivers/
Test #
Test #cat pure_array.conf
[backend_defaults]
san_ip = 1.2.3.4
pure_api_token = 5f3f98fd-48c5-194d-99c0-e0299aea66dc
Test #
Test #powervc-register -o add -r storage -d cinder.volume.drivers.pure.PureFCDriver -n pure_array -p /root/pure_array.conf
The Storage Provider 'pure_array' added to PowerVC.
Test #
Test #powervc-register -o list -r storage
Name Display Name Type
==== ============ ====
generic0 pure_array generic
Test #


Example: Registering an IBM Storwize driver


This driver is available with every PowerVC installation.

Test #cat storwize.conf  
[backend_defaults]
san_password = passw0rd
san_login = svcuser
san_ip =1.2.3.4
storwize_svc_volpool_name = powervc_pool
Test #
Test #powervc-register -o add -r storage -d cinder.volume.drivers.ibm.storwize_svc.storwize_svc_fc.StorwizeSVCFCDriver -n svc-fc-storage -p /root/storwize.conf
The Storage Provider 'svc-fc-storage' added to PowerVC.
Test #
Test #powervc-register -o list -r storage
Name Display Name Type
==== ============ ====
generic0 svc-fc-storage generic
Test #


Removing a pluggable storage device



To remove a pluggable storage device, you can use the PowerVC user interface or you can use the powervc-register command:
powervc-register -o remove -r storage -n display_name
Test #powervc-register -o remove -r storage -n svc-fc-storage
The Storage Provider 'svc-fc-storage' removed from PowerVC.
Test #

As you can see, the ability to register storage devices as pluggable drivers opens up a wide range of possible devices that you can manage with PowerVC. If you have any questions, post them below. And don’t forget to follow us on LinkedIn, Twitter, and Facebook!

Author: Jagdish Choudhary
#Storage
9 comments
14 views

Permalink

Comments

Wed March 18, 2020 07:23 PM

did you use source /path/tp/your_rc_file ? with user and password?
did you put the drivers on the proper location?
did you install any prerequisite? (like the client from pip in some cases...)

Wed March 18, 2020 07:22 PM

I finally updated to rhel 7.7 and pvc 1.4.4 and a fresh install and an upgrade seems to be working

Fri October 11, 2019 06:04 AM

Hello Dan,
from which version are you upgrading to 1.4.3? ensure you copied latest stable stein level of the pure driver. You may follow mentioned steps in blog . Please let us know outcome of this.

Mon October 07, 2019 11:50 PM

Hi, After upgrading to PowerVC 1.4.3 I was unable to use manage pure storage. I have tried to add it back, but no luck. I used your commands above for pure and receive this message:
powervc-register -o add -r storage -d cinder.volume.drivers.pure.PureFCDriver -n pure_array -p /root/pure_array.conf

Enter password for root:

Traceback (most recent call last):
File "/usr/bin/powervc-register", line 17, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/powervc_discovery/cmd/register.py", line 791, in main
args.new_name, args.properties_file, args.force, args.user_name)
File "/usr/lib/python2.7/site-packages/powervc_discovery/cmd/register.py", line 61, in _add_storage
host_type = _verify_driver_parameter(driver)
File "/usr/lib/python2.7/site-packages/powervc_discovery/cmd/register.py", line 635, in _verify_driver_parameter
importutils.import_class(driver)
File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 30, in import_class
__import__(mod_str)
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/pure.py", line 1905, in
class PureFCDriver(PureBaseVolumeDriver, driver.FibreChannelDriver):
File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/pure.py", line 1936, in PureFCDriver
@pure_driver_debug_trace
File "/usr/lib/python2.7/site-packages/cinder/zonemanager/utils.py", line 79, in add_fc_zone
vol_type = connection_info.get('driver_volume_type', None)
AttributeError: 'function' object has no attribute 'get'

Any help is appreciated.

Tue April 16, 2019 08:19 AM

Hi A Forero,

we see there are two issues-
1- Unable to get the storage ports, this comes when the driver could not start
2- No hostname spplied in the url it was https:// : 443

Could you please let us know
1- storops module installed ? and which OpenStack stable branch being used ? (142 - it should be queen )
2- ensure all required properties are in conf file ? If so, please raise a support ticket

Mon April 15, 2019 07:15 AM

Hi, i need integrate powervc with unity i am work with this command powervc-register -o add -r storage -d cinder.volume.drivers.dell_emc.unity.driver.UnityDriver -n UnityEMC-n -p /root/conectunity.conf , but my powervc 1.4.2 show "Unable to get the storage ports for storage provider generic0" and i can validate the powerVC connection to unity with python:

from storops import UnitySystem
unity = UnitySystem('ip', 'name', 'passwd')
pools = unity.get_pool()

and the plugin work very well with python and get the data of my storage... but with power my log show the error :

/var/log/cinder:
ERROR cinder.volume.manager [req-4bed93cd-670b-492c-8dda-0e2c943122b2 - - - - -] Failed to initialize driver.: InvalidURL: Invalid URL u'
https://:443/api/types/basicSystemInfo?compact=True&fields=attributes.description,attributes.displayValue,attributes.initialValue,attributes.name,attributes.type,descri
ption,documentation,name,type': No host supplied

Any ideas or suggestions?

Wed February 13, 2019 07:29 AM

Hi Jorge,

After updating to 1.4.2, ensure you copied latest stable queens level of the 3par driver . You may follow mentioned steps in blog . Please let us know outcome of this.

Wed February 13, 2019 07:00 AM

Hello Jorge,
While using the powervc-register command to add as pluggable storage, you need to provide the -d parameter pointing to the exact python module class of the volume driver where its located.

For example if your driver exists in
/cinder/volume/drivers/hpe/hpe_3par_fc.py
then the -d should be set to
cinder.volume.drivers.hpe.hpe_3par_fc.HPE3PARFCDriver

Can you check and confirm where the HPE volume driver exists on the controller. If it does not exist in the above path then either copy it under cinder/volume/drivers or give the proper python class path.

Thanks & Regards,
Chhavi Agarwal

Tue February 12, 2019 08:18 PM

Hello,

I have been using PVC 1.3.3 with 3par as pluggable driver and it has been working fine, but I updated a dev machine to 1.4.2 and I can not use the same command to add storage.
I wonder if there is a new way or there is a bug:

# powervc-register -o add -r storage -d cinder.volume.drivers.hpe.hpe_3par_fc.HPE3PARFCDriver -n xxx00z08pp805 -p /root/cinderconf/cinder-xxx00z08pp805.conf
The -d parameter does not reference a valid python class.

Regards