Détache un disque de données postpayé ou un disque système d'une instance Elastic Compute Service (ECS).
Description de l'opération
Prenez note des éléments suivants :
-
Cette opération est asynchrone. Après l'appel de cette opération pour détacher un disque d'une instance ECS, le disque est détaché au bout d'environ 1 minute.
-
Si OperationLocks dans la réponse contient "LockReason" : "security" lorsque vous consultez les informations d'une instance, l'instance est verrouillée pour des raisons de sécurité et toute opération est interdite sur l'instance.
-
Si vous souhaitez attacher un disque éphémère élastique que vous avez détaché d'une instance, vous ne pouvez attacher le disque qu'à cette instance.
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
ecs:DetachDisk |
update |
*Disk
*Instance
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| InstanceId |
string |
Oui |
L'identifiant de l'instance ECS à partir de laquelle vous souhaitez détacher le disque. |
i-bp67acfmxazb4p**** |
| DiskId |
string |
Oui |
L'identifiant du disque que vous souhaitez détacher.
|
d-bp67acfmxazb4p**** |
| DeleteWithInstance |
boolean |
Non |
Indique si le disque système ou le disque de données doit être libéré lorsque l'instance à partir de laquelle vous souhaitez détacher le disque est libérée. Valeurs valides :
Valeur par défaut : true. Prenez note des éléments suivants :
|
false |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
|||
| RequestId |
string |
L'identifiant de la requête. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemples
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The input parameter is mandatory for processing this request is empty. | A required parameter is not specified. |
| 400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | |
| 400 | InvalidOperation.InstanceTypeNotSupport | The instance type of the specified instance does not support hot detach disk. | The instance to which the disk is attached does not support disk hot swapping. |
| 400 | DisksDetachingOnEcsExceeded | The number of disks detaching on the instance exceeds the limit. | The number of disks being unmounted on the instance exceeds the limit |
| 400 | InvalidInstanceId.Malformed | The specified parameter InstanceId is not valid. | The specified InstanceId parameter is invalid. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 403 | DiskNotPortable | The specified disk is not a portable disk. | |
| 403 | InstanceLockedForSecurity | The instance is locked due to security. | The operation is not supported while the instance is locked for security reasons. |
| 403 | DependencyViolation | The specified disk has not been attached on the specified instance. | |
| 403 | DiskTypeViolation | The specified disk is a system disk and cannot support the operation. | The specified disk is a system disk and cannot be detached. |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | UserNotInTheWhiteList | The user is not in disk white list. | You are not authorized to manage the disk. Try again when you are authorized. |
| 403 | InvalidInstance.ImageCategory | The image category of the specified instance does not support detaching system disk. | The specified system disk cannot be detached from the instance while the image of the instance is in the current state. Possible cause: The image that was used to create the instance has been deleted. |
| 403 | DeleteWithInstance.Conflict | Multi attach disk cannot be set to DeleteWithInstance attribute. | Disks for which the multi-attach feature is enabled do not support the DeleteWithInstance attribute. |
| 403 | InvalidOperation.DiskCategoryUnsupported | The DetachDisk operation is not supported for elastic ephemeral disk. | The DetachDisk operation is not supported for elastic ephemeral disk. |
| 403 | InvalidParameter.DeleteWithInstance | The DeleteWithInstance for the elastic ephemeral disk must be set to true. | The DeleteWithInstance for the elastic ephemeral disk must be set to true. |
| 403 | InvalidOperation.DiskDetachingFromThisEcs | The specified disk is detaching from this ecs. | The disk is being unmounted from the current instance. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
| 404 | InvalidDisk.AlreadyDetached | The specified disk has been detached. | |
| 404 | InvalidDiskId.OperationNotSupported | The operation is not supported due to base image not exist. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.