Create Snapshot of EC2 Instance
You can manually create a snapshot of an EC2 instance with the specified ID.
Note |
When you create a snapshot manually, Veeam Backup for AWS detects if there is a snapshot chain for the processed EC2 instance. If the snapshot chain exists, Veeam Backup for AWS continues the existing chain. Otherwise, the created snapshot starts a new snapshot chain for the processed EC2 instance. |
Request
To create a snapshot of a specific EC2 instance, send the HTTP POST request to the /virtualMachines/{virtualMachineId}/takeSnapshot endpoint. {virtualMachineId} is a system ID assigned to the EC2 instance in the Veeam Backup for AWS REST API.
HTTP Request
POST https://<hostname>:<port>/api/v1/virtualMachines/{virtualMachineId}/takeSnapshot |
Request Headers
The request contains the following headers.
Header | Required/Optional | Value | Description |
---|---|---|---|
Authorization | Required | Bearer <Access-Token> | Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format. |
x-api-version | Required | 1.0-rev0 | Specifies the current revision of the Veeam Backup for AWS REST API. |
Content-Type | Required | application/json | Identifies a media type that is used in the body of the request. |
Accept | Optional |
| Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type. |
Request Body
To create the snapshot, send the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
amazonAccountId | string($uuid) | Specifies an IAM role whose permissions Veeam Backup for AWS will use to create a cloud-native snapshot. |
targetAmazonAccountIdToCopySnapshots | string($uuid) | [Applies to the Remote region snapshot mode] Specifies an IAM role that has permissions to store snapshots in the target AWS region. |
targetRegionIdToCopySnapshots | string($uuid) | [Applies to the Remote region snapshot mode] Specifies a target AWS region to store the created snapshot. |
encryptionKey | string | [Applies to the Remote region snapshot mode with encryption enabled] Specifies AWS Key Management Service (AWS KMS) customer master keys (CMK). |
additionalTags | array | [Applies when you want to assign custom tags] Specifies a tag key (key parameter) and value for each custom tag (value parameter). |
copyTagsFromVolumeEnabled | boolean | Defines whether to assign tags of EBS volumes attached to processed EC2 instances. The default value is false. |
Set the parameter values in the following format:
{ "amazonAccountId": "string", "targetAmazonAccountIdToCopySnapshots": "string", "targetRegionIdToCopySnapshots": "string", "encryptionKey": "string", "additionalTags": [ { "key": "string", "value": "string" } ], "copyTagsFromVolumeEnabled": true/false } |
Response
The server returns the following response to the client.
Response Code
A successfully completed operation returns a response code 202 (Accepted).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTP headers.
Header | Value | Description |
---|---|---|
Content-Length | integer | Identifies the length of the response body message, in bytes. |
Content-Type |
| Identifies the media type of the response body message. |
Response Body
In the response body, Veeam Backup for AWS returns the session ID of the snapshot removal operation. For the session log details, see Get Session Log Details.
Example
The following request creates a cloud-native snapshot in the original location of an EC2 instance with the ID 89e29fe8-74fb-4d09-b03b-6f2a48d860ef, and assigns to the created snapshot tags of EBS volumes attached to the processed EC2 instance.
|