Project

General

Profile

Bug #24231

Creating zvols via api only uses name and volsize from input

Added by Michael Rasmussen over 3 years ago. Updated over 3 years ago.

Status:
Closed: Duplicate
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Target version:
-
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I am trying to work with the api using documentation from http://api.freenas.org/resources/storage.html

Trying to create a zvol this way:
Request
POST https://freenas/api/v1.0/storage/volume/tank/zvols/
HTTP/1.1
Content-Type: application/json {
"name": "test2",
"refer": "10M",
"used": "10M",
"volsize": 10485760
}
Response
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json {
"name": "test2",
"refer": "10M",
"used": "10M",
"volsize": 10485760
}

But it only seems that name and volsize is used since used and refer are not used:
zfs get volsize,used,reservation tank/test2
NAME PROPERTY VALUE SOURCE
tank/test2 volsize 10M local
tank/test2 used 56K -
tank/test2 reservation none default

Above means that it is only possible to create sparse zvols through the api.


Related issues

Related to FreeNAS - Bug #23881: Unify API code to create/update zvolResolved2017-05-09
Related to FreeNAS - Bug #23850: Add compression and dedup to zvol APIResolved2017-05-08

History

#1 Updated by William Grzybowski over 3 years ago

  • Status changed from Unscreened to Closed: Duplicate

The api docs is reflecting 11.0/nightlies. This is indeed not working in 9.10.

#2 Updated by William Grzybowski over 3 years ago

  • Related to Bug #23881: Unify API code to create/update zvol added

#3 Updated by William Grzybowski over 3 years ago

  • Related to Bug #23850: Add compression and dedup to zvol API added

#4 Updated by Michael Rasmussen over 3 years ago

William Grzybowski wrote:

The api docs is reflecting 11.0/nightlies. This is indeed not working in 9.10.

Can you tell me where I can read the documentation for 9.10?
Pointing me to the source would not be a problem.

#5 Updated by William Grzybowski over 3 years ago

Michael Rasmussen wrote:

William Grzybowski wrote:

The api docs is reflecting 11.0/nightlies. This is indeed not working in 9.10.

Can you tell me where I can read the documentation for 9.10?
Pointing me to the source would not be a problem.

Currently the closest you can find is https://github.com/freenas/freenas/tree/9.10.2-STABLE/docs/api/resources

#6 Updated by Michael Rasmussen over 3 years ago

William Grzybowski wrote:

Michael Rasmussen wrote:

William Grzybowski wrote:

The api docs is reflecting 11.0/nightlies. This is indeed not working in 9.10.

Can you tell me where I can read the documentation for 9.10?
Pointing me to the source would not be a problem.

Currently the closest you can find is https://github.com/freenas/freenas/tree/9.10.2-STABLE/docs/api/resources

Is https://github.com/freenas/freenas/blob/9.10.2-U4/docs/api different from your suggestion?

A side note: I was a bit puzzled by the way LUNs are exposed. No LUNs are exposed before the target is connected to a target group which is a bit unusual so maybe it was an idea to add this information to the documentation?

#7 Updated by William Grzybowski over 3 years ago

Michael Rasmussen wrote:

William Grzybowski wrote:

Michael Rasmussen wrote:

William Grzybowski wrote:

The api docs is reflecting 11.0/nightlies. This is indeed not working in 9.10.

Can you tell me where I can read the documentation for 9.10?
Pointing me to the source would not be a problem.

Currently the closest you can find is https://github.com/freenas/freenas/tree/9.10.2-STABLE/docs/api/resources

Is https://github.com/freenas/freenas/blob/9.10.2-U4/docs/api different from your suggestion?

A side note: I was a bit puzzled by the way LUNs are exposed. No LUNs are exposed before the target is connected to a target group which is a bit unusual so maybe it was an idea to add this information to the documentation?

It is basically the same.

Care to give an example about LUNs? You should be able to create/update/list/delete extents just fine before the target.

#8 Updated by Michael Rasmussen over 3 years ago

William Grzybowski wrote:

A side note: I was a bit puzzled by the way LUNs are exposed. No LUNs are exposed before the target is connected to a target group which is a bit unusual so maybe it was an idea to add this information to the documentation?

Care to give an example about LUNs? You should be able to create/update/list/delete extents just fine before the target.

I followed these steps using the API:
0) Target Global Configuration, Portal, and Initiator created in web gui. Network and initiators: ALL. Auth: none
1) Create a zvol
2) Create an extent using zvol from 1)
3) Create a target
4) Create target to extend using target from 3) and extend from 2)

Using iscsi_discovery to successful login to the portal.
Using iscsi-inq returned no targets.
Went to the web gui and opened the target created from 3) for edit reviled the missing pieces. Portal Group ID and Initiator Group ID was empty but as soon as I did the following:
5) {
"iscsi_target": ID_of_target_from_3,
"iscsi_target_authgroup": null,
"iscsi_target_authtype": "None",
"iscsi_target_portalgroup": Portal_Group_ID_found_in_web_gui,
"iscsi_target_initiatorgroup": null,
"iscsi_target_initialdigest": "Auto"
}
Portal Group ID and Initiator Group ID was no longer empty in web gui and iscsi-inq found the extend/LUN from 2)

Also available in: Atom PDF