Create virtual machine storage from a disk image
POST
/vm/{rid}/storage/from-image
const url = 'https://sylve.lan:8181/api/vm/1/storage/from-image';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"bootOrder":1,"downloadUUID":"example","emulation":"virtio-blk","name":"example","pool":"example","recordSize":1,"size":1,"storageType":"raw","volBlockSize":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sylve.lan:8181/api/vm/1/storage/from-image \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "bootOrder": 1, "downloadUUID": "example", "emulation": "virtio-blk", "name": "example", "pool": "example", "recordSize": 1, "size": 1, "storageType": "raw", "volBlockSize": 1 }'Copy or convert a completed Downloader disk image into a writable managed RAW file or ZFS volume and attach it to a shut-off virtual machine. The source download remains unchanged. Omit size to use the image’s virtual capacity, or specify a larger size in bytes; guest partitions and filesystems are not expanded automatically. Installer ISOs and images with external backing files are rejected. Compressed images must be extracted first. Storage topology changes are blocked while the VM is protected by replication.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”rid
required
integer
Virtual Machine RID
Request Body
Section titled “Request Body”Writable disk image import
Media typeapplication/json
object
bootOrder
integer
downloadUUID
required
string
emulation
required
string
name
required
string
pool
required
string
recordSize
integer
size
integer
storageType
required
string
volBlockSize
integer
Responses
Section titled “Responses”Created
Media typeapplication/json
object
data
object
bootOrder
integer
dataset
object
guid
string
id
integer
name
string
pool
string
datasetId
integer
emulation
string
enable
boolean
filesystemTarget
string
id
integer
name
string
pool
string
readOnly
boolean
recordSize
integer
size
integer
type
string
uuid
string
vmId
integer
volBlockSize
integer
error
string
message
string
status
string
Example
{ "data": { "emulation": "virtio-blk", "type": "raw" }}Bad Request
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Unauthorized
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Forbidden
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Not Found
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Conflict
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Request Entity Too Large
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Internal Server Error
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}Service Unavailable
Media typeapplication/json
object
data
error
string
message
string
status
string
Examplegenerated
{ "data": "example", "error": "example", "message": "example", "status": "example"}