-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NAS resources for filesystem, qtree & share #491
Add NAS resources for filesystem, qtree & share #491
Conversation
6fa64b2
to
930d760
Compare
Codecov Report
@@ Coverage Diff @@
## master #491 +/- ##
==========================================
+ Coverage 67.96% 68.15% +0.19%
==========================================
Files 113 119 +6
Lines 8218 8806 +588
Branches 926 983 +57
==========================================
+ Hits 5585 6002 +417
- Misses 2321 2467 +146
- Partials 312 337 +25
|
5282466
to
84b1cd5
Compare
delfin/common/constants.py
Outdated
|
||
class QuotaState(object): | ||
NORMAL = 'normal' | ||
SOFT = 'soft_limit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This state is not clear, Qtree having state= soft_limit means what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State can be either in normal, soft_limit hit, hard_limit hit. When soft_limit, it is between normal and hard_limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Quota State reached Hard limit, what do we call "Hard" or "Abnormal"? Also, for Soft limit "Normal" or "Soft"?
delfin/db/sqlalchemy/models.py
Outdated
free_capacity = Column(BigInteger) | ||
compression = Column(Boolean) | ||
deduplication = Column(Boolean) | ||
worm = Column(Boolean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_worm ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifies if this is WORM filesystem
|
||
@check_deleted() | ||
@set_synced_after() | ||
def sync(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync will be called for each subclass of StorageResourceTask ! how do we make sure it is called only if it the driver is an instance of NAS driver ?
5be7fcb
to
1f63916
Compare
ALL = (NORMAL, FAULTY) | ||
|
||
|
||
class WORMType(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very clear as WORM is basically compliance or protection. Can we call it WORMProtection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Filesystem's worm type. Filesystem can be either worm or non_worm, if Filesystem is worm we give the type of worm.
delfin/common/constants.py
Outdated
|
||
class QuotaState(object): | ||
NORMAL = 'normal' | ||
SOFT = 'soft_limit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Quota State reached Hard limit, what do we call "Hard" or "Abnormal"? Also, for Soft limit "Normal" or "Soft"?
6464ccc
to
f307e2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the driver definition, please consider it carefully
delfin/drivers/driver.py
Outdated
|
||
|
||
@six.add_metaclass(abc.ABCMeta) | ||
class NASDriver(StorageDriver): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an impact for sync storage api by defining sub driver, it will fail because sync api use subclass to generate the resource task.
plz check
delfin/common/constants.py
Outdated
CIFS = 'cifs' | ||
NFS = 'nfs' | ||
FTP = 'ftp' | ||
UNKNOWN = 'unknown' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protocol should not be unkown. should be specificy.
suggest add hdfs as one of protocols
delfin/db/sqlalchemy/models.py
Outdated
storage_id = Column(String(36)) | ||
native_filesystem_id = Column(String(255)) | ||
native_pool_id = Column(String(255)) | ||
status = Column(String(255)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put accociated object info to the last location
delfin/db/sqlalchemy/models.py
Outdated
storage_id = Column(String(36)) | ||
native_qtree_id = Column(String(255)) | ||
native_filesystem_id = Column(String(255)) | ||
path = Column(String(255)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
f307e2c
to
acd113c
Compare
delfin/drivers/driver.py
Outdated
|
||
def list_filesystems(self, context): | ||
"""List all filesystems from storage system.""" | ||
raise exception.StorageDriverAPINotImplemented("list_filesystems()") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use
raise NotImplementedError()
delfin/exception.py
Outdated
|
||
|
||
class StorageDriverAPINotImplemented(DelfinException): | ||
msg_fmt = _("Storage driver do not support API: {0}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove it
58fdbb3
to
85723c5
Compare
delfin/drivers/driver.py
Outdated
@@ -115,3 +115,18 @@ def list_alerts(self, context, query_para=None): | |||
def clear_alert(self, context, sequence_number): | |||
"""Clear alert from storage system.""" | |||
pass | |||
|
|||
@abc.abstractmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest remove @abc.abstractmethod, otherewise you need to add method for all drivers
85723c5
to
74b5cbf
Compare
|
||
if add_list: | ||
db.filesystems_create(self.context, add_list) | ||
except AttributeError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NotImplementedErr should be catched and ignored(using pass) same with other resource tasks
74b5cbf
to
6e7ce7c
Compare
except AttributeError as e: | ||
LOG.error(e) | ||
except NotImplementedError as e: | ||
LOG.info(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using pass, suggest not log info, because there will be many NotImplementError from storages.
# Ignore this exception because driver may not support it.
pass
6e7ce7c
to
bde042e
Compare
bde042e
to
e4c64a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @NajmudheenCT please squash and merge it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add NAS resource filesystem * Separate drivers to NAS, SAN and Unified * Fix formatting * Add Qtree resource support to delfin * Add Share resource support to delfin * Add quota limit params to qtree * Update unit tests * Update model changes * Implement review comments
…e addition (#503) * db changes for task template addition * db changes for task instance addition * Fix for travis CI issue on cryptography dependency (#494) * Fix CI Issue on cryptography dependency * Removing python_version check on crytography package requirement * Add MIXED storage pool type (#482) * Add NAS resources for filesystem, qtree & share (#491) * Add NAS resource filesystem * Separate drivers to NAS, SAN and Unified * Fix formatting * Add Qtree resource support to delfin * Add Share resource support to delfin * Add quota limit params to qtree * Update unit tests * Update model changes * Implement review comments * update db model with task and failed task schema * Fix some comments and name changes * Unit test changes Co-authored-by: Najmudheen <45681499+NajmudheenCT@users.noreply.github.com> Co-authored-by: Joseph Vazhappilly <josephvp@gmail.com> Co-authored-by: Amit Roushan <amit.roushan@huawei.com>
What this PR does / why we need it:
Add NAS resource filesystem
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #477Special notes for your reviewer:
Release note:
REST API tests:
1. Filesystem
2. Qtree
3. Share