Subscribe

SDK - Get Non-Root Aggregates

Hi,

 

I have used the ZAPI tool to generate the following XML:

 

<?xml version="1.0" encoding="UTF-8"?>
<netapp  xmlns="http://www.netapp.com/filer/admin" version="1.31">
  <aggr-get-iter>
    <desired-attributes>...snipped for brevity...</desired-attributes>
	<query>
		<aggr-attributes>
			<aggr-raid-attributes>
				<is-root-aggregate>false</is-root-aggregate>
			</aggr-raid-attributes>
		</aggr-attributes>
	</query>
    </aggr-get-iter>
</netapp>

 

Unfortunately, this still returns root aggregates (running against a CDOT 8.3.2P9 cluster). How can I get only non-root aggregates?

 

Thanks!

Re: SDK - Get Non-Root Aggregates

Not familiar with the API.. but have you tried looking for "ha_policy" of "cfo"? Only root aggregates have the ha_policy set to "cfo" (controller failover) - all others are sfo (storage failover). 

Re: SDK - Get Non-Root Aggregates

Maybe check for aggr-raid-attributes -> has-local-root and aggr-raid-attributes -> has-partner-root to both be false.  FWIW, your query works fine against my ONTAP 9.0 system.

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: SDK - Get Non-Root Aggregates

Thanks for your suggestions, everyone.

 

Looks like it's actually an issue with the ZAPI tool - I can use the tool to generate the code, but if I try to execute it, it brings back the wrong results. If I copy the generated XML and run it outside of the tool, it works as expected.