< Back

New-GceAttachedDiskConfig

Mon Jan 13, 2020 11:24 pm

NAME New-GceAttachedDiskConfig



SYNOPSIS

Use this cmdlet when you need to provide additional information to Set-GceInstance -AddDisk or Add-GceInstance.





SYNTAX

New-GceAttachedDiskConfig [-Source] <Disk> [-AutoDelete <SwitchParameter>] [-Boot <SwitchParameter>] [-Nvme

<SwitchParameter>] [-DeviceName <string>] [-ReadOnly <SwitchParameter>] [<CommonParameters>]



New-GceAttachedDiskConfig [[-SourceImage] <Image>] [-Name <string>] [-DiskType <string>] [-Size <long>]

[-AutoDelete <SwitchParameter>] [-Boot <SwitchParameter>] [-Nvme <SwitchParameter>] [-DeviceName <string>]

[-ReadOnly <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

Creates a single new AttachedDisk object. These objects are used by New-GceInstanceConfig, Add-GceInstance,

Add-GceInstanceTemplate and Set-GceInstance. They provide additional information about the disk being attached,

such as the local name of the disk, or whether the disk should be automatically deleted.





PARAMETERS

-Source <Disk>

The URI of the preexisting disk to attach to an instance.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SourceImage <Image>

The source image of the new disk.



Required? false

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Name <string>

The name of the disk to create.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DiskType <string>

Specifies the type of the disk. Defaults to pd-standard.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Size <long>

The size of the disk to create, in GB.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AutoDelete <SwitchParameter>

When set, disk will be deleted when the instance is.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Boot <SwitchParameter>

When set, describes the boot disk of an instance.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Nvme <SwitchParameter>

When set, the disk interface will be NVME rather than SCSI.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DeviceName <string>

The name of the disk on the instance.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ReadOnly <SwitchParameter>

Set to limit the instance to read operations.



Required? false

Position? named

Default value False

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

Google.Apis.Compute.v1.Data.Disk

The URI of the preexisting disk to attach to an instance.



Google.Apis.Compute.v1.Data.Image

The source image of the new disk.





OUTPUTS

Google.Apis.Compute.v1.Data.AttachedDisk





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



PS C:\\> $image = Get-GceImage "windows-cloud" -Family "windows-2012-r2"

PS C:\\> $disks = (New-GceAttachedDiskConfig $image -Boot -AutoDelete), `

(New-GceAttachedDiskConfig (Get-GceDisk "persistant-disk-name") -ReadOnly)

PS C:\\> Add-GceInstanceTemplate -Name "template-name" -Disk $disks



Creates two attached disk objects, and creates a new template using them.



RELATED LINKS

[Attached Disk resource definition]

(https://cloud.google.com/compute/docs/r ... quest-body)