Use Systems Manager command documents to create VSS based snapshots
You can use AWS Systems Manager command documents to create VSS based snapshots. The following content introduces the command documents that are available, and the runtime parameters that the documents use to create your snapshots.
Before you use any of the Systems Manager command documents, ensure that you've met all Prerequisites to create Windows VSS based EBS snapshots.
Topics
Parameters for Systems Manager VSS snapshot documents
The Systems Manager documents that create VSS snapshots all use the following parameters, except where noted:
- AmiName (string, optional)
-
If the CreateAmi option is set to
True
, specify the name of the AMI that the backup creates. - description (string, optional)
-
Specify a description for the snapshots or image that this process creates.
- CollectDiagnosticLogs (string, optional)
-
To collect more information during snapshot and AMI creation steps, set this parameter to "
True
". The default value for this parameter is "False
". Consolidated diagnostic logs are saved as a.zip
format archive at the following location on your instance:C:\ProgramData\Amazon\AwsVss\Logs\
timestamp
.zip - CopyOnly (string, optional)
-
If you use the native SQL Server backup in addition to AWS VSS, performing a Copy-only backup prevents AWS VSS from breaking the native differential backup chain. To perform a Copy-only backup operation, set this parameter to
True
.The default value for this parameter is
False
, which causes AWS VSS to perform a full backup operation. - CreateAmi (string, optional)
-
To create a VSS based Amazon Machine Image (AMI) to back up your instance, set this parameter to
True
. The default value for this parameter isFalse
, which backs up your instance with an EBS snapshot instead.For more information about creating an AMI from an instance, see Create an Amazon EBS-backed AMI.
- executionTimeout (string, optional)
-
Specify the maximum time in seconds to run the snapshot creation process on the instance, or to create an AMI from the instance. Increasing this timeout allows the command to wait longer for VSS to start its freeze and complete tagging of the resources it creates. This timeout only applies to the snapshot or AMI creation steps. The initial step to install or update the
AwsVssComponents
package is not included in the timeout. - ExcludeBootVolume (string, optional)
-
This setting excludes boot volumes from the backup process if you create snapshots. To exclude boot volumes from your snapshots, set ExcludeBootVolume to
True
, and CreateAmi toFalse
.If you create an AMI for your backup, this parameter should be set to
False
. The default value for this parameter isFalse
. - NoWriters (string, optional)
-
To exclude application VSS writers from the snapshot process, set this parameter to
True
. Excluding application VSS writers can help you resolve conflicts with third-party VSS backup components. The default value for this parameter isFalse
.If
SaveVssMetadata
isTrue
, this parameter must be set toFalse
. - SaveVssMetadata (string, optional)
-
To save VSS metadata files during every snapshot, set this parameter to
True
. The default value isFalse
. VSS Metadata files help provide insights into which components or writers were included in a backup operation, and the associated files for each component.Metadata files have the associated snapshot set id in their names. You can find them at the following location on your instance:
C:\ProgramData\Amazon\AwsVss\VssMetadata\
Warning
-
Saving VSS metadata files requires
AwsVssComponents
package version 2.4.0 or later. If your instance has an earlier version installed, settingSaveVssMetadata
toTrue
causes the snapshot creation to fail. -
The
NoWriters
andSaveVssMetadata
parameters are mutually exclusive. If both are set toTrue
then snapshot creation fails.
-
- tags (string, optional)
-
We recommend that you tag your snapshots and images to help you locate and manage your resources, for example, to restore volumes from a list of snapshots. The system adds the
Name
key, with a blank value where you can specify the name that you want to apply to your output snapshots or images.If you want to specify additional tags, separate tags with a semicolon in between. For example,
Key=Environment,Value=Test;Key=User,Value=TestUser1
.By default, the system adds the following reserved tags for VSS based snapshots and images.
-
Device – For VSS based snapshots, this is the device name of the EBS volume that the snapshot captures.
-
AppConsistent – This tag indicates the successful creation of a VSS based snapshot or AMI.
-
AwsVssConfig – This identifies snapshots and AMIs that are created with VSS enabled. The tag includes meta information such as the
AwsVssComponents
version, and the Snapshot Set ID.
Warning
Specifying any of these reserved tags in your parameter list will cause an error.
-
- VssVersion (string, optional)
-
For the
AWSEC2-VssInstallAndSnapshot
document only, you can specify theVssVersion
parameter to install a specific version ofAwsVssComponents
package on your instance. Leave this parameter blank to install the recommended default version.If the specified version of the
AwsVssComponents
package is already installed, the script skips the install step and moves on to the backup step. For a list ofAwsVssComponents
package versions and operating support, see AWS VSS solution version history.
Run Systems Manager VSS snapshot command documents
You can create VSS based EBS snapshots with AWS Systems Manager command documents as follows.
When you use AWS Systems Manager to run the AWSEC2-VssInstallAndSnapshot
document,
the script runs the following steps.
-
The script first installs or updates the
AwsVssComponents
package on your instance, depending on whether it's already installed. -
The script creates the application-consistent snapshots after the first step completes.
To run the AWSEC2-VssInstallAndSnapshot
document, follow the steps for
your preferred environment.
To run the AWSEC2-CreateVssSnapshot
document, follow the steps for
your preferred environment.
You can use any of the command line procedures described in the previous section
to create a VSS based snapshot. The command document
(AWSEC2-VssInstallAndSnapshot
or AWSEC2-CreateVssSnapshot
)
must run on the primary node in your cluster. The document will fail
on the secondary nodes as they don't have access to the shared disks. If your
primary and secondary change dynamically, you can run the AWS Systems Manager Run Command
document on multiple nodes with the expectation that the command will succeed on
the primary node and fail on secondary nodes.
Note
To automate backups, you can create an AWS Systems Manager maintenance window task that uses the
AWSEC2-VssInstallAndSnapshot
document. For more information, see
Working with Maintenance Windows (Console) in the
AWS Systems Manager User Guide.