Skip to content

Create virtual machine storage from a disk image

POST
/vm/{rid}/storage/from-image
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.

rid
required
integer
>= 1

Virtual Machine RID

Writable disk image import

Media typeapplication/json
object
bootOrder
integer
downloadUUID
required
string
emulation
required
string
Allowed values: virtio-blk virtio-9p ahci-hd ahci-cd nvme
name
required
string
pool
required
string
recordSize
integer
size
integer
storageType
required
string
Allowed values: raw zvol image filesystem none
volBlockSize
integer

Created

Media typeapplication/json
object
data
object
bootOrder
integer
dataset
object
guid
string
id
integer
name
string
pool
string
datasetId
integer
emulation
string
Allowed values: virtio-blk virtio-9p ahci-hd ahci-cd nvme
enable
boolean
filesystemTarget
string
id
integer
name
string
pool
string
readOnly
boolean
recordSize
integer
size
integer
type
string
Allowed values: raw zvol image filesystem
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"
}