New-CIVM Command | Vmware PowerCLI Reference

New-CIVM

This cmdlet creates a new cloud virtual machine into an existing vApp by using a specified virtual machine template.

Syntax

New-CIVM
-DiskGB < Decimal[] >
-MemoryGB < Decimal >
-Name < String >
-VApp < CIVApp >
[-CDMedia < Media > ]
[-ComputerName < String > ]
[-CpuCoresPerSocket < UInt64 > ]
[-CpuCount < UInt64 > ]
[-NicCount < UInt64 > ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < CIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
DiskGB Decimal[] named
Specifies the sizes of the virtual hard disk(s) of the new virtual machine.
required
MemoryGB Decimal named
Specifies the memory size of the new virtual machine.
required
Name String named
Specifies the name of the newly created cloud virtual machine. If not specified, the name of the virtual machine template is used.
required
VApp CIVApp named
  • pipeline
  • wildcards
Specifies the vApp to which you want to add the cloud virtual machine.
optional CDMedia Media named
  • wildcards
Specifies a CD/DVD .ISO image to be mounted in the virtual CD drive of the new virtual machine.
optional ComputerName String named
Specifies the computer name to be applied to the cloud virtual machine with guest customization.
optional CpuCoresPerSocket UInt64 named
Specifies the number of cores for each virtual CPU.
optional CpuCount UInt64 named
Specifies the number of virtual CPUs of the new virtual machine.
optional NicCount UInt64 named
Specifies the number of virtual network adapter(s) of the new virtual machine. The created adapters are of type PCNet32.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server CIServer[] named
  • wildcards
Specifies the cloud servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.
New-CIVM
-VApp < CIVApp >
-VMTemplate < CIVMTemplate >
[-ComputerName < String > ]
[-Name < String > ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < CIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VApp CIVApp named
  • pipeline
  • wildcards
Specifies the vApp to which you want to add the cloud virtual machine.
required
VMTemplate CIVMTemplate named
  • pipeline
  • wildcards
Specifies the virtual machine template from which the new cloud virtual machine is created.
optional ComputerName String named
Specifies the computer name to be applied to the cloud virtual machine with guest customization.
optional Name String named
Specifies the name of the newly created cloud virtual machine. If not specified, the name of the virtual machine template is used.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server CIServer[] named
  • wildcards
Specifies the cloud servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.

Output

VMware.VimAutomation.Cloud.Types.V1.CIVM

Examples

Example 1

$templateVM = Get-CIVMTemplate -Name "myTemplateVM"
Get-CIVApp "myCIVApp" | New-CIVM -Name "myVM" -VMTemplate $templateVM

Retrieves a virtual machine template named "myTemplateVM", creates a cloud virtual machine named "myVM" from the template, and adds it to a cloud vApp named "myCIVApp".

Example 2

Get-OrgVdc OrgVdcName | New-CIVApp new-civapp-name
Get-CIVApp new-civapp-name | New-CIVM new-civm-name

Creates a virtual machine inside a vApp by specifying name only. Default values will be used for the rest of the parameters.

Example 3

$vapp = Get-OrgVdc OrgVdcName | New-CIVApp new-civapp-name
$vapp | New-CIVM `
	-Name new-civm-name `
	-ComputerName new-vm-network-name `
	-CpuCoresPerSocket 2 `
	-CpuCount 4 `
	-MemoryGB 4 `
	-DiskGB 20,30 `
	-CDMedia ISOMediaName  `
	-NicCount 3

Creates a virtual machine inside a vApp by specifying all supported parameters.

Related Commands

CIVM

This cmdlet retrieves virtual machines in the cloud.

This cmdlet creates a new cloud virtual machine.

This cmdlet resets the specified virtual machine.

This cmdlet powers on the specified virtual machine.

This cmdlet powers off the specified virtual machine.

This cmdlet suspends the specified virtual machine.

CIVMGuest

This cmdlet restarts the guest operating system of the specified virtual machine.

This cmdlet shuts down the guest operating system of the specified virtual machine.

CIVMTemplate

This cmdlet retrieves the virtual machine templates in the cloud.