Copier un snapshot dans la même Région

Vous pouvez copier un snapshot dans votre compte, ou dans un compte situé dans la même Région pour lequel vous avez les permissions appropriées.

La copie du snapshot vous appartient, est indépendante du snapshot source et a son propre ID. Vous pouvez créer des volumes ou des OUTSCALE Machine Images (OMI) à partir de cette copie, la partager avec d’autres comptes ou la supprimer.

Pour créer une sauvegarde d’un snapshot dans un bucket OUTSCALE Object Storage (OOS), voir Exporter un snapshot sur un bucket. Pour copier un snapshot entre des comptes de Régions différentes, voir Tutoriel : Copier un snapshot dans une Région différente.

Copier un snapshot dans la même Région avec OSC CLI

Avant de commencer : Le propriétaire de l’autre compte doit vous accorder les permissions d’accéder et de copier le snapshot. Pour en savoir plus, voir Gérer les permissions pour un snapshot.

À ce jour, cette section est disponible en anglais uniquement.

The CreateSnapshot command creates a snapshot. Snapshots are point-in-time images of a volume that you can use to back up your data or to create replicas of this volume.
You can use this method in three different ways:

  • Creating from a volume: You create a snapshot from one of your volumes.

  • Copying a snapshot: You copy an existing snapshot. The source snapshot can be one of your own snapshots, or a snapshot owned by another account that has granted you permission via the UpdateSnapshot method.

  • Importing from a bucket: You import a snapshot located in an OUTSCALE Object Storage (OOS) bucket. First, the owner of the source snapshot must export it to a bucket by using the CreateSnapshotExportTask method. Then, they must grant you permission to read the snapshot via a pre-signed URL. For more information, see Creating a Pre-Signed URL.

In case of excessive use of the snapshot creation feature on the same volume over a short period of time, 3DS OUTSCALE reserves the right to temporarily block the feature.

For more information, see About Snapshots.

Request sample: Copying a snapshot
$ osc-cli api CreateSnapshot --profile "default" \
    --SourceSnapshotId "snap-12345678" \
    --SourceRegionName "eu-west-2" \
    --Description "Snapshot created from another snapshot"

This command contains the following attributes that you need to specify:

  • Description: (optional) A description for the snapshot.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • SourceRegionName: (optional) (when copying a snapshot) The name of the source Region, which must be the same as the Region of your account.

  • SourceSnapshotId: (optional) (when copying a snapshot) The ID of the snapshot you want to copy.

The CreateSnapshot command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • Snapshot: Information about the snapshot.

    • AccountAlias: The account alias of the owner of the snapshot.

    • AccountId: The account ID of the owner of the snapshot.

    • CreationDate: The date and time (UTC) at which the snapshot was created.

    • Description: The description of the snapshot.

    • PermissionsToCreateVolume: Permissions for the resource.

      • AccountIds: One or more account IDs that the permission is associated with.

      • GlobalPermission: A global permission for all accounts.
        (Request) Set this parameter to true to make the resource public (if the parent parameter is Additions) or to make the resource private (if the parent parameter is Removals).
        (Response) If true, the resource is public. If false, the resource is private.

    • Progress: The progress of the snapshot, as a percentage.

    • SnapshotId: The ID of the snapshot.

    • State: The state of the snapshot (in-queue | pending | completed | error | deleting)).

    • Tags: One or more tags associated with the snapshot.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • VolumeId: The ID of the volume used to create the snapshot.

    • VolumeSize: The size of the volume used to create the snapshot, in gibibytes (GiB).

Result sample: Copying a snapshot
{
  "Snapshot": {
    "VolumeSize": 10,
    "AccountId": "123456789012",
    "VolumeId": "vol-12345678",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "PermissionsToCreateVolume": {
      "GlobalPermission": false,
      "AccountIds": []
    },
    "Progress": 100,
    "SnapshotId": "snap-12345678",
    "State": "completed",
    "Description": "Snapshot copied from another snapshot",
    "Tags": []
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Copier un snapshot dans la même Région avec oapi-cli

Avant de commencer : Le propriétaire de l’autre compte doit vous accorder les permissions d’accéder et de copier le snapshot. Pour en savoir plus, voir Gérer les permissions pour un snapshot.

À ce jour, cette section est disponible en anglais uniquement.

The CreateSnapshot command creates a snapshot. Snapshots are point-in-time images of a volume that you can use to back up your data or to create replicas of this volume.
You can use this method in three different ways:

  • Creating from a volume: You create a snapshot from one of your volumes.

  • Copying a snapshot: You copy an existing snapshot. The source snapshot can be one of your own snapshots, or a snapshot owned by another account that has granted you permission via the UpdateSnapshot method.

  • Importing from a bucket: You import a snapshot located in an OUTSCALE Object Storage (OOS) bucket. First, the owner of the source snapshot must export it to a bucket by using the CreateSnapshotExportTask method. Then, they must grant you permission to read the snapshot via a pre-signed URL. For more information, see Creating a Pre-Signed URL.

In case of excessive use of the snapshot creation feature on the same volume over a short period of time, 3DS OUTSCALE reserves the right to temporarily block the feature.

For more information, see About Snapshots.

Request sample: Copying a snapshot
$ oapi-cli --profile "default" CreateSnapshot \
    --SourceSnapshotId "snap-12345678" \
    --SourceRegionName "eu-west-2" \
    --Description "Snapshot created from another snapshot"

This command contains the following attributes that you need to specify:

  • Description: (optional) A description for the snapshot.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • SourceRegionName: (optional) (when copying a snapshot) The name of the source Region, which must be the same as the Region of your account.

  • SourceSnapshotId: (optional) (when copying a snapshot) The ID of the snapshot you want to copy.

The CreateSnapshot command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • Snapshot: Information about the snapshot.

    • AccountAlias: The account alias of the owner of the snapshot.

    • AccountId: The account ID of the owner of the snapshot.

    • CreationDate: The date and time (UTC) at which the snapshot was created.

    • Description: The description of the snapshot.

    • PermissionsToCreateVolume: Permissions for the resource.

      • AccountIds: One or more account IDs that the permission is associated with.

      • GlobalPermission: A global permission for all accounts.
        (Request) Set this parameter to true to make the resource public (if the parent parameter is Additions) or to make the resource private (if the parent parameter is Removals).
        (Response) If true, the resource is public. If false, the resource is private.

    • Progress: The progress of the snapshot, as a percentage.

    • SnapshotId: The ID of the snapshot.

    • State: The state of the snapshot (in-queue | pending | completed | error | deleting)).

    • Tags: One or more tags associated with the snapshot.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • VolumeId: The ID of the volume used to create the snapshot.

    • VolumeSize: The size of the volume used to create the snapshot, in gibibytes (GiB).

Result sample: Copying a snapshot
{
  "Snapshot": {
    "VolumeSize": 10,
    "AccountId": "123456789012",
    "VolumeId": "vol-12345678",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "PermissionsToCreateVolume": {
      "GlobalPermission": false,
      "AccountIds": []
    },
    "Progress": 100,
    "SnapshotId": "snap-12345678",
    "State": "completed",
    "Description": "Snapshot copied from another snapshot",
    "Tags": []
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Copier un snapshot dans la même Région avec AWS CLI

Avant de commencer :

Pour copier un snapshot dans votre compte, utilisez la commande copy-snapshot en suivant cette syntaxe :

Exemple de requête
$ aws ec2 copy-snapshot \
    --profile YOUR_PROFILE \
    --source-region eu-west-2 \
    --source-snapshot-id snap-12345678 \
    --destination-region eu-west-2 \
    --description snapshot of vol-87654321 \
    --endpoint https://fcu.eu-west-2.outscale.com

Cette commande contient les attributs suivants que vous devez spécifier :

  • (optionnel) profile : Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

  • source-region : Le nom de la Région dans laquelle se trouve le snapshot que vous voulez copier.

  • source-snapshot-id : L’ID du snapshot que vous voulez copier.

  • destination-region : Le nom de la Région de destination, qui doit être la même que la Région source.

  • (optionnel) description : Une description pour la copie du snapshot (si différent du snapshot source).

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

La commande copy-snapshot renvoie l’élément suivant :

  • SnapshotId : L’ID de la copie du snapshot.

Exemple de résultat
{
"SnapshotId": "snap-87654321"
}

Le snapshot est copié dans le compte spécifié.

Pages connexes

Méthodes API correspondantes

AWS™ et Amazon Web Services™ sont des marques de commerce d'Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.