API 1.0, Create volume is not working

mani1978

Cadet
Joined
Aug 1, 2020
Messages
1
I use the following code and tried various other methods/options also, It is not creating a volumn.

resp = requests.post(
'http://MY-SERVER-IP/api/v1.0/storage/volume/',
auth=('root','MYPASSWORD@2021'),
headers={'Content-Type': 'application/json'},
data=json.dumps({
"volume_name": "tank",
"layout": [
{
"vdevtype": "stripe",
"disks": ["ada3", "ada4", "ada1", "ada2"],
}
]
})
)

print resp ;
data = resp.json()
print(json.dumps(data, indent=4, sort_keys=True))

I get the following
<Response [409]>
{
"__all__": [
"The following disks are already in use: ada3,ada4,ada1,ada2."
]
}

Version: FreeNAS-11.3-U4
Please guide me what is wrong in this step.
 
Top