Struct PostParams

Source
pub struct PostParams {
Show 87 fields pub acpi: Option<bool>, pub affinity: Option<String>, pub agent: Option<String>, pub arch: Option<Arch>, pub archive: Option<String>, pub args: Option<String>, pub audio0: Option<String>, pub autostart: Option<bool>, pub balloon: Option<u64>, pub bios: Option<Bios>, pub boot: Option<String>, pub bootdisk: Option<String>, pub bwlimit: Option<()>, pub cdrom: Option<String>, pub cicustom: Option<String>, pub cipassword: Option<String>, pub citype: Option<Citype>, pub ciupgrade: Option<bool>, pub ciuser: Option<String>, pub cores: Option<u64>, pub cpu: Option<String>, pub cpulimit: Option<f64>, pub cpuunits: Option<()>, pub description: Option<String>, pub efidisk0: Option<String>, pub force: Option<bool>, pub freeze: Option<bool>, pub hookscript: Option<String>, pub hostpcis: HashMap<u32, String>, pub hotplug: Option<String>, pub hugepages: Option<Hugepages>, pub ides: HashMap<u32, String>, pub ipconfigs: HashMap<u32, String>, pub ivshmem: Option<String>, pub keephugepages: Option<bool>, pub keyboard: Option<Keyboard>, pub kvm: Option<bool>, pub live_restore: Option<bool>, pub localtime: Option<bool>, pub lock: Option<Lock>, pub machine: Option<String>, pub memory: Option<String>, pub migrate_downtime: Option<f64>, pub migrate_speed: Option<u64>, pub name: Option<String>, pub nameserver: Option<String>, pub nets: HashMap<u32, String>, pub numa: Option<bool>, pub numas: HashMap<u32, String>, pub onboot: Option<bool>, pub ostype: Option<Ostype>, pub parallels: HashMap<u32, String>, pub pool: Option<String>, pub protection: Option<bool>, pub reboot: Option<bool>, pub rng0: Option<String>, pub satas: HashMap<u32, String>, pub scsis: HashMap<u32, String>, pub scsihw: Option<Scsihw>, pub searchdomain: Option<String>, pub serials: HashMap<u32, String>, pub shares: Option<u64>, pub smbios1: Option<String>, pub smp: Option<u64>, pub sockets: Option<u64>, pub spice_enhancements: Option<String>, pub sshkeys: Option<String>, pub start: Option<bool>, pub startdate: Option<String>, pub startup: Option<String>, pub storage: Option<String>, pub tablet: Option<bool>, pub tags: Option<String>, pub tdf: Option<bool>, pub template: Option<bool>, pub tpmstate0: Option<String>, pub unique: Option<bool>, pub unuseds: HashMap<u32, String>, pub usbs: HashMap<u32, String>, pub vcpus: Option<u64>, pub vga: Option<String>, pub virtios: HashMap<u32, String>, pub vmgenid: Option<String>, pub vmid: VmId, pub vmstatestorage: Option<String>, pub watchdog: Option<String>, pub additional_properties: HashMap<String, Value>,
}

Fields§

§acpi: Option<bool>

Enable/disable ACPI.

§affinity: Option<String>

List of host cores used to execute guest processes, for example: 0,5,8-11

§agent: Option<String>

Enable/disable communication with the QEMU Guest Agent and its properties.

§arch: Option<Arch>

Virtual processor architecture. Defaults to the host.

§archive: Option<String>

The backup archive. Either the file system path to a .tar or .vma file (use ‘-’ to pipe data from stdin) or a proxmox storage backup volume identifier.

§args: Option<String>

Arbitrary arguments passed to kvm. Arbitrary arguments passed to kvm, for example:

args: -no-reboot -smbios ‘type=0,vendor=FOO’

NOTE: this option is for experts only.

§audio0: Option<String>

Configure a audio device, useful in combination with QXL/Spice.

§autostart: Option<bool>

Automatic restart after crash (currently ignored).

§balloon: Option<u64>

Amount of target RAM for the VM in MiB. Using zero disables the ballon driver.

§bios: Option<Bios>

Select BIOS implementation.

§boot: Option<String>

Specify guest boot order. Use the ‘order=’ sub-property as usage with no key or ‘legacy=’ is deprecated.

§bootdisk: Option<String>

Enable booting from specified disk. Deprecated: Use ‘boot: order=foo;bar’ instead.

§bwlimit: Option<()>

Override I/O bandwidth limit (in KiB/s).

§cdrom: Option<String>

This is an alias for option -ide2

§cicustom: Option<String>

cloud-init: Specify custom files to replace the automatically generated ones at start.

§cipassword: Option<String>

cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords.

§citype: Option<Citype>

Specifies the cloud-init configuration format. The default depends on the configured operating system type (ostype. We use the nocloud format for Linux, and configdrive2 for windows.

§ciupgrade: Option<bool>

cloud-init: do an automatic package upgrade after the first boot.

§ciuser: Option<String>

cloud-init: User name to change ssh keys and password for instead of the image’s configured default user.

§cores: Option<u64>

The number of cores per socket.

§cpu: Option<String>

Emulated CPU type.

§cpulimit: Option<f64>

Limit of CPU usage. Limit of CPU usage.

NOTE: If the computer has 2 CPUs, it has total of ‘2’ CPU time. Value ‘0’ indicates no CPU limit.

§cpuunits: Option<()>

CPU weight for a VM, will be clamped to [1, 10000] in cgroup v2. CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.

§description: Option<String>

Description for the VM. Shown in the web-interface VM’s summary. This is saved as comment inside the configuration file.

§efidisk0: Option<String>

Configure a disk for storing EFI vars. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and that the default EFI vars are copied to the volume instead. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§force: Option<bool>

Allow to overwrite existing VM.

§freeze: Option<bool>

Freeze CPU at startup (use ‘c’ monitor command to start execution).

§hookscript: Option<String>

Script that will be executed during various steps in the vms lifetime.

§hostpcis: HashMap<u32, String>

Map host PCI devices into guest. Map host PCI devices into guest.

NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care.

CAUTION: Experimental! User reported problems with this option.

§hotplug: Option<String>

Selectively enable hotplug features. This is a comma separated list of hotplug features: ‘network’, ‘disk’, ‘cpu’, ‘memory’, ‘usb’ and ‘cloudinit’. Use ‘0’ to disable hotplug completely. Using ‘1’ as value is an alias for the default network,disk,usb. USB hotplugging is possible for guests with machine version >= 7.1 and ostype l26 or windows > 7.

§hugepages: Option<Hugepages>

Enable/disable hugepages memory.

§ides: HashMap<u32, String>

Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§ipconfigs: HashMap<u32, String>

cloud-init: Specify IP addresses and gateways for the corresponding interface.

IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified.

The special string ‘dhcp’ can be used for IP addresses to use DHCP, in which case no explicit gateway should be provided. For IPv6 the special string ‘auto’ can be used to use stateless autoconfiguration. This requires cloud-init 19.4 or newer.

If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using dhcp on IPv4.

§ivshmem: Option<String>

Inter-VM shared memory. Useful for direct communication between VMs, or to the host.

§keephugepages: Option<bool>

Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts.

§keyboard: Option<Keyboard>

Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS.

§kvm: Option<bool>

Enable/disable KVM hardware virtualization.

§live_restore: Option<bool>

Start the VM immediately while importing or restoring in the background.

§localtime: Option<bool>

Set the real time clock (RTC) to local time. This is enabled by default if the ostype indicates a Microsoft Windows OS.

§lock: Option<Lock>

Lock/unlock the VM.

§machine: Option<String>

Specifies the QEMU machine type.

§memory: Option<String>

Memory properties.

§migrate_downtime: Option<f64>

Set maximum tolerated downtime (in seconds) for migrations.

§migrate_speed: Option<u64>

Set maximum speed (in MB/s) for migrations. Value 0 is no limit.

§name: Option<String>

Set a name for the VM. Only used on the configuration web interface.

§nameserver: Option<String>

cloud-init: Sets DNS server IP address for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set.

§nets: HashMap<u32, String>

Specify network devices.

§numa: Option<bool>

Enable/disable NUMA.

§numas: HashMap<u32, String>

NUMA topology.

§onboot: Option<bool>

Specifies whether a VM will be started during system bootup.

§ostype: Option<Ostype>

Specify guest operating system. Specify guest operating system. This is used to enable special optimization/features for specific operating systems:

[horizontal] other;; unspecified OS wxp;; Microsoft Windows XP w2k;; Microsoft Windows 2000 w2k3;; Microsoft Windows 2003 w2k8;; Microsoft Windows 2008 wvista;; Microsoft Windows Vista win7;; Microsoft Windows 7 win8;; Microsoft Windows 8/2012/2012r2 win10;; Microsoft Windows 10/2016/2019 win11;; Microsoft Windows 11/2022 l24;; Linux 2.4 Kernel l26;; Linux 2.6 - 6.X Kernel solaris;; Solaris/OpenSolaris/OpenIndiania kernel

§parallels: HashMap<u32, String>

Map host parallel devices (n is 0 to 2). Map host parallel devices (n is 0 to 2).

NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such machines - use with special care.

CAUTION: Experimental! User reported problems with this option.

§pool: Option<String>

Add the VM to the specified pool.

§protection: Option<bool>

Sets the protection flag of the VM. This will disable the remove VM and remove disk operations.

§reboot: Option<bool>

Allow reboot. If set to ‘0’ the VM exit on reboot.

§rng0: Option<String>

Configure a VirtIO-based Random Number Generator.

§satas: HashMap<u32, String>

Use volume as SATA hard disk or CD-ROM (n is 0 to 5). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§scsis: HashMap<u32, String>

Use volume as SCSI hard disk or CD-ROM (n is 0 to 30). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§scsihw: Option<Scsihw>

SCSI controller model

§searchdomain: Option<String>

cloud-init: Sets DNS search domains for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set.

§serials: HashMap<u32, String>

Create a serial device inside the VM (n is 0 to 3) Create a serial device inside the VM (n is 0 to 3), and pass through a host serial device (i.e. /dev/ttyS0), or create a unix socket on the host side (use ‘qm terminal’ to open a terminal connection).

NOTE: If you pass through a host serial device, it is no longer possible to migrate such machines - use with special care.

CAUTION: Experimental! User reported problems with this option.

§shares: Option<u64>

Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning. Auto-ballooning is done by pvestatd.

§smbios1: Option<String>

Specify SMBIOS type 1 fields.

§smp: Option<u64>

The number of CPUs. Please use option -sockets instead.

§sockets: Option<u64>

The number of CPU sockets.

§spice_enhancements: Option<String>

Configure additional enhancements for SPICE.

§sshkeys: Option<String>

cloud-init: Setup public SSH keys (one key per line, OpenSSH format).

§start: Option<bool>

Start VM after it was created successfully.

§startdate: Option<String>

Set the initial date of the real time clock. Valid format for date are:‘now’ or ‘2006-06-17T16:01:21’ or ‘2006-06-17’.

§startup: Option<String>

Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the ‘up’ or ‘down’ delay in seconds, which specifies a delay to wait before the next VM is started or stopped.

§storage: Option<String>

Default storage.

§tablet: Option<bool>

Enable/disable the USB tablet device. Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. Else the mouse runs out of sync with normal VNC clients. If you’re running lots of console-only guests on one host, you may consider disabling this to save some context switches. This is turned off by default if you use spice (qm set \<vmid\> --vga qxl).

§tags: Option<String>

Tags of the VM. This is only meta information.

§tdf: Option<bool>

Enable/disable time drift fix.

§template: Option<bool>

Enable/disable Template.

§tpmstate0: Option<String>

Configure a Disk for storing TPM state. The format is fixed to ‘raw’. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and 4 MiB will be used instead. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§unique: Option<bool>

Assign a unique random ethernet address.

§unuseds: HashMap<u32, String>

Reference to unused volumes. This is used internally, and should not be modified manually.

§usbs: HashMap<u32, String>

Configure an USB device (n is 0 to 4, for machine version >= 7.1 and ostype l26 or windows > 7, n can be up to 14).

§vcpus: Option<u64>

Number of hotplugged vcpus.

§vga: Option<String>

Configure the VGA hardware. Configure the VGA Hardware. If you want to use high resolution modes (>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type is ‘std’ for all OS types besides some Windows versions (XP and older) which use ‘cirrus’. The ‘qxl’ option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays them self. You can also run without any graphic card, using a serial device as terminal.

§virtios: HashMap<u32, String>

Use volume as VIRTIO hard disk (n is 0 to 15). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the ‘import-from’ parameter to import from an existing volume.

§vmgenid: Option<String>

Set VM Generation ID. Use ‘1’ to autogenerate on create or update, pass ‘0’ to disable explicitly. The VM generation ID (vmgenid) device exposes a 128-bit integer value identifier to the guest OS. This allows to notify the guest operating system when the virtual machine is executed with a different configuration (e.g. snapshot execution or creation from a template). The guest operating system notices the change, and is then able to react as appropriate by marking its copies of distributed databases as dirty, re-initializing its random number generator, etc. Note that auto-creation only works when done through API/CLI create or update methods, but not when manually editing the config file.

§vmid: VmId

The (unique) ID of the VM.

§vmstatestorage: Option<String>

Default storage for VM state volumes/files.

§watchdog: Option<String>

Create a virtual hardware watchdog device. Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the watchdog will reset the guest (or execute the respective action specified)

§additional_properties: HashMap<String, Value>

Implementations§

Source§

impl PostParams

Source

pub fn new(vmid: VmId) -> Self

Trait Implementations§

Source§

impl Clone for PostParams

Source§

fn clone(&self) -> PostParams

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PostParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PostParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PostParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Test for PostParams

Source§

fn test_fn() -> fn(&str) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,