virt.instance.device_add¶
Add a device to an instance.
No Additional Items
Tuple Validation
Parameter 1: id
id
Type: stringID of the virtual instance to add device to.
Parameter 2: device
device
Device configuration to add to the instance.
Disk
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for virtual disk devices.
Must be one of:
- "DISK"
"DISK"
Source
Default: nullFor CONTAINER instances, this would be a valid pool path. For VM instances, it can be a valid zvol path or an incus storage volume name.
Must be at least 1
characters long
Destination
Default: nullTarget path where the disk appears inside the virtualized instance.
Boot Priority
Default: nullBoot priority for this disk device. Lower numbers boot first. null
means non-bootable.
Value must be greater or equal to 0
Io Bus
Type: enum (of null or string) Default: nullStorage bus type for optimal performance and compatibility.
Must be one of:
- "NVME"
- "VIRTIO-BLK"
- "VIRTIO-SCSI"
- null
Storage Pool
Default: nullStorage pool in which the device is located. This must be one of the storage pools listed in virt.global.config output.
If this is set to None during device creation, then the default storage pool defined in virt.global.config will be used.
Must be at least 1
characters long
GPU
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for graphics processing units.
Must be one of:
- "GPU"
"GPU"
Gpu Type
Type: enum (of string)Type of GPU virtualization (physical passthrough, mediated device, etc.).
Must be one of:
- "PHYSICAL"
- "MDEV"
- "MIG"
- "SRIOV"
Id
Default: nullUnique identifier for the GPU device.
Gid
Default: nullGroup ID for device permissions inside the container.
Value must be greater or equal to 0
and lesser or equal to 90000000
Uid
Default: nullUser ID for device permissions inside the container.
Value must be greater or equal to 0
and lesser or equal to 90000000
Mode
Default: nullPermission mode for device access (e.g., '660').
Mdev
Default: nullMediated device identifier for GPU virtualization.
Must be at least 1
characters long
Mig Uuid
Default: nullMulti-Instance GPU UUID for NVIDIA GPU partitioning.
Must be at least 1
characters long
Pci
Default: nullPCI address of the GPU device on the host system.
Must be at least 1
characters long
Productid
Default: nullProduct identifier for GPU device matching.
Must be at least 1
characters long
Vendorid
Default: nullVendor identifier for GPU device matching.
Must be at least 1
characters long
Proxy
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for network port forwarding.
Must be one of:
- "PROXY"
"PROXY"
Source Proto
Type: enum (of string)Network protocol (TCP or UDP) for the source connection.
Must be one of:
- "UDP"
- "TCP"
Source Port
Type: integerSource port number on the host system to forward from.
Value must be greater or equal to 1
and lesser or equal to 65535
Dest Proto
Type: enum (of string)Network protocol (TCP or UDP) for the destination connection.
Must be one of:
- "UDP"
- "TCP"
Dest Port
Type: integerDestination port number inside the virtualized instance.
Value must be greater or equal to 1
and lesser or equal to 65535
TPM
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for Trusted Platform Module devices.
Must be one of:
- "TPM"
"TPM"
Path
Default: nullPath to the TPM device on the host system.
Pathrm
Default: nullResource manager path for TPM device access.
USB
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for USB devices.
Must be one of:
- "USB"
"USB"
Bus
Default: nullUSB bus number on the host system.
Dev
Default: nullUSB device number on the specified bus.
Product Id
Default: nullUSB product identifier for device matching.
Vendor Id
Default: nullUSB vendor identifier for device matching.
NIC
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for network interface cards.
Must be one of:
- "NIC"
"NIC"
Network
Default: nullName of the network to connect this NIC to.
Must be at least 1
characters long
Nic Type
Default: nullType of network interface (bridged or macvlan).
Must be one of:
- "BRIDGED"
- "MACVLAN"
Parent
Default: nullParent network interface on the host system.
Must be at least 1
characters long
Mac
Default: nullMAC address for the virtual network interface. null
for auto-generated.
PCI
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for PCI device passthrough.
Must be one of:
- "PCI"
"PCI"
Address
Type: stringPCI bus address of the device to pass through to the virtualized instance.
Must be at least 1
characters long
CDROM
Type: objectNo Additional Properties
Name
Default: nullOptional human-readable name for the virtualization device.
Must be at least 1
characters long
Description
Default: nullOptional description explaining the purpose or configuration of this device.
Must be at least 1
characters long
Readonly
Type: boolean Default: falseWhether the device should be mounted in read-only mode.
Dev Type
Type: constDevice type identifier for CD-ROM/DVD optical drives.
Must be one of:
- "CDROM"
"CDROM"
Source
Type: stringPath to the ISO image file or physical optical drive to mount.
Must be at least 1
characters long
Boot Priority
Default: nullBoot priority for this optical device. Lower numbers boot first. null
means non-bootable.
Value must be greater or equal to 0
Result
Type: constReturns true
when the device is successfully added.
Must be one of:
- true
true
Required roles: VIRT_INSTANCE_WRITE