UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

251 lines • 17.1 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.VirtualMachine = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Import * * ### Additional Importing Requirements * * Many of the requirements for [cloning](#additional-requirements-and-notes-for-cloning) apply to importing. Although importing writes directly to the Terraform state, some rules can not be enforced during import time, so every effort should be made to ensure the correctness of the configuration before the import. * * The following requirements apply to import: * * * The disks must have a [`label`](#label) argument assigned in a convention matching `Hard Disk`, starting with disk number 0, based on each virtual disk order on the SCSI bus. As an example, a disk on SCSI controller `0` with a unit number of `0` would be labeled as `Hard Disk 0`, a disk on the same controller with a unit number of `1` would be `Hard Disk 1`, but the next disk, which is on SCSI controller `1` with a unit number of `0`, still becomes `Hard Disk 2`. * * * Disks are always imported with [`keep_on_remove`](#keep_on_remove) enabled until the first `pulumi up` run which will remove the setting for known disks. This process safeguards against naming or accounting mistakes in the disk configuration. * * * The storage controller count for the resource is set to the number of contiguous storage controllers found, starting with the controller at SCSI bus number `0`. If no storage controllers are discovered, the virtual machine is not eligible for import. For maximum compatibility, ensure that the virtual machine has the exact number of storage controllers needed and set the storage controller count accordingly. * * After importing, you should run `pulumi preview`. Unless you have changed anything else in the configuration that would cause other attributes to change. The only difference should be configuration-only changes, which are typically comprised of: * * * The [`imported`](#imported) flag will transition from `true` to `false`. * * * The [`keep_on_remove`](#keep_on_remove) of known disks will transition from `true` to `false`. * * * Configuration supplied in the [`clone`](#clone) block, if present, will be persisted to state. This initial persistence operation does not perform any cloning or customization actions, nor does it force a new resource. After the first apply operation, further changes to `clone` will force the creation of a new resource. * * These changes only update Terraform state when applied. Hence, it is safe to run when the virtual machine is running. If more settings are modified, you may need to plan maintenance accordingly for any necessary virtual machine re-configurations. */ class VirtualMachine extends pulumi.CustomResource { /** * Get an existing VirtualMachine 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, id, state, opts) { return new VirtualMachine(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VirtualMachine. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === VirtualMachine.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["alternateGuestName"] = state?.alternateGuestName; resourceInputs["annotation"] = state?.annotation; resourceInputs["bootDelay"] = state?.bootDelay; resourceInputs["bootRetryDelay"] = state?.bootRetryDelay; resourceInputs["bootRetryEnabled"] = state?.bootRetryEnabled; resourceInputs["cdroms"] = state?.cdroms; resourceInputs["changeVersion"] = state?.changeVersion; resourceInputs["clone"] = state?.clone; resourceInputs["cpuHotAddEnabled"] = state?.cpuHotAddEnabled; resourceInputs["cpuHotRemoveEnabled"] = state?.cpuHotRemoveEnabled; resourceInputs["cpuLimit"] = state?.cpuLimit; resourceInputs["cpuPerformanceCountersEnabled"] = state?.cpuPerformanceCountersEnabled; resourceInputs["cpuReservation"] = state?.cpuReservation; resourceInputs["cpuShareCount"] = state?.cpuShareCount; resourceInputs["cpuShareLevel"] = state?.cpuShareLevel; resourceInputs["customAttributes"] = state?.customAttributes; resourceInputs["datacenterId"] = state?.datacenterId; resourceInputs["datastoreClusterId"] = state?.datastoreClusterId; resourceInputs["datastoreId"] = state?.datastoreId; resourceInputs["defaultIpAddress"] = state?.defaultIpAddress; resourceInputs["disks"] = state?.disks; resourceInputs["efiSecureBootEnabled"] = state?.efiSecureBootEnabled; resourceInputs["enableDiskUuid"] = state?.enableDiskUuid; resourceInputs["enableLogging"] = state?.enableLogging; resourceInputs["eptRviMode"] = state?.eptRviMode; resourceInputs["extraConfig"] = state?.extraConfig; resourceInputs["extraConfigRebootRequired"] = state?.extraConfigRebootRequired; resourceInputs["firmware"] = state?.firmware; resourceInputs["folder"] = state?.folder; resourceInputs["forcePowerOff"] = state?.forcePowerOff; resourceInputs["guestId"] = state?.guestId; resourceInputs["guestIpAddresses"] = state?.guestIpAddresses; resourceInputs["hardwareVersion"] = state?.hardwareVersion; resourceInputs["hostSystemId"] = state?.hostSystemId; resourceInputs["hvMode"] = state?.hvMode; resourceInputs["ideControllerCount"] = state?.ideControllerCount; resourceInputs["ignoredGuestIps"] = state?.ignoredGuestIps; resourceInputs["imported"] = state?.imported; resourceInputs["latencySensitivity"] = state?.latencySensitivity; resourceInputs["memory"] = state?.memory; resourceInputs["memoryHotAddEnabled"] = state?.memoryHotAddEnabled; resourceInputs["memoryLimit"] = state?.memoryLimit; resourceInputs["memoryReservation"] = state?.memoryReservation; resourceInputs["memoryReservationLockedToMax"] = state?.memoryReservationLockedToMax; resourceInputs["memoryShareCount"] = state?.memoryShareCount; resourceInputs["memoryShareLevel"] = state?.memoryShareLevel; resourceInputs["migrateWaitTimeout"] = state?.migrateWaitTimeout; resourceInputs["moid"] = state?.moid; resourceInputs["name"] = state?.name; resourceInputs["nestedHvEnabled"] = state?.nestedHvEnabled; resourceInputs["networkInterfaces"] = state?.networkInterfaces; resourceInputs["numCoresPerSocket"] = state?.numCoresPerSocket; resourceInputs["numCpus"] = state?.numCpus; resourceInputs["nvmeControllerCount"] = state?.nvmeControllerCount; resourceInputs["ovfDeploy"] = state?.ovfDeploy; resourceInputs["pciDeviceIds"] = state?.pciDeviceIds; resourceInputs["powerState"] = state?.powerState; resourceInputs["poweronTimeout"] = state?.poweronTimeout; resourceInputs["rebootRequired"] = state?.rebootRequired; resourceInputs["replaceTrigger"] = state?.replaceTrigger; resourceInputs["resourcePoolId"] = state?.resourcePoolId; resourceInputs["runToolsScriptsAfterPowerOn"] = state?.runToolsScriptsAfterPowerOn; resourceInputs["runToolsScriptsAfterResume"] = state?.runToolsScriptsAfterResume; resourceInputs["runToolsScriptsBeforeGuestReboot"] = state?.runToolsScriptsBeforeGuestReboot; resourceInputs["runToolsScriptsBeforeGuestShutdown"] = state?.runToolsScriptsBeforeGuestShutdown; resourceInputs["runToolsScriptsBeforeGuestStandby"] = state?.runToolsScriptsBeforeGuestStandby; resourceInputs["sataControllerCount"] = state?.sataControllerCount; resourceInputs["scsiBusSharing"] = state?.scsiBusSharing; resourceInputs["scsiControllerCount"] = state?.scsiControllerCount; resourceInputs["scsiType"] = state?.scsiType; resourceInputs["shutdownWaitTimeout"] = state?.shutdownWaitTimeout; resourceInputs["storagePolicyId"] = state?.storagePolicyId; resourceInputs["swapPlacementPolicy"] = state?.swapPlacementPolicy; resourceInputs["syncTimeWithHost"] = state?.syncTimeWithHost; resourceInputs["syncTimeWithHostPeriodically"] = state?.syncTimeWithHostPeriodically; resourceInputs["tags"] = state?.tags; resourceInputs["toolsUpgradePolicy"] = state?.toolsUpgradePolicy; resourceInputs["uuid"] = state?.uuid; resourceInputs["vapp"] = state?.vapp; resourceInputs["vappTransports"] = state?.vappTransports; resourceInputs["vbsEnabled"] = state?.vbsEnabled; resourceInputs["vmwareToolsStatus"] = state?.vmwareToolsStatus; resourceInputs["vmxPath"] = state?.vmxPath; resourceInputs["vtpm"] = state?.vtpm; resourceInputs["vvtdEnabled"] = state?.vvtdEnabled; resourceInputs["waitForGuestIpTimeout"] = state?.waitForGuestIpTimeout; resourceInputs["waitForGuestNetRoutable"] = state?.waitForGuestNetRoutable; resourceInputs["waitForGuestNetTimeout"] = state?.waitForGuestNetTimeout; } else { const args = argsOrState; if (args?.resourcePoolId === undefined && !opts.urn) { throw new Error("Missing required property 'resourcePoolId'"); } resourceInputs["alternateGuestName"] = args?.alternateGuestName; resourceInputs["annotation"] = args?.annotation; resourceInputs["bootDelay"] = args?.bootDelay; resourceInputs["bootRetryDelay"] = args?.bootRetryDelay; resourceInputs["bootRetryEnabled"] = args?.bootRetryEnabled; resourceInputs["cdroms"] = args?.cdroms; resourceInputs["clone"] = args?.clone; resourceInputs["cpuHotAddEnabled"] = args?.cpuHotAddEnabled; resourceInputs["cpuHotRemoveEnabled"] = args?.cpuHotRemoveEnabled; resourceInputs["cpuLimit"] = args?.cpuLimit; resourceInputs["cpuPerformanceCountersEnabled"] = args?.cpuPerformanceCountersEnabled; resourceInputs["cpuReservation"] = args?.cpuReservation; resourceInputs["cpuShareCount"] = args?.cpuShareCount; resourceInputs["cpuShareLevel"] = args?.cpuShareLevel; resourceInputs["customAttributes"] = args?.customAttributes; resourceInputs["datacenterId"] = args?.datacenterId; resourceInputs["datastoreClusterId"] = args?.datastoreClusterId; resourceInputs["datastoreId"] = args?.datastoreId; resourceInputs["disks"] = args?.disks; resourceInputs["efiSecureBootEnabled"] = args?.efiSecureBootEnabled; resourceInputs["enableDiskUuid"] = args?.enableDiskUuid; resourceInputs["enableLogging"] = args?.enableLogging; resourceInputs["eptRviMode"] = args?.eptRviMode; resourceInputs["extraConfig"] = args?.extraConfig; resourceInputs["extraConfigRebootRequired"] = args?.extraConfigRebootRequired; resourceInputs["firmware"] = args?.firmware; resourceInputs["folder"] = args?.folder; resourceInputs["forcePowerOff"] = args?.forcePowerOff; resourceInputs["guestId"] = args?.guestId; resourceInputs["hardwareVersion"] = args?.hardwareVersion; resourceInputs["hostSystemId"] = args?.hostSystemId; resourceInputs["hvMode"] = args?.hvMode; resourceInputs["ideControllerCount"] = args?.ideControllerCount; resourceInputs["ignoredGuestIps"] = args?.ignoredGuestIps; resourceInputs["latencySensitivity"] = args?.latencySensitivity; resourceInputs["memory"] = args?.memory; resourceInputs["memoryHotAddEnabled"] = args?.memoryHotAddEnabled; resourceInputs["memoryLimit"] = args?.memoryLimit; resourceInputs["memoryReservation"] = args?.memoryReservation; resourceInputs["memoryReservationLockedToMax"] = args?.memoryReservationLockedToMax; resourceInputs["memoryShareCount"] = args?.memoryShareCount; resourceInputs["memoryShareLevel"] = args?.memoryShareLevel; resourceInputs["migrateWaitTimeout"] = args?.migrateWaitTimeout; resourceInputs["name"] = args?.name; resourceInputs["nestedHvEnabled"] = args?.nestedHvEnabled; resourceInputs["networkInterfaces"] = args?.networkInterfaces; resourceInputs["numCoresPerSocket"] = args?.numCoresPerSocket; resourceInputs["numCpus"] = args?.numCpus; resourceInputs["nvmeControllerCount"] = args?.nvmeControllerCount; resourceInputs["ovfDeploy"] = args?.ovfDeploy; resourceInputs["pciDeviceIds"] = args?.pciDeviceIds; resourceInputs["poweronTimeout"] = args?.poweronTimeout; resourceInputs["replaceTrigger"] = args?.replaceTrigger; resourceInputs["resourcePoolId"] = args?.resourcePoolId; resourceInputs["runToolsScriptsAfterPowerOn"] = args?.runToolsScriptsAfterPowerOn; resourceInputs["runToolsScriptsAfterResume"] = args?.runToolsScriptsAfterResume; resourceInputs["runToolsScriptsBeforeGuestReboot"] = args?.runToolsScriptsBeforeGuestReboot; resourceInputs["runToolsScriptsBeforeGuestShutdown"] = args?.runToolsScriptsBeforeGuestShutdown; resourceInputs["runToolsScriptsBeforeGuestStandby"] = args?.runToolsScriptsBeforeGuestStandby; resourceInputs["sataControllerCount"] = args?.sataControllerCount; resourceInputs["scsiBusSharing"] = args?.scsiBusSharing; resourceInputs["scsiControllerCount"] = args?.scsiControllerCount; resourceInputs["scsiType"] = args?.scsiType; resourceInputs["shutdownWaitTimeout"] = args?.shutdownWaitTimeout; resourceInputs["storagePolicyId"] = args?.storagePolicyId; resourceInputs["swapPlacementPolicy"] = args?.swapPlacementPolicy; resourceInputs["syncTimeWithHost"] = args?.syncTimeWithHost; resourceInputs["syncTimeWithHostPeriodically"] = args?.syncTimeWithHostPeriodically; resourceInputs["tags"] = args?.tags; resourceInputs["toolsUpgradePolicy"] = args?.toolsUpgradePolicy; resourceInputs["vapp"] = args?.vapp; resourceInputs["vbsEnabled"] = args?.vbsEnabled; resourceInputs["vtpm"] = args?.vtpm; resourceInputs["vvtdEnabled"] = args?.vvtdEnabled; resourceInputs["waitForGuestIpTimeout"] = args?.waitForGuestIpTimeout; resourceInputs["waitForGuestNetRoutable"] = args?.waitForGuestNetRoutable; resourceInputs["waitForGuestNetTimeout"] = args?.waitForGuestNetTimeout; resourceInputs["changeVersion"] = undefined /*out*/; resourceInputs["defaultIpAddress"] = undefined /*out*/; resourceInputs["guestIpAddresses"] = undefined /*out*/; resourceInputs["imported"] = undefined /*out*/; resourceInputs["moid"] = undefined /*out*/; resourceInputs["powerState"] = undefined /*out*/; resourceInputs["rebootRequired"] = undefined /*out*/; resourceInputs["uuid"] = undefined /*out*/; resourceInputs["vappTransports"] = undefined /*out*/; resourceInputs["vmwareToolsStatus"] = undefined /*out*/; resourceInputs["vmxPath"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VirtualMachine.__pulumiType, name, resourceInputs, opts); } } exports.VirtualMachine = VirtualMachine; /** @internal */ VirtualMachine.__pulumiType = 'vsphere:index/virtualMachine:VirtualMachine'; //# sourceMappingURL=virtualMachine.js.map