@muhlba91/pulumi-proxmoxve
Version:
A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.
1,110 lines • 42.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages a virtual machine.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
* import * as random from "@pulumi/random";
* import * as std from "@pulumi/std";
* import * as tls from "@pulumi/tls";
*
* export = async () => {
* const latestUbuntu22JammyQcow2Img = new proxmoxve.download.FileLegacy("latest_ubuntu_22_jammy_qcow2_img", {
* contentType: "import",
* datastoreId: "local",
* nodeName: "pve",
* url: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img",
* fileName: "jammy-server-cloudimg-amd64.qcow2",
* });
* const ubuntuVmPassword = new random.RandomPassword("ubuntu_vm_password", {
* length: 16,
* overrideSpecial: "_%@",
* special: true,
* });
* const ubuntuVmKey = new tls.PrivateKey("ubuntu_vm_key", {
* algorithm: "RSA",
* rsaBits: 2048,
* });
* const ubuntuVm = new proxmoxve.VmLegacy("ubuntu_vm", {
* serialDevices: [{}],
* name: "terraform-provider-proxmox-ubuntu-vm",
* description: "Managed by Pulumi",
* tags: [
* "terraform",
* "ubuntu",
* ],
* nodeName: "first-node",
* vmId: 4321,
* agent: {
* enabled: false,
* },
* stopOnDestroy: true,
* startup: {
* order: 3,
* upDelay: 60,
* downDelay: 60,
* },
* cpu: {
* cores: 2,
* type: "x86-64-v2-AES",
* },
* memory: {
* dedicated: 2048,
* floating: 2048,
* },
* disks: [{
* datastoreId: "local-lvm",
* importFrom: latestUbuntu22JammyQcow2Img.id,
* "interface": "scsi0",
* }],
* initialization: {
* ipConfigs: [{
* ipv4: {
* address: "dhcp",
* },
* }],
* userAccount: {
* keys: [std.trimspaceOutput({
* input: ubuntuVmKey.publicKeyOpenssh,
* }).apply(invoke => invoke.result)],
* password: ubuntuVmPassword.result,
* username: "ubuntu",
* },
* userDataFileId: cloudConfig.id,
* },
* networkDevices: [{
* bridge: "vmbr0",
* }],
* operatingSystem: {
* type: "l26",
* },
* tpmState: {
* version: "v2.0",
* },
* virtiofs: [{
* mapping: "data_share",
* cache: "always",
* directIo: true,
* }],
* });
* return {
* ubuntuVmPassword: ubuntuVmPassword.result,
* ubuntuVmPrivateKey: ubuntuVmKey.privateKeyPem,
* ubuntuVmPublicKey: ubuntuVmKey.publicKeyOpenssh,
* };
* }
* ```
*
* ## Qemu guest agent
*
* Qemu-guest-agent is an application which can be installed inside guest VM, see
* [Proxmox Wiki](https://pve.proxmox.com/wiki/Qemu-guest-agent) and [Proxmox
* Documentation](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_qemu_agent)
*
* For VM with `agent.enabled = false`, Proxmox uses ACPI for `Shutdown` and
* `Reboot`, and `qemu-guest-agent` is not needed inside the VM. For some VMs,
* the shutdown process may not work, causing the VM to be stuck on destroying.
* Add `stopOnDestroy = true` to the VM configuration to stop the VM instead of
* shutting it down.
*
* Setting `agent.enabled = true` informs Proxmox that the guest agent is expected
* to be *running* inside the VM. Proxmox then uses `qemu-guest-agent` instead of
* ACPI to control the VM. If the agent is not running, Proxmox operations
* `Shutdown` and `Reboot` time out and fail. The failing operation gets a lock on
* the VM, and until the operation times out, other operations like `Stop` and
* `Reboot` cannot be used.
*
* Do **not** run VM with `agent.enabled = true`, unless the VM is configured to
* automatically **start** `qemu-guest-agent` at some point.
*
* "Monitor" tab in Proxmox GUI can be used to send low-level commands to `qemu`.
* See the [documentation](https://www.qemu.org/docs/master/system/monitor.html).
* Commands `systemPowerdown` and `quit` have proven useful in shutting down VMs
* with `agent.enabled = true` and no agent running.
*
* Cloud images usually do not have `qemu-guest-agent` installed. It is possible to
* install and *start* it using cloud-init, e.g. using custom `userDataFileId`
* file.
*
* This provider requires `agent.enabled = true` to populate `ipv4Addresses`,
* `ipv6Addresses` and `networkInterfaceNames` output attributes.
*
* Setting `agent.enabled = true` without running `qemu-guest-agent` in the VM will
* also result in long timeouts when using the provider, both when creating VMs,
* and when refreshing resources. The provider has no way to distinguish between
* "qemu-guest-agent not installed" and "very long boot due to a disk check", it
* trusts the user to set `agent.enabled` correctly and waits for
* `qemu-guest-agent` to start.
*
* ## AMD SEV
*
* AMD SEV (-ES, -SNP) are security features for AMD processors. SEV-SNP support
* is included in Proxmox version **8.4**, see Proxmox Wiki
* and [Proxmox Documentation](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory_encryption)
* for more information.
*
* `amd-sev` requires root and therefore `root@pam` auth.
*
* SEV-SNP requires `bios = OVMF` and a supported AMD CPU (`EPYC-v4` for instance), `machine = q35` is also advised. No EFI disk is required since SEV-SNP uses consolidated read-only firmware. A configured EFI will be ignored.
*
* All changes made to `amdSev` will trigger reboots. Removing or adding the `amdSev` block will force a replacement of the resource. Modifying the `amdSev` block will not trigger replacements.
*
* `allowSmt` is by default set to `true` even if `snp` is not the selected type. Proxmox will ignore this value when `snp` is not in use. Likewise `noKeySharing` is `false` by default but ignored by Proxmox when `snp` is in use.
*
* ## High Availability
*
* When managing a virtual machine in a multi-node cluster, the VM's HA settings can
* be managed using the `proxmoxve.HaresourceLegacy` resource.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const ubuntuVm = new proxmoxve.VmLegacy("ubuntu_vm", {
* name: "terraform-provider-proxmox-ubuntu-vm",
* vmId: 4321,
* });
* const ubuntuVmHaresourceLegacy = new proxmoxve.HaresourceLegacy("ubuntu_vm", {
* resourceId: pulumi.interpolate`vm:${ubuntuVm.vmId}`,
* group: "node1",
* state: "started",
* comment: "Managed by Pulumi",
* });
* ```
*
* ### HA-Aware Migration
*
* When changing the `nodeName` of an HA-managed VM, the provider automatically
* handles the migration in an HA-aware manner:
*
* - **Running HA VMs**: Uses the HA manager's migrate endpoint for live migration
* - **Stopped HA VMs**: Temporarily removes from HA, performs standard migration,
* then re-adds to HA with the original configuration preserved
*
* > **PVE 9.x Required**: HA-aware migration requires Proxmox VE 9.x due to API
* changes. On PVE 8.x, migrating HA-managed VMs will fail. As a workaround,
* manually remove the VM from HA before changing `nodeName`, then re-add after
* apply.
*
* ## Important Notes
*
* ### `local-lvm` Datastore
*
* The `local-lvm` is the **default datastore** for many configuration blocks, including `initialization` and `tpmState`, which may not seem to be related to "storage".
* If you do not have `local-lvm` configured in your environment, you may need to explicitly set the `datastoreId` in such blocks to a different value.
*
* ### Cloning
*
* When cloning an existing virtual machine, whether it's a template or not, the
* resource will inherit the disks and other configuration from the source VM.
*
* *If* you modify any attributes of an existing disk in the clone, you also need to\
* explicitly provide values for any other attributes that differ from the schema defaults\
* in the source (e.g., `size`, `discard`, `cache`, `aio`).\
* Otherwise, the schema defaults will take effect and override the source values.
*
* Furthermore, when cloning from one node to a different one, the behavior changes
* depening on the datastores of the source VM. If at least one non-shared
* datastore is used, the VM is first cloned to the source node before being
* migrated to the target node. This circumvents a limitation in the Proxmox clone
* API.
*
* Because the migration step after the clone tries to preserve the used
* datastores by their name, it may fail if a datastore used in the source VM is
* not available on the target node (e.g. `local-lvm` is used on the source node in
* the VM but no `local-lvm` datastore is available on the target node). In this
* case, it is recommended to set the `datastoreId` argument in the `clone` block
* to force the migration step to migrate all disks to a specific datastore on the
* target node. If you need certain disks to be on specific datastores, set
* the `datastoreId` argument of the disks in the `disks` block to move the disks
* to the correct datastore after the cloning and migrating succeeded.
*
* ## Import
*
* Instances can be imported using the `nodeName` and the `vmId`, e.g.,
*
* ```sh
* $ pulumi import proxmoxve:index/vmLegacy:VmLegacy ubuntu_vm first-node/4321
* ```
*/
export declare class VmLegacy extends pulumi.CustomResource {
/**
* Get an existing VmLegacy resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VmLegacyState, opts?: pulumi.CustomResourceOptions): VmLegacy;
/**
* Returns true if the given object is an instance of VmLegacy. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is VmLegacy;
/**
* Whether to enable ACPI (defaults to `true`).
*/
readonly acpi: pulumi.Output<boolean | undefined>;
/**
* The QEMU agent configuration.
*/
readonly agent: pulumi.Output<outputs.VmLegacyAgent | undefined>;
/**
* Secure Encrypted Virtualization (SEV) features by AMD CPUs.
*/
readonly amdSev: pulumi.Output<outputs.VmLegacyAmdSev | undefined>;
/**
* An audio device.
*/
readonly audioDevice: pulumi.Output<outputs.VmLegacyAudioDevice | undefined>;
/**
* The BIOS implementation (defaults to `seabios`).
*/
readonly bios: pulumi.Output<string | undefined>;
/**
* Specify a list of devices to boot from in the order they appear in the list.
*/
readonly bootOrders: pulumi.Output<string[]>;
/**
* The CD-ROM configuration.
*/
readonly cdrom: pulumi.Output<outputs.VmLegacyCdrom | undefined>;
/**
* The cloning configuration.
*/
readonly clone: pulumi.Output<outputs.VmLegacyClone | undefined>;
/**
* The CPU configuration.
*/
readonly cpu: pulumi.Output<outputs.VmLegacyCpu | undefined>;
/**
* Whether to delete unreferenced disks on destroy (defaults to `true`)
*/
readonly deleteUnreferencedDisksOnDestroy: pulumi.Output<boolean | undefined>;
/**
* The description.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* A disk (multiple blocks supported).
*/
readonly disks: pulumi.Output<outputs.VmLegacyDisk[] | undefined>;
/**
* The efi disk device (required if `bios` is set
* to `ovmf`)
*/
readonly efiDisk: pulumi.Output<outputs.VmLegacyEfiDisk | undefined>;
/**
* The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute).
*/
readonly hookScriptFileId: pulumi.Output<string | undefined>;
/**
* A host PCI device mapping (multiple blocks supported).
*/
readonly hostpcis: pulumi.Output<outputs.VmLegacyHostpci[] | undefined>;
/**
* Selectively enable hotplug features. Use `0` to
* disable, `1` to enable all. Valid features: `disk`, `network`, `usb`,
* `memory`, `cpu`. Memory hotplug requires NUMA to be enabled. If not set,
* PVE defaults to `network,disk,usb`. When `disk` is included in the
* hotplug list, disk resizes on a running VM are applied live without a
* reboot. When `disk` is excluded, the provider will reboot the VM after
* resize (controlled by `rebootAfterUpdate`).
*/
readonly hotplug: pulumi.Output<string>;
/**
* The cloud-init configuration.
*/
readonly initialization: pulumi.Output<outputs.VmLegacyInitialization | undefined>;
/**
* The IPv4 addresses per network interface published by the
* QEMU agent (empty list when `agent.enabled` is `false`)
*/
readonly ipv4Addresses: pulumi.Output<string[][]>;
/**
* The IPv6 addresses per network interface published by the
* QEMU agent (empty list when `agent.enabled` is `false`)
*/
readonly ipv6Addresses: pulumi.Output<string[][]>;
/**
* The keyboard layout (defaults to `en-us`).
*/
readonly keyboardLayout: pulumi.Output<string | undefined>;
/**
* Arbitrary arguments passed to kvm.
*/
readonly kvmArguments: pulumi.Output<string | undefined>;
/**
* The MAC addresses published by the QEMU agent with fallback
* to the network device configuration, if the agent is disabled
*/
readonly macAddresses: pulumi.Output<string[]>;
/**
* The VM machine type (defaults to `pc`).
*/
readonly machine: pulumi.Output<string | undefined>;
/**
* The memory configuration.
*/
readonly memory: pulumi.Output<outputs.VmLegacyMemory | undefined>;
/**
* Migrate the VM on node change instead of re-creating
* it (defaults to `false`).
*/
readonly migrate: pulumi.Output<boolean | undefined>;
/**
* The virtual machine name. Must be a valid DNS name.
*/
readonly name: pulumi.Output<string>;
/**
* A network device (multiple blocks supported).
*/
readonly networkDevices: pulumi.Output<outputs.VmLegacyNetworkDevice[]>;
/**
* The network interface names published by the QEMU
* agent (empty list when `agent.enabled` is `false`)
*/
readonly networkInterfaceNames: pulumi.Output<string[]>;
/**
* The name of the node to assign the virtual machine
* to.
*/
readonly nodeName: pulumi.Output<string>;
/**
* The NUMA configuration.
*/
readonly numas: pulumi.Output<outputs.VmLegacyNuma[] | undefined>;
/**
* Specifies whether a VM will be started during system
* boot. (defaults to `true`)
*/
readonly onBoot: pulumi.Output<boolean | undefined>;
/**
* The Operating System configuration.
*/
readonly operatingSystem: pulumi.Output<outputs.VmLegacyOperatingSystem | undefined>;
/**
* The identifier for a pool to assign the virtual machine to.
*/
readonly poolId: pulumi.Output<string | undefined>;
/**
* Sets the protection flag of the VM. This will disable the remove VM and remove disk operations (defaults to `false`).
*/
readonly protection: pulumi.Output<boolean | undefined>;
/**
* Whether to purge the VM from backup configurations on destroy (defaults to `true`)
*/
readonly purgeOnDestroy: pulumi.Output<boolean | undefined>;
/**
* Reboot the VM after initial creation (defaults to `false`).
*/
readonly reboot: pulumi.Output<boolean | undefined>;
/**
* Whether the provider may automatically
* reboot or power off the VM during update operations when required to apply
* changes. If `false`, updates that require taking the VM offline fail
* instead of being applied automatically. Changes that are applied
* successfully but still need a later manual reboot emit a warning instead
* (defaults to `true`).
*/
readonly rebootAfterUpdate: pulumi.Output<boolean | undefined>;
/**
* The random number generator configuration. Can only be set by `root@pam.`
*/
readonly rngs: pulumi.Output<outputs.VmLegacyRng[] | undefined>;
/**
* The SCSI hardware type (defaults to
* `virtio-scsi-pci`).
*/
readonly scsiHardware: pulumi.Output<string | undefined>;
/**
* A serial device (multiple blocks supported).
*/
readonly serialDevices: pulumi.Output<outputs.VmLegacySerialDevice[] | undefined>;
/**
* The SMBIOS (type1) settings for the VM.
*/
readonly smbios: pulumi.Output<outputs.VmLegacySmbios | undefined>;
/**
* Whether to start the virtual machine (defaults
* to `true`).
*/
readonly started: pulumi.Output<boolean | undefined>;
/**
* Defines startup and shutdown behavior of the VM.
*/
readonly startup: pulumi.Output<outputs.VmLegacyStartup | undefined>;
/**
* Whether to stop rather than shutdown on VM destroy (defaults to `false`)
*/
readonly stopOnDestroy: pulumi.Output<boolean | undefined>;
/**
* Whether to enable the USB tablet device (defaults
* to `true`).
*/
readonly tabletDevice: pulumi.Output<boolean | undefined>;
/**
* A list of tags of the VM. This is only meta information (
* defaults to `[]`). Note: Proxmox always sorts the VM tags. If the list in
* template is not sorted, then Proxmox will always report a difference on the
* resource. You may use the `ignoreChanges` lifecycle meta-argument to ignore
* changes to this attribute.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Whether the VM should be a template. Setting this
* from `false` to `true` converts an existing VM to a template in place.
* Converting a template back to a regular VM is not supported (defaults to
* `false`).
*/
readonly template: pulumi.Output<boolean | undefined>;
/**
* Timeout for cloning a VM in seconds (defaults to
* 1800).
*/
readonly timeoutClone: pulumi.Output<number | undefined>;
/**
* Timeout for creating a VM in seconds (defaults to
* 1800).
*/
readonly timeoutCreate: pulumi.Output<number | undefined>;
/**
* Timeout for migrating the VM (defaults to
* 1800).
*/
readonly timeoutMigrate: pulumi.Output<number | undefined>;
/**
* Disk move timeout
*
* @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (timeout_create / timeoutClone / timeout_migrate) is used instead.
*/
readonly timeoutMoveDisk: pulumi.Output<number | undefined>;
/**
* Timeout for rebooting a VM in seconds (defaults
* to 1800).
*/
readonly timeoutReboot: pulumi.Output<number | undefined>;
/**
* Timeout for shutting down a VM in seconds (
* defaults to 1800).
*/
readonly timeoutShutdownVm: pulumi.Output<number | undefined>;
/**
* Timeout for starting a VM in seconds (defaults
* to 1800).
*/
readonly timeoutStartVm: pulumi.Output<number | undefined>;
/**
* Timeout for stopping a VM in seconds (defaults
* to 300).
*/
readonly timeoutStopVm: pulumi.Output<number | undefined>;
/**
* The TPM state device. The VM must be stopped before
* adding, removing, or moving a TPM state device; the provider automatically
* handles the shutdown/start cycle. Changing `version` requires recreating the
* VM because Proxmox only supports setting the TPM version at creation time.
*/
readonly tpmState: pulumi.Output<outputs.VmLegacyTpmState | undefined>;
/**
* A host USB device mapping (multiple blocks supported).
*/
readonly usbs: pulumi.Output<outputs.VmLegacyUsb[] | undefined>;
/**
* The VGA configuration.
*/
readonly vga: pulumi.Output<outputs.VmLegacyVga>;
/**
* Virtiofs share
*/
readonly virtiofs: pulumi.Output<outputs.VmLegacyVirtiof[] | undefined>;
/**
* The VM identifier.
*/
readonly vmId: pulumi.Output<number>;
/**
* The watchdog configuration. 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).
*/
readonly watchdog: pulumi.Output<outputs.VmLegacyWatchdog | undefined>;
/**
* Create a VmLegacy resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: VmLegacyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering VmLegacy resources.
*/
export interface VmLegacyState {
/**
* Whether to enable ACPI (defaults to `true`).
*/
acpi?: pulumi.Input<boolean | undefined>;
/**
* The QEMU agent configuration.
*/
agent?: pulumi.Input<inputs.VmLegacyAgent | undefined>;
/**
* Secure Encrypted Virtualization (SEV) features by AMD CPUs.
*/
amdSev?: pulumi.Input<inputs.VmLegacyAmdSev | undefined>;
/**
* An audio device.
*/
audioDevice?: pulumi.Input<inputs.VmLegacyAudioDevice | undefined>;
/**
* The BIOS implementation (defaults to `seabios`).
*/
bios?: pulumi.Input<string | undefined>;
/**
* Specify a list of devices to boot from in the order they appear in the list.
*/
bootOrders?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The CD-ROM configuration.
*/
cdrom?: pulumi.Input<inputs.VmLegacyCdrom | undefined>;
/**
* The cloning configuration.
*/
clone?: pulumi.Input<inputs.VmLegacyClone | undefined>;
/**
* The CPU configuration.
*/
cpu?: pulumi.Input<inputs.VmLegacyCpu | undefined>;
/**
* Whether to delete unreferenced disks on destroy (defaults to `true`)
*/
deleteUnreferencedDisksOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* The description.
*/
description?: pulumi.Input<string | undefined>;
/**
* A disk (multiple blocks supported).
*/
disks?: pulumi.Input<pulumi.Input<inputs.VmLegacyDisk>[] | undefined>;
/**
* The efi disk device (required if `bios` is set
* to `ovmf`)
*/
efiDisk?: pulumi.Input<inputs.VmLegacyEfiDisk | undefined>;
/**
* The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute).
*/
hookScriptFileId?: pulumi.Input<string | undefined>;
/**
* A host PCI device mapping (multiple blocks supported).
*/
hostpcis?: pulumi.Input<pulumi.Input<inputs.VmLegacyHostpci>[] | undefined>;
/**
* Selectively enable hotplug features. Use `0` to
* disable, `1` to enable all. Valid features: `disk`, `network`, `usb`,
* `memory`, `cpu`. Memory hotplug requires NUMA to be enabled. If not set,
* PVE defaults to `network,disk,usb`. When `disk` is included in the
* hotplug list, disk resizes on a running VM are applied live without a
* reboot. When `disk` is excluded, the provider will reboot the VM after
* resize (controlled by `rebootAfterUpdate`).
*/
hotplug?: pulumi.Input<string | undefined>;
/**
* The cloud-init configuration.
*/
initialization?: pulumi.Input<inputs.VmLegacyInitialization | undefined>;
/**
* The IPv4 addresses per network interface published by the
* QEMU agent (empty list when `agent.enabled` is `false`)
*/
ipv4Addresses?: pulumi.Input<pulumi.Input<pulumi.Input<string>[]>[] | undefined>;
/**
* The IPv6 addresses per network interface published by the
* QEMU agent (empty list when `agent.enabled` is `false`)
*/
ipv6Addresses?: pulumi.Input<pulumi.Input<pulumi.Input<string>[]>[] | undefined>;
/**
* The keyboard layout (defaults to `en-us`).
*/
keyboardLayout?: pulumi.Input<string | undefined>;
/**
* Arbitrary arguments passed to kvm.
*/
kvmArguments?: pulumi.Input<string | undefined>;
/**
* The MAC addresses published by the QEMU agent with fallback
* to the network device configuration, if the agent is disabled
*/
macAddresses?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The VM machine type (defaults to `pc`).
*/
machine?: pulumi.Input<string | undefined>;
/**
* The memory configuration.
*/
memory?: pulumi.Input<inputs.VmLegacyMemory | undefined>;
/**
* Migrate the VM on node change instead of re-creating
* it (defaults to `false`).
*/
migrate?: pulumi.Input<boolean | undefined>;
/**
* The virtual machine name. Must be a valid DNS name.
*/
name?: pulumi.Input<string | undefined>;
/**
* A network device (multiple blocks supported).
*/
networkDevices?: pulumi.Input<pulumi.Input<inputs.VmLegacyNetworkDevice>[] | undefined>;
/**
* The network interface names published by the QEMU
* agent (empty list when `agent.enabled` is `false`)
*/
networkInterfaceNames?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The name of the node to assign the virtual machine
* to.
*/
nodeName?: pulumi.Input<string | undefined>;
/**
* The NUMA configuration.
*/
numas?: pulumi.Input<pulumi.Input<inputs.VmLegacyNuma>[] | undefined>;
/**
* Specifies whether a VM will be started during system
* boot. (defaults to `true`)
*/
onBoot?: pulumi.Input<boolean | undefined>;
/**
* The Operating System configuration.
*/
operatingSystem?: pulumi.Input<inputs.VmLegacyOperatingSystem | undefined>;
/**
* The identifier for a pool to assign the virtual machine to.
*/
poolId?: pulumi.Input<string | undefined>;
/**
* Sets the protection flag of the VM. This will disable the remove VM and remove disk operations (defaults to `false`).
*/
protection?: pulumi.Input<boolean | undefined>;
/**
* Whether to purge the VM from backup configurations on destroy (defaults to `true`)
*/
purgeOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* Reboot the VM after initial creation (defaults to `false`).
*/
reboot?: pulumi.Input<boolean | undefined>;
/**
* Whether the provider may automatically
* reboot or power off the VM during update operations when required to apply
* changes. If `false`, updates that require taking the VM offline fail
* instead of being applied automatically. Changes that are applied
* successfully but still need a later manual reboot emit a warning instead
* (defaults to `true`).
*/
rebootAfterUpdate?: pulumi.Input<boolean | undefined>;
/**
* The random number generator configuration. Can only be set by `root@pam.`
*/
rngs?: pulumi.Input<pulumi.Input<inputs.VmLegacyRng>[] | undefined>;
/**
* The SCSI hardware type (defaults to
* `virtio-scsi-pci`).
*/
scsiHardware?: pulumi.Input<string | undefined>;
/**
* A serial device (multiple blocks supported).
*/
serialDevices?: pulumi.Input<pulumi.Input<inputs.VmLegacySerialDevice>[] | undefined>;
/**
* The SMBIOS (type1) settings for the VM.
*/
smbios?: pulumi.Input<inputs.VmLegacySmbios | undefined>;
/**
* Whether to start the virtual machine (defaults
* to `true`).
*/
started?: pulumi.Input<boolean | undefined>;
/**
* Defines startup and shutdown behavior of the VM.
*/
startup?: pulumi.Input<inputs.VmLegacyStartup | undefined>;
/**
* Whether to stop rather than shutdown on VM destroy (defaults to `false`)
*/
stopOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* Whether to enable the USB tablet device (defaults
* to `true`).
*/
tabletDevice?: pulumi.Input<boolean | undefined>;
/**
* A list of tags of the VM. This is only meta information (
* defaults to `[]`). Note: Proxmox always sorts the VM tags. If the list in
* template is not sorted, then Proxmox will always report a difference on the
* resource. You may use the `ignoreChanges` lifecycle meta-argument to ignore
* changes to this attribute.
*/
tags?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Whether the VM should be a template. Setting this
* from `false` to `true` converts an existing VM to a template in place.
* Converting a template back to a regular VM is not supported (defaults to
* `false`).
*/
template?: pulumi.Input<boolean | undefined>;
/**
* Timeout for cloning a VM in seconds (defaults to
* 1800).
*/
timeoutClone?: pulumi.Input<number | undefined>;
/**
* Timeout for creating a VM in seconds (defaults to
* 1800).
*/
timeoutCreate?: pulumi.Input<number | undefined>;
/**
* Timeout for migrating the VM (defaults to
* 1800).
*/
timeoutMigrate?: pulumi.Input<number | undefined>;
/**
* Disk move timeout
*
* @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (timeout_create / timeoutClone / timeout_migrate) is used instead.
*/
timeoutMoveDisk?: pulumi.Input<number | undefined>;
/**
* Timeout for rebooting a VM in seconds (defaults
* to 1800).
*/
timeoutReboot?: pulumi.Input<number | undefined>;
/**
* Timeout for shutting down a VM in seconds (
* defaults to 1800).
*/
timeoutShutdownVm?: pulumi.Input<number | undefined>;
/**
* Timeout for starting a VM in seconds (defaults
* to 1800).
*/
timeoutStartVm?: pulumi.Input<number | undefined>;
/**
* Timeout for stopping a VM in seconds (defaults
* to 300).
*/
timeoutStopVm?: pulumi.Input<number | undefined>;
/**
* The TPM state device. The VM must be stopped before
* adding, removing, or moving a TPM state device; the provider automatically
* handles the shutdown/start cycle. Changing `version` requires recreating the
* VM because Proxmox only supports setting the TPM version at creation time.
*/
tpmState?: pulumi.Input<inputs.VmLegacyTpmState | undefined>;
/**
* A host USB device mapping (multiple blocks supported).
*/
usbs?: pulumi.Input<pulumi.Input<inputs.VmLegacyUsb>[] | undefined>;
/**
* The VGA configuration.
*/
vga?: pulumi.Input<inputs.VmLegacyVga | undefined>;
/**
* Virtiofs share
*/
virtiofs?: pulumi.Input<pulumi.Input<inputs.VmLegacyVirtiof>[] | undefined>;
/**
* The VM identifier.
*/
vmId?: pulumi.Input<number | undefined>;
/**
* The watchdog configuration. 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).
*/
watchdog?: pulumi.Input<inputs.VmLegacyWatchdog | undefined>;
}
/**
* The set of arguments for constructing a VmLegacy resource.
*/
export interface VmLegacyArgs {
/**
* Whether to enable ACPI (defaults to `true`).
*/
acpi?: pulumi.Input<boolean | undefined>;
/**
* The QEMU agent configuration.
*/
agent?: pulumi.Input<inputs.VmLegacyAgent | undefined>;
/**
* Secure Encrypted Virtualization (SEV) features by AMD CPUs.
*/
amdSev?: pulumi.Input<inputs.VmLegacyAmdSev | undefined>;
/**
* An audio device.
*/
audioDevice?: pulumi.Input<inputs.VmLegacyAudioDevice | undefined>;
/**
* The BIOS implementation (defaults to `seabios`).
*/
bios?: pulumi.Input<string | undefined>;
/**
* Specify a list of devices to boot from in the order they appear in the list.
*/
bootOrders?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The CD-ROM configuration.
*/
cdrom?: pulumi.Input<inputs.VmLegacyCdrom | undefined>;
/**
* The cloning configuration.
*/
clone?: pulumi.Input<inputs.VmLegacyClone | undefined>;
/**
* The CPU configuration.
*/
cpu?: pulumi.Input<inputs.VmLegacyCpu | undefined>;
/**
* Whether to delete unreferenced disks on destroy (defaults to `true`)
*/
deleteUnreferencedDisksOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* The description.
*/
description?: pulumi.Input<string | undefined>;
/**
* A disk (multiple blocks supported).
*/
disks?: pulumi.Input<pulumi.Input<inputs.VmLegacyDisk>[] | undefined>;
/**
* The efi disk device (required if `bios` is set
* to `ovmf`)
*/
efiDisk?: pulumi.Input<inputs.VmLegacyEfiDisk | undefined>;
/**
* The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute).
*/
hookScriptFileId?: pulumi.Input<string | undefined>;
/**
* A host PCI device mapping (multiple blocks supported).
*/
hostpcis?: pulumi.Input<pulumi.Input<inputs.VmLegacyHostpci>[] | undefined>;
/**
* Selectively enable hotplug features. Use `0` to
* disable, `1` to enable all. Valid features: `disk`, `network`, `usb`,
* `memory`, `cpu`. Memory hotplug requires NUMA to be enabled. If not set,
* PVE defaults to `network,disk,usb`. When `disk` is included in the
* hotplug list, disk resizes on a running VM are applied live without a
* reboot. When `disk` is excluded, the provider will reboot the VM after
* resize (controlled by `rebootAfterUpdate`).
*/
hotplug?: pulumi.Input<string | undefined>;
/**
* The cloud-init configuration.
*/
initialization?: pulumi.Input<inputs.VmLegacyInitialization | undefined>;
/**
* The keyboard layout (defaults to `en-us`).
*/
keyboardLayout?: pulumi.Input<string | undefined>;
/**
* Arbitrary arguments passed to kvm.
*/
kvmArguments?: pulumi.Input<string | undefined>;
/**
* The MAC addresses published by the QEMU agent with fallback
* to the network device configuration, if the agent is disabled
*/
macAddresses?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The VM machine type (defaults to `pc`).
*/
machine?: pulumi.Input<string | undefined>;
/**
* The memory configuration.
*/
memory?: pulumi.Input<inputs.VmLegacyMemory | undefined>;
/**
* Migrate the VM on node change instead of re-creating
* it (defaults to `false`).
*/
migrate?: pulumi.Input<boolean | undefined>;
/**
* The virtual machine name. Must be a valid DNS name.
*/
name?: pulumi.Input<string | undefined>;
/**
* A network device (multiple blocks supported).
*/
networkDevices?: pulumi.Input<pulumi.Input<inputs.VmLegacyNetworkDevice>[] | undefined>;
/**
* The name of the node to assign the virtual machine
* to.
*/
nodeName: pulumi.Input<string>;
/**
* The NUMA configuration.
*/
numas?: pulumi.Input<pulumi.Input<inputs.VmLegacyNuma>[] | undefined>;
/**
* Specifies whether a VM will be started during system
* boot. (defaults to `true`)
*/
onBoot?: pulumi.Input<boolean | undefined>;
/**
* The Operating System configuration.
*/
operatingSystem?: pulumi.Input<inputs.VmLegacyOperatingSystem | undefined>;
/**
* The identifier for a pool to assign the virtual machine to.
*/
poolId?: pulumi.Input<string | undefined>;
/**
* Sets the protection flag of the VM. This will disable the remove VM and remove disk operations (defaults to `false`).
*/
protection?: pulumi.Input<boolean | undefined>;
/**
* Whether to purge the VM from backup configurations on destroy (defaults to `true`)
*/
purgeOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* Reboot the VM after initial creation (defaults to `false`).
*/
reboot?: pulumi.Input<boolean | undefined>;
/**
* Whether the provider may automatically
* reboot or power off the VM during update operations when required to apply
* changes. If `false`, updates that require taking the VM offline fail
* instead of being applied automatically. Changes that are applied
* successfully but still need a later manual reboot emit a warning instead
* (defaults to `true`).
*/
rebootAfterUpdate?: pulumi.Input<boolean | undefined>;
/**
* The random number generator configuration. Can only be set by `root@pam.`
*/
rngs?: pulumi.Input<pulumi.Input<inputs.VmLegacyRng>[] | undefined>;
/**
* The SCSI hardware type (defaults to
* `virtio-scsi-pci`).
*/
scsiHardware?: pulumi.Input<string | undefined>;
/**
* A serial device (multiple blocks supported).
*/
serialDevices?: pulumi.Input<pulumi.Input<inputs.VmLegacySerialDevice>[] | undefined>;
/**
* The SMBIOS (type1) settings for the VM.
*/
smbios?: pulumi.Input<inputs.VmLegacySmbios | undefined>;
/**
* Whether to start the virtual machine (defaults
* to `true`).
*/
started?: pulumi.Input<boolean | undefined>;
/**
* Defines startup and shutdown behavior of the VM.
*/
startup?: pulumi.Input<inputs.VmLegacyStartup | undefined>;
/**
* Whether to stop rather than shutdown on VM destroy (defaults to `false`)
*/
stopOnDestroy?: pulumi.Input<boolean | undefined>;
/**
* Whether to enable the USB tablet device (defaults
* to `true`).
*/
tabletDevice?: pulumi.Input<boolean | undefined>;
/**
* A list of tags of the VM. This is only meta information (
* defaults to `[]`). Note: Proxmox always sorts the VM tags. If the list in
* template is not sorted, then Proxmox will always report a difference on the
* resource. You may use the `ignoreChanges` lifecycle meta-argument to ignore
* changes to this attribute.
*/
tags?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Whether the VM should be a template. Setting this
* from `false` to `true` converts an existing VM to a template in place.
* Converting a template back to a regular VM is not supported (defaults to
* `false`).
*/
template?: pulumi.Input<boolean | undefined>;
/**
* Timeout for cloning a VM in seconds (defaults to
* 1800).
*/
timeoutClone?: pulumi.Input<number | undefined>;
/**
* Timeout for creating a VM in seconds (defaults to
* 1800).
*/
timeoutCreate?: pulumi.Input<number | undefined>;
/**
* Timeout for migrating the VM (defaults to
* 1800).
*/
timeoutMigrate?: pulumi.Input<number | undefined>;
/**
* Disk move timeout
*
* @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (timeout_create / timeoutClone / timeout_migrate) is used instead.
*/
timeoutMoveDisk?: pulumi.Input<number | undefined>;
/**
* Timeout for rebooting a VM in seconds (defaults
* to 1800).
*/
timeoutReboot?: pulumi.Input<number | undefined>;
/**
* Timeout for shutting down a VM in seconds (
* defaults to 1800).
*/
timeoutShutdownVm?: pulumi.Input<number | undefined>;
/**
* Timeout for starting a VM in seconds (defaults
* to 1800).
*/
timeoutStartVm?: pulumi.Input<number | undefined>;
/**
* Timeout for stopping a VM in seconds (defaults
* to 300).
*/
timeoutStopVm?: pulumi.Input<number | undefined>;
/**
* The TPM state device. The VM must be stopped before
* adding, removing, or moving a TPM state device; the provider automatically
* handles the shutdown/start cycle. Changing `version` requires recreating the
* VM because Proxmox only supports setting the TPM version at creation time.
*/
tpmState?: pulumi.Input<inputs.VmLegacyTpmState | undefined>;
/**
* A host USB device mapping (multiple blocks supported).
*/
usbs?: pulumi.Input<pulumi.Input<inputs.VmLegacyUsb>[] | undefined>;
/**
* The VGA configuration.
*/
vga?: pulumi.Input<inputs.VmLegacyVga | undefined>;
/**
* Virtiofs share
*/
virtiofs?: pulumi.Input<pulumi.Input<inputs.VmLegacyVirtiof>[] | undefined>;
/**
* The VM identifier.
*/
vmId?: pulumi.Input<number | undefined>;
/**
* The watchdog configuration. 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).
*/
watchdog?: pulumi.Input<inputs.VmLegacyWatchdog | undefined>;
}
//# sourceMappingURL=vmLegacy.d.ts.map