< Back

New-GceInstanceConfig

Mon Jan 13, 2020 11:26 pm

NAME New-GceInstanceConfig



SYNOPSIS

Makes a new Google Compute Engine VM instance description.





SYNTAX

New-GceInstanceConfig [-Name] <string> [[-MachineType] <string>] [-CanIpForward <SwitchParameter>] [-Description

<string>] [-BootDisk <Disk>] [-BootDiskImage <Image>] [-ExtraDisk <Disk[]>] [-Disk <AttachedDisk[]>] [-Metadata

<IDictionary>] [-Network <string>] [-Region <string>] [-Subnetwork <string>] [-NoExternalIp <SwitchParameter>]

[-Preemptible <SwitchParameter>] [-AutomaticRestart <bool>] [-TerminateOnMaintenance <SwitchParameter>]

[-ServiceAccount <ServiceAccount[]>] [-Tag <string[]>] [-Label <Hashtable>] [-Address <string>]

[<CommonParameters>]



New-GceInstanceConfig [-Name] <string> -CustomCpu <int> -CustomMemory <int> [-CanIpForward <SwitchParameter>]

[-Description <string>] [-BootDisk <Disk>] [-BootDiskImage <Image>] [-ExtraDisk <Disk[]>] [-Disk <AttachedDisk[]>]

[-Metadata <IDictionary>] [-Network <string>] [-Region <string>] [-Subnetwork <string>] [-NoExternalIp

<SwitchParameter>] [-Preemptible <SwitchParameter>] [-AutomaticRestart <bool>] [-TerminateOnMaintenance

<SwitchParameter>] [-ServiceAccount <ServiceAccount[]>] [-Tag <string[]>] [-Label <Hashtable>] [-Address <string>]

[<CommonParameters>]





DESCRIPTION

Makes a new Google Compute Engine VM instance description. Use Add-GceInstance to instantiate the instance.





PARAMETERS

-Name <string>

The name of the instance. The name must be 1-63 characters long and match [a-z]([-a-z0-9]*[a-z0-9])?



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-MachineType <string>

The machine type of this instance. Can be a name, a URL or a MachineType object from Get-GceMachineType.

Defaults to "n1-standard-1".



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CustomCpu <int>

Number of vCPUs used for a custom machine type. This has to be used together with CustomMemory.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-CustomMemory <int>

Total amount of memory used for a custom machine type. This has to be used together with CustomCpu. The amount

of memory is in MB.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-CanIpForward <SwitchParameter>

Enables instances to send and receive packets for IP addresses other than their own. Switch on if these

instances will be used as an IP gateway or it will be set as the next-hop in a Route resource.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Description <string>

Human readable description of this instance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-BootDisk <Disk>

The persistant disk to use as a boot disk. Use Get-GceDisk to get one of these.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-BootDiskImage <Image>

The the image used to create the boot disk. Use Get-GceImage to get one of these.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DiskImage <Image>

The the image used to create the boot disk. Use Get-GceImage to get one of these.



This is an alias of the BootDiskImage parameter.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExtraDisk <Disk[]>

An existing disk to attach in read only mode.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Disk <AttachedDisk[]>

An AttachedDisk object specifying a disk to attach. Do not specify -BootDiskImage or -BootDiskSnapshot if this

is a boot disk. You can build one using New-GceAttachedDiskConfig.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Metadata <IDictionary>

The keys and values of the Metadata of this instance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Network <string>

The name of the network to use. If not specified, is default. This can be a Network object you get from

Get-GceNetwork.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Region <string>

The region in which the subnet of the instance will reside. Defaults to the region in the Cloud SDK config.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Subnetwork <string>

The name of the subnetwork to use.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NoExternalIp <SwitchParameter>

If set, the instances will not have an external ip address.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Preemptible <SwitchParameter>

If set, the instances will be preemptible. If set, AutomaticRestart will be false.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AutomaticRestart <bool>

If set, the instances will not restart when shut down by Google Compute Engine.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-TerminateOnMaintenance <SwitchParameter>

If set, the instances will terminate rather than migrate when the host undergoes maintenance.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ServiceAccount <ServiceAccount[]>

The ServiceAccount used to specify access tokens.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tag <string[]>

A tag of this instance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Label <Hashtable>

The map of labels (key/value pairs) to be applied to the instance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Address <string>

The static ip address this instance will have. Can be a string, or and Address object from Get-GceAddress.



Required? false

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

System.String

The name of the instance. The name must be 1-63 characters long and match [a-z]([-a-z0-9]*[a-z0-9])?





OUTPUTS

Google.Apis.Compute.v1.Data.Instance





---------- EXAMPLE 1 ----------



PS C:\\> $config = New-GceInstanceConfig -Name "new-instance" -BootDiskImage $image



Creates a new instance description and saves it to $config. The new instance will create a new boot disk from

$image.

---------- EXAMPLE 2 ----------



PS C:\\> $config = New-GceInstanceConfig -Name "new-instance" -BootDiskImage $image -Subnetwork "my-subnetwork"



Creates a new instance description and saves it to $config. The new instance will create a new boot disk from

$image and uses subnetwork "my-subnetwork".



RELATED LINKS

[Instance resource definition] (https://cloud.google.com/compute/docs/r ... s#resource)