vm.device.get_instance¶
Returns instance matching id. If id is not found, Validation error is raised.
Please see query method documentation for options.
No Additional Items
Tuple Validation
Parameter 1: id
id
Type: integerParameter 2: options
options
Type: object Default: {}Query options customize the results returned by a query method. More complete documentation with examples are covered in the "Query methods" section of the TrueNAS API documentation.
No Additional PropertiesExtra
Type: object Default: {}Extra options are defined on a per-endpoint basis and are described in the documentation for the associated query method.
Order By
Type: array of string Default: []An array of field names describing the manner in which query results should be ordered. The field names may also have one of more of the following special prefixes: -
(reverse sort direction), nulls_first:
(place any null values at the head of the results list), nulls_last:
(place any null values at the tail of the results list).
Each item of this array must be:
[
"size",
"-devname",
"nulls_first:-expiretime"
]
Select
Type: array Default: []An array of field names specifying the exact fields to include in the query return. The dot character .
may be used to explicitly select only subkeys of the query result.
Each item of this array must be:
No Additional Items
Each item of this array must be:
[
"username",
"Authentication.status"
]
Count
Type: boolean Default: falseReturn a numeric value representing the number of items that match the specified query-filters
.
Get
Type: boolean Default: falseReturn the JSON object of the first result matching the specified query-filters
. The query fails if there specified query-filters
return no results.
Offset
Type: integer Default: 0This specifies the beginning offset of the results array. When combined with the limit
query-option it may be used to implement pagination of large results arrays. WARNING: some query methods provide volatile results and the onus is on the developer to understand whether pagination is appropriate for a particular query API method.
Limit
Type: integer Default: 0This specifies the maximum number of results matching the specified query-filters
to return. When combined wtih the offset
query-option it may be used to implement pagination of large results arrays.
WARNING: Some query methods provide volatile results and the onus is on the developer to understand whether pagination is appropriate for a particular query API method.
Force Sql Filters
Type: boolean Default: falseForce use of SQL for result filtering to reduce response time. May not work for all methods.
VMDeviceEntry
Type: objectNo Additional Properties
Id
Type: integerUnique identifier for the VM device.
Attributes
Device-specific configuration attributes.
VMCDROMDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for CD-ROM/DVD devices.
Must be one of:
- "CDROM"
"CDROM"
Path
Type: string Default: "*"Path must not contain "{", "}" characters, and it should start with "/mnt/".
Must match regular expression:^[^{}]*$
Must be at least 1
characters long
VMDisplayDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for display/graphics devices.
Must be one of:
- "DISPLAY"
"DISPLAY"
Resolution
Type: enum (of string) Default: "1024x768"Screen resolution for the virtual display.
Must be one of:
- "1920x1200"
- "1920x1080"
- "1600x1200"
- "1600x900"
- "1400x1050"
- "1280x1024"
- "1280x720"
- "1024x768"
- "800x600"
- "640x480"
Port
Default: nullVNC/SPICE port number for remote display access. null
for auto-assignment.
Value must be greater or equal to 5900
and lesser or equal to 65535
Web Port
Default: nullWeb-based display access port number. null
for auto-assignment.
Bind
Type: string Default: "127.0.0.1"IP address to bind the display server to.
Must be at least 1
characters long
Wait
Type: boolean Default: falseWhether to wait for a client connection before starting the VM.
Password
Default: nullPassword for display server authentication.
Web
Type: boolean Default: trueWhether to enable web-based display access.
Type
Type: enum (of string) Default: "SPICE"Display protocol type.
Must be one of:
- "SPICE"
- "VNC"
VMNICDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for network interface cards.
Must be one of:
- "NIC"
"NIC"
Trust Guest Rx Filters
Type: boolean Default: falseWhether to trust guest OS receive filter settings for better performance.
Type
Type: enum (of string) Default: "E1000"Network interface controller type. E1000
for Intel compatibility, VIRTIO
for performance.
Must be one of:
- "E1000"
- "VIRTIO"
Nic Attach
Default: nullHost network interface or bridge to attach to. null
for no attachment.
Mac
Default: nullMAC address for the virtual network interface. null
for auto-generation.
Must match regular expression:
^([0-9A-Fa-f]{2}[:-]?){5}([0-9A-Fa-f]{2})$
VMPCIDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for PCI passthrough devices.
Must be one of:
- "PCI"
"PCI"
Pptdev
Type: stringHost PCI device identifier to pass through to the VM.
Must be at least 1
characters long
VMRAWDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for raw disk devices.
Must be one of:
- "RAW"
"RAW"
Path
Type: string Default: "127.0.0.1"Path must not contain "{", "}" characters.
Must match regular expression:^[^{}]*$
Must be at least 1
characters long
Type
Type: enum (of string) Default: "AHCI"Disk controller interface type. AHCI for compatibility, VIRTIO for performance.
Must be one of:
- "AHCI"
- "VIRTIO"
Exists
Type: boolean Default: falseWhether the disk file already exists or should be created.
Boot
Type: boolean Default: falseWhether this disk should be marked as bootable.
Size
Default: nullSize of the disk in bytes. Required if creating a new disk file.
Logical Sectorsize
Default: nullLogical sector size for the disk. null
for default.
Must be one of:
- null
- 512
- 4096
Physical Sectorsize
Default: nullPhysical sector size for the disk. null
for default.
Must be one of:
- null
- 512
- 4096
Iotype
Type: enum (of string) Default: "THREADS"I/O backend type for disk operations.
Must be one of:
- "NATIVE"
- "THREADS"
- "IO_URING"
Serial
Default: nullSerial number to assign to the virtual disk. null
for auto-generated.
Must be at least 1
characters long
VMDiskDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for virtual disk devices.
Must be one of:
- "DISK"
"DISK"
Path
Default: nullPath to existing disk file or ZFS volume. null
if creating a new ZFS volume.
Must be at least 1
characters long
Type
Type: enum (of string) Default: "AHCI"Disk controller interface type. AHCI for compatibility, VIRTIO for performance.
Must be one of:
- "AHCI"
- "VIRTIO"
Create Zvol
Type: boolean Default: falseWhether to create a new ZFS volume for this disk.
Zvol Name
Default: nullName for the new ZFS volume. Required if create_zvol
is true.
Zvol Volsize
Default: nullSize of the new ZFS volume in bytes. Required if create_zvol
is true.
Logical Sectorsize
Default: nullLogical sector size for the disk. null
for default.
Must be one of:
- null
- 512
- 4096
Physical Sectorsize
Default: nullPhysical sector size for the disk. null
for default.
Must be one of:
- null
- 512
- 4096
Iotype
Type: enum (of string) Default: "THREADS"I/O backend type for disk operations.
Must be one of:
- "NATIVE"
- "THREADS"
- "IO_URING"
Serial
Default: nullSerial number to assign to the virtual disk. null
for auto-generated.
Must be at least 1
characters long
VMUSBDevice
Type: objectNo Additional Properties
Dtype
Type: constDevice type identifier for USB devices.
Must be one of:
- "USB"
"USB"
USB device attributes for identification. null
for USB host controller only.
USBAttributes
Type: objectNo Additional Properties
Vendor Id
Type: string Default: "127.0.0.1"USB vendor identifier in hexadecimal format (e.g., '0x1d6b' for Linux Foundation).
Must match regular expression:^0x.*
Must be at least 1
characters long
Product Id
Type: string Default: "127.0.0.1"USB product identifier in hexadecimal format (e.g., '0x0002' for 2.0 root hub).
Must match regular expression:^0x.*
Must be at least 1
characters long
Controller Type
Type: enum (of string) Default: "nec-xhci"USB controller type for the virtual machine.
Must be one of:
- "piix3-uhci"
- "piix4-uhci"
- "ehci"
- "ich9-ehci1"
- "vt82c686b-uhci"
- "pci-ohci"
- "nec-xhci"
- "qemu-xhci"
Device
Default: nullHost USB device path to pass through. null
for controller only.
Must be at least 1
characters long
Vm
Type: integerID of the virtual machine this device belongs to.
Order
Type: integerBoot order priority for this device (lower numbers boot first).
Required roles: VM_DEVICE_READ