* Any disk not have 'aggregate' property is considered as free disk. * Added comments indicate how spare and free disk works on ONTAP: 1. Spare == free disk 2. Zeroed spare disk == OK | SPARE | FREE 3. Non-zeroed spare disk == STOPPED | SPARE | FREE
Signed-off-by: Gris Ge <f...@redhat.com> --- plugin/ontap/ontap.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py index b6358a8..16115a4 100644 --- a/plugin/ontap/ontap.py +++ b/plugin/ontap/ontap.py @@ -265,6 +265,10 @@ class Ontap(IStorageAreaNetwork, INfs): if 'is-zeroed' in na_disk and na_disk['is-zeroed'] == 'true': status |= Disk.STATUS_OK | Disk.STATUS_SPARE_DISK else: + # If spare disk is not zerored, it will be automaticlly + # zeroed before assigned to aggregate. + # Hence we consider non-zeroed spare disks as stopped + # spare disks. status |= Disk.STATUS_STOPPED | Disk.STATUS_SPARE_DISK elif rs == 'present': status |= Disk.STATUS_OK @@ -279,6 +283,12 @@ class Ontap(IStorageAreaNetwork, INfs): if 'is-offline' in na_disk and na_disk['is-offline'] == 'true': status |= Disk.STATUS_ERROR + if 'aggregate' not in na_disk: + # All free disks are automatically marked as spare disks. They + # could easily convert to data or parity disk without any + # explicit command. + status |= Disk.STATUS_FREE + if status == 0: status = Disk.STATUS_UNKNOWN -- 1.8.3.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Libstoragemgmt-devel mailing list Libstoragemgmt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libstoragemgmt-devel