Modifier un volume

Vous pouvez modifier les attributs d’un volume existant, qu’il s’agisse d’un volume système sur lequel le système d’exploitation de la machine virtuelle (VM) est installé, ou d’un volume secondaire de la VM. Cette action est disponible quel que soit l’état du volume ou le système d’exploitation (OS) de la VM qui y est attaché.

Vous pouvez utiliser cette action pour augmenter la capacité de stockage du volume, changer son type ou mettre à jour le nombre d’IOPS (input output per second).

Modifier un volume avec Cockpit

  1. Dans le dashboard Volumes, placez le curseur de la souris sur le rang du volume que vous voulez modifier, et cliquez sur l’icône IconUpdateVolume.
    La boîte de dialogue MODIFIER UN VOLUME apparaît.

  2. Dans la liste Type, sélectionnez un type de volume :

    • standard pour un volume Magnetic

    • io1 pour un volume Enterprise

    • gp2 pour un volume Performance

    Pour en savoir plus sur les différents types de volumes, voir À propos des volumes > Types de volumes et IOPS.

  3. Dans le champ Taille, tapez la taille du volume.

    La taille minimale autorisée pour un volume est de :

    • 1 Gio pour standard

    • 1 Gio pour gp2

    • 4 Gio pour io1

    La taille maximale autorisée pour un volume est 14901 Gio.

  4. (Volumes io1 uniquement) Dans le champ IOPS, tapez le nombre d’IOPS pour le volume ou sélectionnez-le en utilisant les flèches.

    Le nombre maximal d’IOPS autorisé pour les volumes io1 est 13000 avec un ratio de performance maximum de 300 IOPS par gibioctet.

  5. Cliquez sur Modifier.
    Le volume est modifié.

Modifier un volume avec OSC CLI

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

The UpdateVolume command modifies the specified attributes of a volume.

  • Do not shut down or restart the virtual machine (VM) from within the guest operating system while a volume update is in progress. This interrupts the process and compromises the integrity of the volume.

  • When the modification is not instantaneous, the response displays the previous value. You can use the ReadVolumeUpdateTasks method to see the progression of the update.

Request sample: Updating the size of a volume
$ osc-cli api UpdateVolume --profile "default" \
    --VolumeId "vol-12345678" \
    --Size 50
Request sample: Updating the type of a volume to io1
$ osc-cli api UpdateVolume --profile "default" \
    --VolumeId "vol-12345678" \
    --VolumeType "io1" \
    --Iops 200

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.

  • Iops: (optional) The new number of I/O operations per second (IOPS). This parameter can be specified only if you update an io1 volume or if you change the type of the volume for an io1.

  • Size: (optional) The new size of the volume, in gibibytes (GiB). This value must be equal to or greater than the current size of the volume. This modification is not instantaneous.

  • VolumeId: The ID of the volume you want to update.

  • VolumeType: (optional) The new type of the volume (standard | io1 | gp2). If you update to an io1 volume, you must also specify the Iops parameter.

The UpdateVolume command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • Volume: Information about the volume.

    • ClientToken: The idempotency token provided when creating the volume.

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

    • Iops: The number of I/O operations per second (IOPS):

      • For io1 volumes, the number of provisioned IOPS

      • For gp2 volumes, the baseline performance of the volume

    • LinkedVolumes: Information about your volume attachment.

      • DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM.

      • DeviceName: The name of the device.

      • State: The state of the attachment of the volume (attaching | detaching | attached | detached).

      • VmId: The ID of the VM.

      • VolumeId: The ID of the volume.

    • Size: The size of the volume, in gibibytes (GiB).

    • SnapshotId: The snapshot from which the volume was created.

    • State: The state of the volume (creating | available | in-use | deleting | error).

    • SubregionName: The Subregion in which the volume was created.

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

      • 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 volume update task in progress. Otherwise, it is not returned.

    • VolumeId: The ID of the volume.

    • VolumeType: The type of the volume (standard | gp2 | io1).

Result sample: Updating the size of a volume
{
  "Volume": {
    "VolumeId": "vol-12345678",
    "Tags": [],
    "VolumeType": "gp2",
    "SubregionName": "eu-west-2a",
    "State": "available",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "Iops": 100,
    "LinkedVolumes": [],
    "Size": 10,
    "TaskId": "vol-update-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}
Result sample: Updating the type of a volume to io1
{
  "Volume": {
    "VolumeId": "vol-12345678",
    "Tags": [],
    "VolumeType": "io1",
    "SubregionName": "eu-west-2a",
    "State": "available",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "Iops": 200,
    "LinkedVolumes": [],
    "Size": 10,
    "TaskId": "vol-update-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Modifier un volume avec oapi-cli

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

The UpdateVolume command modifies the specified attributes of a volume.

  • Do not shut down or restart the virtual machine (VM) from within the guest operating system while a volume update is in progress. This interrupts the process and compromises the integrity of the volume.

  • When the modification is not instantaneous, the response displays the previous value. You can use the ReadVolumeUpdateTasks method to see the progression of the update.

Request sample: Updating the size of a volume
$ oapi-cli --profile "default" UpdateVolume \
    --VolumeId "vol-12345678" \
    --Size 50
Request sample: Updating the type of a volume to io1
$ oapi-cli --profile "default" UpdateVolume \
    --VolumeId "vol-12345678" \
    --VolumeType "io1" \
    --Iops 200

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.

  • Iops: (optional) The new number of I/O operations per second (IOPS). This parameter can be specified only if you update an io1 volume or if you change the type of the volume for an io1.

  • Size: (optional) The new size of the volume, in gibibytes (GiB). This value must be equal to or greater than the current size of the volume. This modification is not instantaneous.

  • VolumeId: The ID of the volume you want to update.

  • VolumeType: (optional) The new type of the volume (standard | io1 | gp2). If you update to an io1 volume, you must also specify the Iops parameter.

The UpdateVolume command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

  • Volume: Information about the volume.

    • ClientToken: The idempotency token provided when creating the volume.

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

    • Iops: The number of I/O operations per second (IOPS):

      • For io1 volumes, the number of provisioned IOPS

      • For gp2 volumes, the baseline performance of the volume

    • LinkedVolumes: Information about your volume attachment.

      • DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM.

      • DeviceName: The name of the device.

      • State: The state of the attachment of the volume (attaching | detaching | attached | detached).

      • VmId: The ID of the VM.

      • VolumeId: The ID of the volume.

    • Size: The size of the volume, in gibibytes (GiB).

    • SnapshotId: The snapshot from which the volume was created.

    • State: The state of the volume (creating | available | in-use | deleting | error).

    • SubregionName: The Subregion in which the volume was created.

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

      • 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 volume update task in progress. Otherwise, it is not returned.

    • VolumeId: The ID of the volume.

    • VolumeType: The type of the volume (standard | gp2 | io1).

Result sample: Updating the size of a volume
{
  "Volume": {
    "VolumeId": "vol-12345678",
    "Tags": [],
    "VolumeType": "gp2",
    "SubregionName": "eu-west-2a",
    "State": "available",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "Iops": 100,
    "LinkedVolumes": [],
    "Size": 10,
    "TaskId": "vol-update-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}
Result sample: Updating the type of a volume to io1
{
  "Volume": {
    "VolumeId": "vol-12345678",
    "Tags": [],
    "VolumeType": "io1",
    "SubregionName": "eu-west-2a",
    "State": "available",
    "CreationDate": "2010-10-01T12:34:56.789Z",
    "Iops": 200,
    "LinkedVolumes": [],
    "Size": 10,
    "TaskId": "vol-update-12345678"
  },
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Pages connexes

Méthode API correspondante