1 Reply Latest reply: Sep 17, 2012 9:14 AM by Nik RSS

    ZFS 7000 appliance cli: list available pools

    Desert Sun
      Hi,
      I'm currently writing a script for the S7000 and I need to list the pools available on the S7000.
      How can we do this?

      "set pool" requires you to set the pool before doing an action, so I need to know the possible values beforehand.

      I tried this simple script to list the available pools:
      script
      {
      printf("Listing pools\n");
      run('cd /');
      run('configuration storage');
      pools = list();
      dump (pools);
      for (j = 0; j < pools.length; j++) {
      run('set pool=' + pools[j]);
      printf("%s %s %s\n", pools[j], get('status'), get('profile'));
      }
      }

      But the dump command already shows an empty array for pools...
      Any ideas?

      Regards,
      Kristof.
        • 1. Re: ZFS 7000 appliance cli: list available pools
          Nik
          Hi.

          configuration storage does't give list of pool.

          It's not fully same what you plan but work :

          script
          {
          printf("Listing pools\n");
          run('cd /');
          run('status storage');
          pools = list();
          dump (pools);
          for (j = 0; j < pools.length; j++) {
          run('select ' + pools[j]);
          printf("%s %s\n", pools[j], get('state'));
          }
          }



          Regards.