This is an archive version of the document. To get the most up-to-date information, see the current version.

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

  • application/json
  • application/problem+json

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

  • application/json
  • application/problem+json

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.

Create Snapshot of EC2 InstanceExample

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.

Request:

POST https://135.169.170.192:11005/api/v1/virtualMachines/89e29fe8-74fb-4d09-b03b-6f2a48d860ef/takeSnapshot

 

Request Header:

Authorization: Bearer <Access-Token>

x-api-version: 1.0-rev0

Content-Type: application/json

 

Request Body:

{

 "amazonAccountId": "eca01dcc-d324-4017-92cb-04ec240aaf0a",

 "copyTagsFromVolumeEnabled": true

}

 

Response:

201

 

Response Body:

{

 "sessionId": "1b1a25b9-1131-469a-914c-5318b0aa1b07",

 "_links": [

   {

     "method": "GET",

     "rel": "self",

     "href": "https://135.169.170.192:11005/api/v1/sessions/1b1a25b9-1131-469a-914c-5318b0aa1b07"

   }

 ]

}