< Back

New-VsphereVm

Sat Jan 18, 2020 9:38 am

NAME New-VsphereVm



SYNOPSIS

Creates a new VM based on a template.





SYNTAX

New-VsphereVm -Name <String> -FolderId <String> -TemplateId <String> -DatastoreId <String> -ResourcePoolId

<String> [-HostId <String>] [-CustomSpec <String>] [-DiskProvision {Thick Provision Lazy Zeroed | Thick Provision

Eager Zeroed | Thin Provision}] -Connection <Hashtable> [<CommonParameters>]





DESCRIPTION

Creates a new VM based on a template.





PARAMETERS

-Name <String>

The name of the new VM.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-FolderId <String>

ID (managed object reference) of the folder where the new VM is to be located.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-TemplateId <String>

ID (managed object reference) of the template on which the new VM is based.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-DatastoreId <String>

ID (managed object reference) of the datastore where the new VM is to be located. The specified datastore must

be accessible for the specified resource pool.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ResourcePoolId <String>

ID (managed object reference) of the resource pool for the new VM. Specifying the resource pool also

implicitly specifies the host (in the case of a stand-alone host), or the cluster.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-HostId [<String>]

ID (managed object reference) of the host where the VM should be created. If specified, the specified resource

pool and datastore must be accessible from the specified host.

??????? This parameter is optional when creating a new VM under a stand-alone host since the host is implicitly

specified by the specified resource pool.

??????? This parameter is optional when creating a new VM under a DRS enabled Cluster, since the host is assigned

automatically from the DRS Cluster implicitly specified by the specified resource pool.

??????? This parameter is required when creating a VM under to a non DRS Cluster.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-CustomSpec [<String>]

The name of a Customization Spec which is to be applied to the new VM. You can use the vSphere Customization

Specifications Manager (under Home/Management) to configure VM customization specs. VMware Tools must be

installed on the template source VM in order for a customization spec to be applied. A customization spec is

applied on a new VM after the VM is started the first time.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-DiskProvision [<String>]

Provision type for the all the hard disks on the new VM. Use this parameter when you wish the new VM to have a

different provision than the one specified in the VM template. Accepted values are:

Thick Provision Lazy Zeroed

Thick Provision Eager Zeroed

Thin Provision



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Connection <Hashtable>

Specifies connection information to the vCenter server. For example:

@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license

key>;SkipCertificateValidation=$false}



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.String

ID (managed object reference) of the new VM.







RELATED LINKS