NAME
Add-DcsSnapshot
SYNOPSIS
Creates a snapshot of a virtual disk. This operation can also be performed on a virtual disk group, which creates a snapshot group.
SYNTAX
Add-DcsSnapshot [ -Server <String> ] -VirtualDisk <Object> [ -Name <String> ] [ -Pool <String> ] [ -Full] [ -Description <String> ] [-Compressed <Boolean>] [ -DuplicateDiskId] [ -AssignToCurrentUser] [ -Connection <String> ] [ -PipelineVariable <String> ] [<CommonParameters>]
Add-DcsSnapshot [ -Server <String> ] -VirtualDiskGroup <Object> [ -Name <String> ] [ -Pool <String> ] [ -Full] [ -Description <String> ] [ -DuplicateDiskId] [ -AssignToCurrentUser] [ -Connection <String> ] [ -PipelineVariable <String> ] [<CommonParameters>]
Add-DcsSnapshot [-Server <String>] -VirtualDiskGroup <Object> [-Name <String>] -SnapshotGroupCreationProperties <Object []> [-Full] [-Description <String>] [-DuplicateDiskId] [-AssignToCurrentUser] [-Connection <String>] [-PipelineVariable <String>] [<CommonParameters>]
DESCRIPTION
Creates a snapshot of a virtual disk. This operation can also be performed on a virtual disk group, which creates a snapshot group. The snapshots created can be different or full images. A mapstore must be set before invoking this cmdlet, see Set-DcsSnapshotMapStore.
PARAMETERS
- -Server<String>
- Computer name or ID of the server where the snapshot should be created. The computer name must be unique or the name must be fully qualified.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -VirtualDisk<Object>
- VirtualDiskData object, name, or ID that identifies the virtual disk to be used as the source of the snapshot.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: true (ByValue)
- Accept wildcard characters: false
-
- -Name<String>
- Name to assign to the snapshot. If not specified a default name will be assigned. The default name will consist of the name of the source virtual disk and timestamp of when the snapshot is created.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Pool<String>
- Name or ID of the pool to use to create the snapshot. To resolve by name, the name must be unique to the server group or the server must be specified.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
- -SnapshotGroupCreationProperties <Object []>
- An array of SnapshotGroupCreationData, which is created from the cmdlet Get-DcsSnapshotGroupCreationProperties.
-
- Required: true
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Full
- Specify this parameter to create a snapshot that is a clone copy of the source and can exist and operate independently from the source virtual disk. If this parameter is not specified, a differential snapshot will be created. A differential snapshot is a logical image that is dependent on the source virtual disk.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Description<String>
- Description of the snapshot.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Compression <Boolean>
- Use this parameter to enable Inline Compression on the Snapshot. Specifying as $True will enable the feature. It can only be enabled if the destination pool has Capacity Optimization enabled.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -DuplicateDiskId<SwitchParameter>
- Specify this parameter only if both the source virtual disk and the snapshot will be served to client hosts that require the same SCSI inquiry ID (virtual product information).
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -AssignToCurrentUser<SwitchParameter>
- Use this parameter to assign exclusive ownership to the user account currently logged in. This restricts all operations on the snapshot being created to only the authenticated user for the current PowerShell session.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -Connection<String>
- Alias of the connection to the server group. If not specified, the default connection will be used.
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -PipelineVariable<String>
-
- Required: false
- Position: named
- Default value:
- Accept pipeline input: false
- Accept wildcard characters: false
-
- -VirtualDiskGroup<Object>
- VirtualDiskGroupData object, name or ID that identifies a virtual disk group. The object can be obtained using Get-DcsVirtualDiskGroup. This parameter is used to create a snapshot group from a virtual disk group. The snapshot group will be named using the virtual disk group name with the timestamp appended. For example, if the virtual disk group is named VDGroup1 and the timestamp is 11/2/2011 2:45:19 PM, then the snapshot group name would be "VDGroup1 @ 11/2/2011 2:45:19 PM".
-
- 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
VirtualDiskData : Object that identifies and describes the virtual disk.
OUTPUTS
SnapshotData or SnapshotGroupData : Object that identifies and describes the snapshot or the snapshot group.
NOTES
Also see Set-DcsSnapshotMapStore, Update-DcsSnapshot, ConvertTo-DcsFullSnapshot, Revert-DcsSnapshot, Remove-DcsSnapshot, Get-DcsSnapshot, Get-DcsVirtualDisk, Get-DcsVirtualDiskGroup, Get-DcsSnapshotGroup, Remove-DcsSnapshotGroup, Get-SnapshotGroupCreationProperties.
EXAMPLES
Add-DcsSnapshot -Server SSV1 -VirtualDisk "Virtual Disk 2" -Pool SSV1Pool3 -Full -Compressed $True -Description "Virtual Disk 2 Nightly Backup"
Creates a full (clone copy) snapshot of the virtual disk named "Virtual Disk 2". The snapshot is created from the disk pool named "SSV1Pool3" on the server named "SSV1". The description is set to "Virtual Disk 2 Nightly Backup". Compression is enabled. The snapshot name will be the default name "Virtual disk 2 @ 7/27/2011 2:09:11 PM" (virtual disk name with the timestamp of when the snapshot was created).
SourceLogicalDiskId | : | LD:74EDD1B3-6682-46A7-943C-2F0168CEC699_V.{267e5c50-abd6-11e0-9515-00155d11e921}-00000014 |
DestinationLogicalDiskId | : | LD:74EDD1B3-6682-46A7-943C-2F0168CEC699_V.{b96878da-b7af-11e0-9ba8-00155d11e921}-00000004 |
Type | : | Full |
TimeStamp | : | 7/27/2011 2:09:13 PM |
ActiveOperation | : | NoOperation |
State | : | Creating |
Failure | : | NoFailure |
Compression | : | True |
Sequencenumber | : | 18918 |
Id | : | V.{267E5C50-ABD6-11E0-9515-00155D11E921}-00000014--V.{B96878DA-B7AF-11E0-9BA8-00155D11E921}-00000004 |
Caption | : | Virtual disk 2 @ 7/27/2011 2:09:11 PM |
ExtendedCaption | : | Virtual disk 2 @ 7/27/2011 2:09:11 PM on SSV1 |
Internal | : | False |
Add-DcsSnapshot -Server SSVVM1 -VirtualDiskGroup VDgroup1 -Pool "Disk pool 1" -Full
Creates a full (clone copy) snapshot of the virtual disk group named "VDgroup1". The snapshot is created from the disk pool named "Disk pool 1" on the server named "SSVVM1". The snapshot name will be the default name "VDgroup1 @ 11/3/2011 4:25:48 PM" (virtual disk group name with the timestamp of when the snapshot group was created).
TotalCapacity | : | 100 GiB |
ParentGroupId | : | {827c0546-a101-4115-8a8f-b07ab87272dd} |
Type | : | Full |
ActiveOperation | : | NoOperation |
TimeStamp | : | 1/1/0001 12:00:00 AM |
Alias | : | VDgroup1 @ 11/3/2011 4:25:48 PM |
Description | : | |
StorageDomainSettings | : | 0 B/sec|0 IO/sec|False |
Sequencenumber | : | 11725 |
Id | : | {02685559-ba03-4cb5-a346-f79fc2d62765} |
Caption | : | VDgroup1 @ 11/3/2011 4:25:48 PM |
ExtendedCaption | : | VDgroup1 @ 11/3/2011 4:25:48 PM UTC |
Internal | : | False |
$snapshotGroupCreationProperties = Get-DcsSnapshotGroupCreationProperties -VirtualDiskGroup "Virtual disk group 1" $snapshotGroupCreationProperties | where {$_.VirtualDiskId -eq "2317ff2f7f294f94ba462b244d4e7526"}).DestinationPoolId= "663204D9-B5F0-4251-9B9D-C0E8CE081456:{32bf0009-0ce6-11ee-9f8d-00155d026515}" $snapshotGroupCreationProperties | where {$_.VirtualDiskId -eq "cffa9aa70a7a4ae9bbf6e97c14d95cce"}).Compression = $true Add-DcsSnapshot -VirtualDiskGroup "Virtual disk group 1" -SnapshotGroupCreationProperties $snapshotGroupCreationProperties -Full
In this example, a series of cmdlet invocations is used to create a snapshot group for "Virtual disk group 1" with SnapshotGroupCreationProperties. First, Get-DcsSnapshotGroupCreationProperties is invoked with "Virtual disk group 1" specified and the resulting SnapshotGroupCreationData is stored in the variable $snapshotGroupCreationProperties. Next, get SnapshotGroupCreationData from variable $snapshotGroupCreationProperties where VirtualDiskId is equal to "2317ff2f7f294f94ba462b244d4e7526" and set DestinationPoolId to "663204D9-B5F0-4251-9B9D-C0E8CE081456:{32bf0009-0ce6-11ee-9f8d-00155d026515}". Next, get SnapshotGroupCreationData from variable $snapshotGroupCreationProperties where VirtualDiskId is equal to "cffa9aa70a7a4ae9bbf6e97c14d95cce" and set Compression to $true. At the last line, the Add-DcsSnapshot is invoked with "Virtual disk group 1" and edited $snapshotGroupCreationProperties to create snapshot group for virtual disk group "Virtual disk group 1".
TotalCapacity | : | 25 GiB |
ParentGroupId | : | {fc378d78-9314-4478-bfac-ea1b13e90045} |
Type | : | Full |
ActiveOperation | : | NoOperation |
TimeStamp | : | 1/1/0001 12:00:00 AM |
Alias | : | Virtual disk group 1 @ 6/23/2023 3:58:23 PM UTC |
Description | : | |
StorageDomainSettings | : | 0 B/sec|0 IO/sec|False |
Sequencenumber | : | 88928 |
Id | : | {ec67e4f4-251a-4839-9ca4-564f06d98555} |
Caption | : | Virtual disk group 1 @ 6/23/2023 3:58:23 PM UTC |
ExtendedCaption | : | Virtual disk group 1 @ 6/23/2023 3:58:23 PM UTC |
Internal | : | False |