Exporter une OMI vers un bucket

Vous pouvez exporter une image machine OUTSCALE (OMI) vers un bucket OUTSCALE Object Storage (OOS) pour créer un backup ou pour permettre aux autres comptes de la même Région ou de Régions différentes de copier cette OMI.

Cette action crée dans le bucket les snapshots nécessaires ainsi qu’un fichier manifeste.

Avant d’exporter une OMI ou un snapshot vers une autre Région, assurez-vous que cette action est autorisée par toutes les licences tierces applicables. Si l’export est autorisé, seul l’export d’OMI garantit l’application des licences tierces dans la Région cible, alors que l’export de snapshot ne garantit pas leur application.

Exporter une image vers un bucket avec Cockpit v2

  1. Cliquez dans le dashboard Images pour faire apparaître des cases à cocher.

  2. Cochez la case de l’image que vous voulez exporter vers un bucket OOS.
    L’image est sélectionnée et un menu d’actions apparaît.

  3. Cliquez sur IconExport Exporter vers OOS.
    La boîte de dialogue EXPORTER L’IMAGE VERS UN BUCKET OOS apparaît.

  4. Spécifiez les informations pour l’export :

    1. Sélectionnez le format de l’export disk (QCOW2 ou RAW).

    2. Dans le champ Nom du bucket OOS, entrez le nom du bucket vers lequel vous voulez exporter l’image.

      Vous devez avoir les permissions d’écriture appropriées pour le bucket sur lequel vous voulez exporter l’image. Pour en savoir plus, voir Gérer les accès à vos buckets.

    3. (optionnel) Dans le champ Préfixe du bucket OOS, entrez un préfixe pour la copie de l’image dans le bucket OOS.
      Pour en savoir plus sur les préfixes, voir À propos d’OOS > Objets.

  5. Cliquez sur Exporter.
    L’image est exportée vers le bucket OOS. Pour vérifier l’état de la tâche d’export de l’image, voir Obtenir des informations sur une tâche d’export ou d’import d’OMI.

Exporter une OMI vers un bucket avec OSC CLI

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

The CreateImageExportTask command exports an OUTSCALE machine image (OMI) to an OUTSCALE Object Storage (OOS) bucket.
This enables you to copy an OMI between accounts in different Regions.

This action creates the necessary snapshots and manifest file in the bucket. The OMI can then be imported to another account using a pre-signed URL of its manifest file. For more information, see Creating a Pre-Signed URL.

To copy an OMI in the same Region, you can also use the CreateImage method.

You cannot export a shared or public OMI, as they do not belong to you. To do so, you must first copy it to your account. The copy then belongs to you and you can export it.

For more information, see About OMIs.

Request sample
$ osc-cli api CreateImageExportTask --profile "default" \
    --ImageId "ami-12345678" \
    --OsuExport '{
        "DiskImageFormat": "qcow2",
        "OsuBucket": "BUCKET",
        "OsuPrefix": "PREFIX",
      }'

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

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

  • ImageId: The ID of the OMI to export.

  • OsuExport: Information about the OOS export task to create.

    • DiskImageFormat: The format of the export disk (qcow2 | raw).

    • OsuApiKey: (optional) Information about the OOS API key.

      • ApiKeyId: (optional) The API key of the OOS account that enables you to access the bucket.

      • SecretKey: (optional) The secret key of the OOS account that enables you to access the bucket.

    • OsuBucket: The name of the OOS bucket where you want to export the object.

    • OsuManifestUrl: (optional) The URL of the manifest file.

    • OsuPrefix: (optional) The prefix for the key of the OOS object.

The CreateImageExportTask command returns the following elements:

  • ImageExportTask: Information about the OMI export task.

    • Comment: If the OMI export task fails, an error message appears.

    • ImageId: The ID of the OMI to be exported.

    • OsuExport: Information about the OMI export task.

      • DiskImageFormat: The format of the export disk (qcow2 | raw).

      • OsuBucket: The name of the OOS bucket the OMI is exported to.

      • OsuManifestUrl: The URL of the manifest file.

      • OsuPrefix: The prefix for the key of the OOS object corresponding to the image.

    • Progress: The progress of the OMI export task, as a percentage.

    • State: The state of the OMI export task (pending/queued | pending | completed | failed | cancelled).

    • Tags: One or more tags associated with the image export task.

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

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

    • TaskId: The ID of the OMI export task.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "ImageExportTask": {
    "Tags": [],
    "ImageId": "ami-12345678",
    "TaskId": "image-export-12345678",
    "Comment": "Export of image ami-12345678",
    "OsuExport": {
      "OsuPrefix": "PREFIX/ami-12345678/",
      "OsuBucket": "BUCKET",
      "DiskImageFormat": "qcow2"
    },
    "State": "pending/queued",
    "Progress": 0
  }
}

Pages connexes

Méthodes API correspondantes