Hello,
I am currently evaluating FreeNAS as a high-performance block storage appliance and am trying to accomplish the following:
1) Take snapshot of "master" zvol.
2) Create iSCSI extent from said snapshot.
3) Present said extent to dedicated iscsi initiator.
The environment will eventually be hosting VDI images that are spun up and tore down frequently. Scale wise, i am looking to build a FreeNAS system capable of delivering ~800 instances.
I am using the API to achieve this as follows testing 100 instances. When getting my script ready, I never have any issues using a quantity of 3.
create.py
#!/usr/local/bin/python
#Import Stuff
import json
import requests
#Create snapshots
for a in range(0, 100):
r = requests.post(
'http://XXX/api/v1.0/storage/snapshot/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'dataset': 'ZFS_VOL1/ZFS_ZVOL1',
'name': (a),
})
)
print r.status_code
print r.json()
#Create iSCSI Exents
for a in range(0, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/extent/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_extent_type': 'Disk',
'iscsi_target_extent_disk': 'zvol/ZFS_VOL1/ZFS_ZVOL1@' + (a_str),
'iscsi_target_extent_name': (a_str),
})
)
print r.status_code
print r.json()
#Create iscsi initiators
for a in range(0, 100):
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/authorizedinitiator/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_initiator_initiators': 'ALL',
'iscsi_target_initiator_auth_network': 'ALL',
})
)
print r.status_code
print r.json()
#Create iscsi targets
for a in range(1, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/target/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_name': (a_str),
'iscsi_target_portalgroup': '1',
'iscsi_target_initiatorgroup': (a_str),
'iscsi_target_authtype': 'None',
})
)
print r.status_code
print r.json()
#Create iscsi target / extent
for a in range(1, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/targettoextent/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target': (a_str),
'iscsi_extent': (a_str),
})
)
print r.status_code
print r.json()
When i attempt to make this more transactional by running the above script, followed by delete requests to clean all this up, the API start throwning 500 errors and the web interface stops responding. I do notice the nginx process is still running and restarting it doesnt help. After a full reboot, i can start my cleanup script again and the behavior will change as it will immediately throw 500 errors but when I check the web interface, the objects are deleted successfully.
I am not sure if this is an API bug, or if I am running into a configured objects limit or some other limit.
Any assistance would be appreciated.
Mike
I am currently evaluating FreeNAS as a high-performance block storage appliance and am trying to accomplish the following:
1) Take snapshot of "master" zvol.
2) Create iSCSI extent from said snapshot.
3) Present said extent to dedicated iscsi initiator.
The environment will eventually be hosting VDI images that are spun up and tore down frequently. Scale wise, i am looking to build a FreeNAS system capable of delivering ~800 instances.
I am using the API to achieve this as follows testing 100 instances. When getting my script ready, I never have any issues using a quantity of 3.
create.py
#!/usr/local/bin/python
#Import Stuff
import json
import requests
#Create snapshots
for a in range(0, 100):
r = requests.post(
'http://XXX/api/v1.0/storage/snapshot/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'dataset': 'ZFS_VOL1/ZFS_ZVOL1',
'name': (a),
})
)
print r.status_code
print r.json()
#Create iSCSI Exents
for a in range(0, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/extent/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_extent_type': 'Disk',
'iscsi_target_extent_disk': 'zvol/ZFS_VOL1/ZFS_ZVOL1@' + (a_str),
'iscsi_target_extent_name': (a_str),
})
)
print r.status_code
print r.json()
#Create iscsi initiators
for a in range(0, 100):
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/authorizedinitiator/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_initiator_initiators': 'ALL',
'iscsi_target_initiator_auth_network': 'ALL',
})
)
print r.status_code
print r.json()
#Create iscsi targets
for a in range(1, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/target/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target_name': (a_str),
'iscsi_target_portalgroup': '1',
'iscsi_target_initiatorgroup': (a_str),
'iscsi_target_authtype': 'None',
})
)
print r.status_code
print r.json()
#Create iscsi target / extent
for a in range(1, 100):
a_str = str(a)
r = requests.post(
'http://XXX/api/v1.0/services/iscsi/targettoextent/',
auth=('root', 'XXX'),
headers={'Content-Type': 'application/json'},
verify=False,
data=json.dumps({
'iscsi_target': (a_str),
'iscsi_extent': (a_str),
})
)
print r.status_code
print r.json()
When i attempt to make this more transactional by running the above script, followed by delete requests to clean all this up, the API start throwning 500 errors and the web interface stops responding. I do notice the nginx process is still running and restarting it doesnt help. After a full reboot, i can start my cleanup script again and the behavior will change as it will immediately throw 500 errors but when I check the web interface, the objects are deleted successfully.
I am not sure if this is an API bug, or if I am running into a configured objects limit or some other limit.
Any assistance would be appreciated.
Mike