vsphere.getOvfVmTemplate

The vsphere.getOvfVmTemplate data source can be used to submit an OVF to vSphere and extract its hardware settings in a form that can be then used as inputs for a vsphere.VirtualMachine resource.

Remote OVF/OVA Source

data “vsphere_ovf_vm_template” “ovfRemote” { name = “Nested-ESXi-7.0-Terraform-Deploy-1” disk_provisioning = “thin” resource_pool_id = data.vsphere_resource_pool.default.id datastore_id = data.vsphere_datastore.datastore.id host_system_id = data.vsphere_host.host.id remote_ovf_url = “https://download3.vmware.com/software/vmw-tools/nested-esxi/Nested_ESXi7.0u3_Appliance_Template_v1.ova” ovf_network_map = { “VM Network” : data.vsphere_network.network.id } }

Local OVF/OVA Source

data “vsphere_ovf_vm_template” “ovfLocal” { name = “Nested-ESXi-7.0-Terraform-Deploy-2” disk_provisioning = “thin” resource_pool_id = data.vsphere_resource_pool.default.id datastore_id = data.vsphere_datastore.datastore.id host_system_id = data.vsphere_host.host.id local_ovf_path = “/Volume/Storage/OVA/Nested_ESXi7.0u3_Appliance_Template_v1.ova” ovf_network_map = { “VM Network” : data.vsphere_network.network.id } }

Deployment of VM from Remote OVF

resource “vsphere_virtual_machine” “vmFromRemoteOvf” { name = “Nested-ESXi-7.0-Terraform-Deploy-1” datacenter_id = data.vsphere_datacenter.datacenter.id datastore_id = data.vsphere_datastore.datastore.id host_system_id = data.vsphere_host.host.id resource_pool_id = data.vsphere_resource_pool.default.id num_cpus = data.vsphere_ovf_vm_template.ovfRemote.num_cpus num_cores_per_socket = data.vsphere_ovf_vm_template.ovfRemote.num_cores_per_socket memory = data.vsphere_ovf_vm_template.ovfRemote.memory guest_id = data.vsphere_ovf_vm_template.ovfRemote.guest_id firmware = data.vsphere_ovf_vm_template.ovfRemote.firmware scsi_type = data.vsphere_ovf_vm_template.ovfRemote.scsi_type nested_hv_enabled = data.vsphere_ovf_vm_template.ovfRemote.nested_hv_enabled dynamic “network_interface” { for_each = data.vsphere_ovf_vm_template.ovfRemote.ovf_network_map content { network_id = network_interface.value } } wait_for_guest_net_timeout = 0 wait_for_guest_ip_timeout = 0

ovf_deploy { allow_unverified_ssl_cert = false remote_ovf_url = data.vsphere_ovf_vm_template.ovfRemote.remote_ovf_url disk_provisioning = data.vsphere_ovf_vm_template.ovfRemote.disk_provisioning ovf_network_map = data.vsphere_ovf_vm_template.ovfRemote.ovf_network_map }

vapp { properties = { “guestinfo.hostname” = “nested-esxi-01.example.com”, “guestinfo.ipaddress” = “172.16.11.101”, “guestinfo.netmask” = “255.255.255.0”, “guestinfo.gateway” = “172.16.11.1”, “guestinfo.dns” = “172.16.11.4”, “guestinfo.domain” = “example.com”, “guestinfo.ntp” = “ntp.example.com”, “guestinfo.password” = “VMware1!”, “guestinfo.ssh” = “True” } }

lifecycle { ignore_changes = [ annotation, disk[0].io_share_count, disk[1].io_share_count, disk[2].io_share_count, vapp[0].properties, ] } }

Using getOvfVmTemplate

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getOvfVmTemplate(args: GetOvfVmTemplateArgs, opts?: InvokeOptions): Promise<GetOvfVmTemplateResult>
function getOvfVmTemplateOutput(args: GetOvfVmTemplateOutputArgs, opts?: InvokeOptions): Output<GetOvfVmTemplateResult>
def get_ovf_vm_template(allow_unverified_ssl_cert: Optional[bool] = None,
                        datastore_id: Optional[str] = None,
                        deployment_option: Optional[str] = None,
                        disk_provisioning: Optional[str] = None,
                        enable_hidden_properties: Optional[bool] = None,
                        folder: Optional[str] = None,
                        host_system_id: Optional[str] = None,
                        ip_allocation_policy: Optional[str] = None,
                        ip_protocol: Optional[str] = None,
                        local_ovf_path: Optional[str] = None,
                        name: Optional[str] = None,
                        ovf_network_map: Optional[Mapping[str, str]] = None,
                        remote_ovf_url: Optional[str] = None,
                        resource_pool_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetOvfVmTemplateResult
def get_ovf_vm_template_output(allow_unverified_ssl_cert: Optional[pulumi.Input[bool]] = None,
                        datastore_id: Optional[pulumi.Input[str]] = None,
                        deployment_option: Optional[pulumi.Input[str]] = None,
                        disk_provisioning: Optional[pulumi.Input[str]] = None,
                        enable_hidden_properties: Optional[pulumi.Input[bool]] = None,
                        folder: Optional[pulumi.Input[str]] = None,
                        host_system_id: Optional[pulumi.Input[str]] = None,
                        ip_allocation_policy: Optional[pulumi.Input[str]] = None,
                        ip_protocol: Optional[pulumi.Input[str]] = None,
                        local_ovf_path: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        ovf_network_map: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                        remote_ovf_url: Optional[pulumi.Input[str]] = None,
                        resource_pool_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetOvfVmTemplateResult]
func GetOvfVmTemplate(ctx *Context, args *GetOvfVmTemplateArgs, opts ...InvokeOption) (*GetOvfVmTemplateResult, error)
func GetOvfVmTemplateOutput(ctx *Context, args *GetOvfVmTemplateOutputArgs, opts ...InvokeOption) GetOvfVmTemplateResultOutput

> Note: This function is named GetOvfVmTemplate in the Go SDK.

public static class GetOvfVmTemplate 
{
    public static Task<GetOvfVmTemplateResult> InvokeAsync(GetOvfVmTemplateArgs args, InvokeOptions? opts = null)
    public static Output<GetOvfVmTemplateResult> Invoke(GetOvfVmTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetOvfVmTemplateResult> getOvfVmTemplate(GetOvfVmTemplateArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: vsphere:index/getOvfVmTemplate:getOvfVmTemplate
  arguments:
    # arguments dictionary

The following arguments are supported:

HostSystemId string

The ID of the ESXi host system to deploy the virtual machine.

Name string

Name of the virtual machine to create.

ResourcePoolId string

The ID of a resource pool in which to place the virtual machine.

AllowUnverifiedSslCert bool

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

DatastoreId string

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

DeploymentOption string

The key of the chosen deployment option. If empty, the default option is chosen.

DiskProvisioning string

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

EnableHiddenProperties bool

Allow properties with ovf:userConfigurable=false to be set.

Folder string

The name of the folder in which to place the virtual machine.

IpAllocationPolicy string

The IP allocation policy.

IpProtocol string

The IP protocol.

LocalOvfPath string

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

OvfNetworkMap Dictionary<string, string>

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

RemoteOvfUrl string

URL of the remote OVF/OVA file to be deployed.

HostSystemId string

The ID of the ESXi host system to deploy the virtual machine.

Name string

Name of the virtual machine to create.

ResourcePoolId string

The ID of a resource pool in which to place the virtual machine.

AllowUnverifiedSslCert bool

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

DatastoreId string

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

DeploymentOption string

The key of the chosen deployment option. If empty, the default option is chosen.

DiskProvisioning string

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

EnableHiddenProperties bool

Allow properties with ovf:userConfigurable=false to be set.

Folder string

The name of the folder in which to place the virtual machine.

IpAllocationPolicy string

The IP allocation policy.

IpProtocol string

The IP protocol.

LocalOvfPath string

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

OvfNetworkMap map[string]string

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

RemoteOvfUrl string

URL of the remote OVF/OVA file to be deployed.

hostSystemId String

The ID of the ESXi host system to deploy the virtual machine.

name String

Name of the virtual machine to create.

resourcePoolId String

The ID of a resource pool in which to place the virtual machine.

allowUnverifiedSslCert Boolean

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

datastoreId String

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

deploymentOption String

The key of the chosen deployment option. If empty, the default option is chosen.

diskProvisioning String

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

enableHiddenProperties Boolean

Allow properties with ovf:userConfigurable=false to be set.

folder String

The name of the folder in which to place the virtual machine.

ipAllocationPolicy String

The IP allocation policy.

ipProtocol String

The IP protocol.

localOvfPath String

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

ovfNetworkMap Map<String,String>

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

remoteOvfUrl String

URL of the remote OVF/OVA file to be deployed.

hostSystemId string

The ID of the ESXi host system to deploy the virtual machine.

name string

Name of the virtual machine to create.

resourcePoolId string

The ID of a resource pool in which to place the virtual machine.

allowUnverifiedSslCert boolean

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

datastoreId string

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

deploymentOption string

The key of the chosen deployment option. If empty, the default option is chosen.

diskProvisioning string

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

enableHiddenProperties boolean

Allow properties with ovf:userConfigurable=false to be set.

folder string

The name of the folder in which to place the virtual machine.

ipAllocationPolicy string

The IP allocation policy.

ipProtocol string

The IP protocol.

localOvfPath string

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

ovfNetworkMap {[key: string]: string}

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

remoteOvfUrl string

URL of the remote OVF/OVA file to be deployed.

host_system_id str

The ID of the ESXi host system to deploy the virtual machine.

name str

Name of the virtual machine to create.

resource_pool_id str

The ID of a resource pool in which to place the virtual machine.

allow_unverified_ssl_cert bool

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

datastore_id str

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

deployment_option str

The key of the chosen deployment option. If empty, the default option is chosen.

disk_provisioning str

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

enable_hidden_properties bool

Allow properties with ovf:userConfigurable=false to be set.

folder str

The name of the folder in which to place the virtual machine.

ip_allocation_policy str

The IP allocation policy.

ip_protocol str

The IP protocol.

local_ovf_path str

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

ovf_network_map Mapping[str, str]

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

remote_ovf_url str

URL of the remote OVF/OVA file to be deployed.

hostSystemId String

The ID of the ESXi host system to deploy the virtual machine.

name String

Name of the virtual machine to create.

resourcePoolId String

The ID of a resource pool in which to place the virtual machine.

allowUnverifiedSslCert Boolean

Allow unverified SSL certificates when deploying OVF/OVA from a URL.

datastoreId String

The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores.

deploymentOption String

The key of the chosen deployment option. If empty, the default option is chosen.

diskProvisioning String

The disk provisioning type. If set, all the disks in the deployed OVA/OVF will have the same specified disk type. Can be one of thin, flat, thick or sameAsSource.

enableHiddenProperties Boolean

Allow properties with ovf:userConfigurable=false to be set.

folder String

The name of the folder in which to place the virtual machine.

ipAllocationPolicy String

The IP allocation policy.

ipProtocol String

The IP protocol.

localOvfPath String

The absolute path to the OVF/OVA file on the local system. When deploying from an OVF, ensure all necessary files such as the .vmdk files are present in the same directory as the OVF.

ovfNetworkMap Map<String>

The mapping of name of network identifiers from the OVF descriptor to network UUID in the environment.

remoteOvfUrl String

URL of the remote OVF/OVA file to be deployed.

getOvfVmTemplate Result

The following output properties are available:

AlternateGuestName string

An alternate guest operating system name.

Annotation string

A description of the virtual machine.

CpuHotAddEnabled bool

Allow CPUs to be added to the virtual machine while powered on.

CpuHotRemoveEnabled bool

Allow CPUs to be removed from the virtual machine while powered on.

CpuPerformanceCountersEnabled bool
Firmware string

The firmware to use on the virtual machine.

GuestId string

The ID for the guest operating system

HostSystemId string
Id string

The provider-assigned unique ID for this managed resource.

IdeControllerCount int
Memory int

The size of the virtual machine memory, in MB.

MemoryHotAddEnabled bool

Allow memory to be added to the virtual machine while powered on.

Name string
NestedHvEnabled bool

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

NumCoresPerSocket int

The number of cores per virtual CPU in the virtual machine.

NumCpus int

The number of virtual CPUs to assign to the virtual machine.

ResourcePoolId string
SataControllerCount int
ScsiControllerCount int
ScsiType string
SwapPlacementPolicy string

The swap file placement policy for the virtual machine.

AllowUnverifiedSslCert bool
DatastoreId string
DeploymentOption string
DiskProvisioning string
EnableHiddenProperties bool
Folder string
IpAllocationPolicy string
IpProtocol string
LocalOvfPath string
OvfNetworkMap Dictionary<string, string>
RemoteOvfUrl string
AlternateGuestName string

An alternate guest operating system name.

Annotation string

A description of the virtual machine.

CpuHotAddEnabled bool

Allow CPUs to be added to the virtual machine while powered on.

CpuHotRemoveEnabled bool

Allow CPUs to be removed from the virtual machine while powered on.

CpuPerformanceCountersEnabled bool
Firmware string

The firmware to use on the virtual machine.

GuestId string

The ID for the guest operating system

HostSystemId string
Id string

The provider-assigned unique ID for this managed resource.

IdeControllerCount int
Memory int

The size of the virtual machine memory, in MB.

MemoryHotAddEnabled bool

Allow memory to be added to the virtual machine while powered on.

Name string
NestedHvEnabled bool

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

NumCoresPerSocket int

The number of cores per virtual CPU in the virtual machine.

NumCpus int

The number of virtual CPUs to assign to the virtual machine.

ResourcePoolId string
SataControllerCount int
ScsiControllerCount int
ScsiType string
SwapPlacementPolicy string

The swap file placement policy for the virtual machine.

AllowUnverifiedSslCert bool
DatastoreId string
DeploymentOption string
DiskProvisioning string
EnableHiddenProperties bool
Folder string
IpAllocationPolicy string
IpProtocol string
LocalOvfPath string
OvfNetworkMap map[string]string
RemoteOvfUrl string
alternateGuestName String

An alternate guest operating system name.

annotation String

A description of the virtual machine.

cpuHotAddEnabled Boolean

Allow CPUs to be added to the virtual machine while powered on.

cpuHotRemoveEnabled Boolean

Allow CPUs to be removed from the virtual machine while powered on.

cpuPerformanceCountersEnabled Boolean
firmware String

The firmware to use on the virtual machine.

guestId String

The ID for the guest operating system

hostSystemId String
id String

The provider-assigned unique ID for this managed resource.

ideControllerCount Integer
memory Integer

The size of the virtual machine memory, in MB.

memoryHotAddEnabled Boolean

Allow memory to be added to the virtual machine while powered on.

name String
nestedHvEnabled Boolean

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

numCoresPerSocket Integer

The number of cores per virtual CPU in the virtual machine.

numCpus Integer

The number of virtual CPUs to assign to the virtual machine.

resourcePoolId String
sataControllerCount Integer
scsiControllerCount Integer
scsiType String
swapPlacementPolicy String

The swap file placement policy for the virtual machine.

allowUnverifiedSslCert Boolean
datastoreId String
deploymentOption String
diskProvisioning String
enableHiddenProperties Boolean
folder String
ipAllocationPolicy String
ipProtocol String
localOvfPath String
ovfNetworkMap Map<String,String>
remoteOvfUrl String
alternateGuestName string

An alternate guest operating system name.

annotation string

A description of the virtual machine.

cpuHotAddEnabled boolean

Allow CPUs to be added to the virtual machine while powered on.

cpuHotRemoveEnabled boolean

Allow CPUs to be removed from the virtual machine while powered on.

cpuPerformanceCountersEnabled boolean
firmware string

The firmware to use on the virtual machine.

guestId string

The ID for the guest operating system

hostSystemId string
id string

The provider-assigned unique ID for this managed resource.

ideControllerCount number
memory number

The size of the virtual machine memory, in MB.

memoryHotAddEnabled boolean

Allow memory to be added to the virtual machine while powered on.

name string
nestedHvEnabled boolean

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

numCoresPerSocket number

The number of cores per virtual CPU in the virtual machine.

numCpus number

The number of virtual CPUs to assign to the virtual machine.

resourcePoolId string
sataControllerCount number
scsiControllerCount number
scsiType string
swapPlacementPolicy string

The swap file placement policy for the virtual machine.

allowUnverifiedSslCert boolean
datastoreId string
deploymentOption string
diskProvisioning string
enableHiddenProperties boolean
folder string
ipAllocationPolicy string
ipProtocol string
localOvfPath string
ovfNetworkMap {[key: string]: string}
remoteOvfUrl string
alternate_guest_name str

An alternate guest operating system name.

annotation str

A description of the virtual machine.

cpu_hot_add_enabled bool

Allow CPUs to be added to the virtual machine while powered on.

cpu_hot_remove_enabled bool

Allow CPUs to be removed from the virtual machine while powered on.

cpu_performance_counters_enabled bool
firmware str

The firmware to use on the virtual machine.

guest_id str

The ID for the guest operating system

host_system_id str
id str

The provider-assigned unique ID for this managed resource.

ide_controller_count int
memory int

The size of the virtual machine memory, in MB.

memory_hot_add_enabled bool

Allow memory to be added to the virtual machine while powered on.

name str
nested_hv_enabled bool

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

num_cores_per_socket int

The number of cores per virtual CPU in the virtual machine.

num_cpus int

The number of virtual CPUs to assign to the virtual machine.

resource_pool_id str
sata_controller_count int
scsi_controller_count int
scsi_type str
swap_placement_policy str

The swap file placement policy for the virtual machine.

allow_unverified_ssl_cert bool
datastore_id str
deployment_option str
disk_provisioning str
enable_hidden_properties bool
folder str
ip_allocation_policy str
ip_protocol str
local_ovf_path str
ovf_network_map Mapping[str, str]
remote_ovf_url str
alternateGuestName String

An alternate guest operating system name.

annotation String

A description of the virtual machine.

cpuHotAddEnabled Boolean

Allow CPUs to be added to the virtual machine while powered on.

cpuHotRemoveEnabled Boolean

Allow CPUs to be removed from the virtual machine while powered on.

cpuPerformanceCountersEnabled Boolean
firmware String

The firmware to use on the virtual machine.

guestId String

The ID for the guest operating system

hostSystemId String
id String

The provider-assigned unique ID for this managed resource.

ideControllerCount Number
memory Number

The size of the virtual machine memory, in MB.

memoryHotAddEnabled Boolean

Allow memory to be added to the virtual machine while powered on.

name String
nestedHvEnabled Boolean

Enable nested hardware virtualization on the virtual machine, facilitating nested virtualization in the guest.

numCoresPerSocket Number

The number of cores per virtual CPU in the virtual machine.

numCpus Number

The number of virtual CPUs to assign to the virtual machine.

resourcePoolId String
sataControllerCount Number
scsiControllerCount Number
scsiType String
swapPlacementPolicy String

The swap file placement policy for the virtual machine.

allowUnverifiedSslCert Boolean
datastoreId String
deploymentOption String
diskProvisioning String
enableHiddenProperties Boolean
folder String
ipAllocationPolicy String
ipProtocol String
localOvfPath String
ovfNetworkMap Map<String>
remoteOvfUrl String

Package Details

Repository
vSphere pulumi/pulumi-vsphere
License
Apache-2.0
Notes

This Pulumi package is based on the vsphere Terraform Provider.