2015/05/19

lsmcli with netapp on ubuntu

Skimming through the RHEL 7.1 Release Notes on Storage I noticed libStorageMgmt, and got curious. Netapp provides an oncommand system manager rpm, which when extracted works on ubuntu too, but it starts a web application on localhost and then opens a browser, and that's how you manage the storage. Yuck! So let's try this libStorageMgmt stuff:

$ suod apt-get install libstoragemgmtd libstoragemgmt-tools

$ lsmcli
Traceback (most recent call last):
  File "/usr/bin/lsmcli", line 19, in 
    import lsm.cmdline
  File "/usr/lib/python2.7/dist-packages/lsm/__init__.py", line 23, in 
    from smis import Smis
  File "/usr/lib/python2.7/dist-packages/lsm/smis.py", line 20, in 
    import pywbem
ImportError: No module named pywbem

$ sudo apt-get install python-pywbem

$ sudo service libstoragemgmtd start
$ sudo gpasswd -a paul.tobias libstoragemgmt

$ lsmcli --list=SYSTEMS
ID         | Name     | Status
-----------+----------+-------
1918101635 | netapp01 | OK    

$ lsmcli --list POOLS
ID                                   | Name  | Total space    | Free space    | System ID 
-------------------------------------+-------+----------------+---------------+-----------
c6b01446-7146-11e3-a01e-123478563412 | aggr0 | 11322462519296 | 3456236142592 | 1918101635

$ lsmcli --list POOLS -H
ID                                   | Name  | Total space | Free space | System ID 
-------------------------------------+-------+-------------+------------+-----------
c6b01446-7146-11e3-a01e-123478563412 | aggr0 | 10.30 TiB   | 3.14 TiB   | 1918101635

$ lsmcli --list FS -H
ID                                   | Name                      | Total space | Free space | Pool ID                             
-------------------------------------+---------------------------+-------------+------------+-------------------------------------
c7b367ea-7146-11e3-a01e-123478563412 | vol0                      | 171.00 GiB  | 164.84 GiB | c6b01446-7146-11e3-a01e-123478563412
7ff4e8db-bb3b-11e3-821a-123478563412 | vms                       | 4.75 TiB    | 1.63 TiB   | c6b01446-7146-11e3-a01e-123478563412
04d28a88-12f9-425a-8149-5b70d1d9951d | brush_backup_restore_test | 2.50 TiB    | 2.46 TiB   | c6b01446-7146-11e3-a01e-123478563412
2f228ee9-4b09-4ce2-9e05-ca5bcdbbcc7c | brush_extra               | 1.00 TiB    | 63.63 GiB  | c6b01446-7146-11e3-a01e-123478563412
5548a33d-d0f7-4dd1-ac49-3ca07f5d76a9 | test                      | 1.24 GiB    | 1.23 GiB   | c6b01446-7146-11e3-a01e-123478563412

$ lsmcli --list EXPORTS
Key            | Value                                                  
---------------+--------------------------------------------------------
ID             | 998e7bde67701ad96ebb14cbb5927c90                       
File system ID | 7ff4e8db-bb3b-11e3-821a-123478563412                   
Export Path    | /vol/vms                                               
Authentication | sys                                                    
Root           | 172.28.50.100, 172.28.50.63, 172.28.50.62, 172.28.50.61
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | f962aa0dc595c52f676bc3d52b8e9c92                       
File system ID | c7b367ea-7146-11e3-a01e-123478563412                   
Export Path    | /vol/vol0                                              
Authentication | sys                                                    
Root           | 172.28.50.21                                           
Read/Write     | 172.28.50.21                                           
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | f962aa0dc595c52f676bc3d52b8e9c92                       
File system ID | c7b367ea-7146-11e3-a01e-123478563412                   
Export Path    | /vol/vol0/home                                         
Authentication | sys                                                    
Root           | 172.28.50.21                                           
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | 8aa21057ed71d0c1b579db8ea1f3e5ae                       
File system ID | 2f228ee9-4b09-4ce2-9e05-ca5bcdbbcc7c                   
Export Path    | /vol/brush_extra                                       
Authentication | sys                                                    
Root           | 172.28.5000.21, 172.28.50.100                          
Read/Write     | *                                                      
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   
ID             | ca24797f40f9b55a2c6aa8174f1f0fee                       
File system ID | 04d28a88-12f9-425a-8149-5b70d1d9951d                   
Export Path    | /vol/brush_backup_restore_test                         
Authentication | sys                                                    
Root           | 172.28.50.100                                          
Read/Write     | 172.28.50.100                                          
ReadOnly       | None                                                   
Anon UID       | None                                                   
Anon GID       | None                                                   
Options        | None                                                   

$ lsmcli --create-fs=test --size 1G --pool c6b01446-7146-11e3-a01e-123478563412
ID                                   | Name | Total space | Free space | Pool ID                             
-------------------------------------+------+-------------+------------+-------------------------------------
5548a33d-d0f7-4dd1-ac49-3ca07f5d76a9 | test |  1326075904 | 1325924352 | c6b01446-7146-11e3-a01e-123478563412

Sweet! I can finally forget that oncommand system manager and use the command line to manage netapp.