Quick Dirty ONTAP 9 Disk Assignment

Below assumes you have passwordless ssh setup

Sometimes a new NetApp system comes in without the disk assignment not how you want. First disable autoassign on all cluster nodes:

ssh disk options modify -node <node> -autoassign off

For a bulk removal of disks based on shelf number, for example 01 to 03, you can run the command:

for i in `ssh cluster01 node run -node nas01a disk show -o nas01a | grep ^[0-9][a-z].0[1..3]. | awk '{print $1}'`; do echo "removing ownership of disk nas01a:$i"; ssh cluster01 disk removeowner -disk nas01a:$i; sleep 1; done

Then to assign them to the other head:

for i in `ssh cluster01 disk show | grep unassigned | awk '{print $1}'`; do ssh cluster01 disk assign -disk $i -owner nas01b; done

Re-enable autoassign.


2 thoughts on “Quick Dirty ONTAP 9 Disk Assignment”

  1. Hi, will removal of disk ownership cause data loss? Can it be done during production hours?

    1. As far as I’m aware this can only be done on spare disks, in the example given a couple of the disks in the chosen shelves were part of aggr0 and were left alone.

      It can be done without data loss and in production hours, if unsure just add an extra fiter for spare disks. Only worry would be the very small chance of a disk failure during the process leaving you with no spares.

      Also I’ve only ever done this on new systems with no data on so haven’t had to tread carefully before.

Leave a Reply

Your email address will not be published.