< Back

New-GceDisk

Mon Jan 13, 2020 11:25 pm

NAME New-GceDisk



SYNOPSIS

Creates a new Google Compute Engine disk object.





SYNTAX

New-GceDisk [-Project <string>] [-Zone <string>] [-DiskName] <string> [-Description <string>] [-SizeGb <long>]

[-DiskType <string>] [-Label <Hashtable>] [<CommonParameters>]



New-GceDisk [-Project <string>] [-Zone <string>] [-DiskName] <string> [-Description <string>] [-SizeGb <long>]

[-DiskType <string>] [-Label <Hashtable>] [-Image] <Image> [<CommonParameters>]



New-GceDisk [-Project <string>] [-Zone <string>] [-DiskName] <string> [-Description <string>] [-SizeGb <long>]

[-DiskType <string>] [-Label <Hashtable>] [-Snapshot] <Snapshot> [<CommonParameters>]





DESCRIPTION

Creates a new Google Compute Engine disk object.





PARAMETERS

-Project <string>

The project to associate the new Compute Engine disk.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Zone <string>

Specific zone to create the disk in, e.g. "us-central1-a".



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DiskName <string>

Name of the disk.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <string>

Optional description of the disk.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SizeGb <long>

Specify the size of the disk in GiB.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DiskType <string>

Type of disk, e.g. pd-ssd or pd-standard.



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 disk.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Image <Image>

Source image to apply to the disk.



Use Get-GceImage to get the image to apply. For instance, to get the latest windows instance, use Get-GceImage

-Family "windows-2012-r2" -Project "windows-cloud".



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Snapshot <Snapshot>

Source snapshot to apply to the disk.



Use Get-GceSnapshot to get a previously made backup snapshot to apply to this disk.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

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.Image

Source image to apply to the disk.



Use Get-GceImage to get the image to apply. For instance, to get the latest windows instance, use Get-GceImage

-Family "windows-2012-r2" -Project "windows-cloud".



Google.Apis.Compute.v1.Data.Snapshot

Source snapshot to apply to the disk.



Use Get-GceSnapshot to get a previously made backup snapshot to apply to this disk.





OUTPUTS

Google.Apis.Compute.v1.Data.Disk





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



PS C:\\> New-GceDisk "disk-name" -SizeGb 10 -DiskType pd-ssd



Creates a new empty 10GB persistant solid state disk named "disk-name" in the default project and zone.

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



PS C:\\> Get-GceImage -Family "windows-2012-r2" | New-GceDisk "disk-from-image"



Creates a new persistant disk from the latest windows-2012-r2 image.

---------- EXAMPLE 3 ----------



PS C:\\> Get-GceSnapshot "snapshot-name" | New-GceDisk "disk-from-snapshot"



Creates a new persistant disk from the snapshot named "snapshot-name".



RELATED LINKS

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