ONTAP Rest API Discussions

Getting a list of spare-disks (even if they are not in the spare-container)

ilantivienna
4,910 Views

After doing a bit more research it turns out that on a system with Advanced Disk Partition we can not use the container-type as indication for a spare-disk (some spare-disks are in the shared container). So what I would like to do ist sending this command 

aggr show-spare-disks

to the system using the new REST-API.

 

Does anyone have an idea how I can do that?

3 REPLIES 3

donny_lang
4,827 Views

I don't have a 9.6 box with ADP handy at the moment unfortunately, but could you use the "state" field from the /storage/disks REST API to collect the data? Test it out and let me know - thanks! 

 

curl -X GET "https://<cluster hostname>/api/storage/disks?state=spare&fields=&return_records=true&return_timeout=15" -H "accept: application/json"

 

 

ilantivienna
4,805 Views

@donny_lang wrote:

 could you use the "state" field


 Unfortunately this field is present as well, if the disk is in the shared-container (spare disks are in red😞

 

XGB17::> aggr show-spare-disks
Original Owner: XGB17-01
Pool0
  Root-Data Partitioned Spares
                                                              Local    Local
                                                               Data     Root Physical
Disk             Type   Class          RPM Checksum         Usable   Usable     Size Status
---------------- ------ ----------- ------ -------------- -------- -------- -------- --------
1.0.21           BSAS   capacity      7200 block            1.56TB  53.88GB   1.62TB zeroed
 
Original Owner: XGB17-02
Pool0
  Root-Data Partitioned Spares
                                                              Local    Local
                                                               Data     Root Physical
Disk             Type   Class          RPM Checksum         Usable   Usable     Size Status
---------------- ------ ----------- ------ -------------- -------- -------- -------- --------
1.0.20           BSAS   capacity      7200 block            1.56TB  53.88GB   1.62TB zeroed
2 entries were displayed.



XGB17::> disk show -fields state,container-type
disk   container-type state
------ -------------- -------
Info: This cluster has partitioned disks. To get a complete list of spare disk capacity use "storage aggregate show-spare-disks".
1.0.0  shared         present
1.0.1  shared         present
1.0.2  shared         present
1.0.3  shared         present
1.0.4  shared         present
1.0.5  shared         present
1.0.6  shared         present
1.0.7  shared         present
1.0.8  shared         present
1.0.9  shared         present
1.0.10 shared         present
1.0.11 shared         present
1.0.12 shared         present
1.0.13 shared         present
1.0.14 shared         present
1.0.15 shared         present
1.0.16 shared         present
1.0.17 shared         present
1.0.18 shared         present
1.0.19 shared         present
1.0.20 shared         present
1.0.21 shared         present
1.0.22 shared         present
1.0.23 shared         present
24 entries were displayed.

The only other way beside of using the CLI command aggr show-spare-disks may be disk partition show:

XGB17::*> disk partition show
                          Usable  Container     Container
Partition                 Size    Type          Name              Owner
------------------------- ------- ------------- ----------------- -----------------
1.0.0.P1                   1.56TB aggregate     /aggr1_XGB17_02/plex0/rg0 XGB17-02
...
1.0.20.P1                  1.56TB spare         Pool0             XGB17-02
1.0.20.P2                 53.88GB spare         Pool0             XGB17-02
1.0.21.P1                  1.56TB spare         Pool0             XGB17-01
1.0.21.P2                 53.88GB spare         Pool0             XGB17-01
...
48 entries were displayed.

But I have no clue how to do that over the API either.

Slavomir_K
666 Views

Hello, has anyone managed to solve this problem?

Public