Syntax for creating a striped volume across mirrored vdevs with API?

Status
Not open for further replies.

iSCSIinitiator

Dabbler
Joined
Jul 17, 2014
Messages
16
Hi. I'm trying to create a volume that stripes across a set of mirrored vdevs using the REST API. The documentation is here:

http://api.freenas.org/resources/storage.html#create-resource

but it only indicates how to create a volume with one vdev.

Can anyone please help me out with how to do this?

I'd like to do this in one command, but I am happy to do this as multiple commands if necessary (e.g., first create each mirrored vdev, then create a volume striping across them).

The following doesn't seem to work:

Code:
POST /api/v1.0/storage/volume/ HTTP/1.1
Content-Type: application/json

  {
          "volume_name": "tank",
          "layout": [
                  {
                          "vdevtype": "mirror",
                          "disks": ["da2", "da3"]
                  },
                  {
                          "vdevtype": "mirror",
                          "disks": ["da4", "da5"]
                  }
          ]
  }


It was just a guess and I was hoping that striping would be implied across the list of multiple vdevs (it doesn't work, though). Any suggestions would be really appreciated. Thanks very much!
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
Why u don't just use the web gui?
 

iSCSIinitiator

Dabbler
Joined
Jul 17, 2014
Messages
16
It's a long story, but I can't use the web GUI for this, but I do want to create the volume the "FreeNAS" way so that everything else in the web GUI will work once the volume is created (hence the REST API). As an example of why this is important, imagine having lots of disks and multiple controllers and wanting to set up mirrors that span controllers and then stripe across them. I don't want to use the command line if I can avoid it because I want to make sure all the "FreeNAS" magic (partitioning, etc.) happens when the volume is created.

Thanks.
 

iSCSIinitiator

Dabbler
Joined
Jul 17, 2014
Messages
16
Actually, it looks like the above does work, which is awesome. Something else was wrong that was causing problems for me. So, given that striping across the vdevs seems to be implied (which is what I want), I am just wondering out of curiosity, is there a way to explicitly request striping across the vdevs? I'll update this post if I figure anything else out (since I haven't found documentation on this yet). Thanks for your help.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Pools are always striped among all available vdevs. AFAIK, ZFS doesn't handle multiple vdevs in any other way, so there wouldn't be any reason to specify this treatment.
 
Status
Not open for further replies.
Top