Substitui o sistema operacional de uma instância ECS ao substituir seu disco do sistema. Após a substituição, o ID do disco do sistema é alterado e o disco original é liberado.
Descrição da operação
Antes de chamar esta operação, leia atentamente Substituir o disco do sistema (substituir o sistema operacional).
Ao substituir o disco do sistema, observe o seguinte:
-
Você não pode alterar o método de faturamento do disco do sistema.
-
Você não pode alterar o tipo de disco do disco do sistema.
-
A instância ECS à qual o disco do sistema está anexado não deve ter pedidos não pagos.
-
A instância deve estar no estado Parada (
Stopped).NotaIsso se aplica apenas a instâncias do tipo VPC. Se a instância ECS usar o método de faturamento pay-as-you-go e o modo econômico estiver ativado por padrão, defina a instância para o modo de parada padrão ao pará-la. Isso evita que a instância falhe ao reiniciar após a substituição do disco do sistema devido a estoque insuficiente de instâncias ECS na região. Para mais informações, consulte StopInstance.
-
Você pode usar o parâmetro
SystemDisk.Sizepara especificar uma nova capacidade para o disco do sistema. A nova capacidade não pode ser menor que a capacidade original. -
Se a instância ECS estiver bloqueada por segurança, o que significa que o parâmetro
OperationLocksda instância contém"LockReason": "security", a substituição do disco do sistema não é suportada. Para mais informações, consulte Comportamento da API quando uma instância é bloqueada por motivos de segurança.
Após substituir o disco do sistema, chame DescribeInstances para consultar o status da instância e verificar se a substituição foi bem-sucedida. Se o valor OperationLocks retornado estiver vazio, a substituição do disco do sistema estará concluída.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
ecs:ReplaceSystemDisk |
update |
Disco.
Imagem.
*Instância.
|
|
Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| InstanceId |
string |
Sim |
O ID da instância de destino. Nota
Certifique-se de que a instância de destino esteja no status de instância Stopped antes de enviar a solicitação. |
i-bp67acfmxazb4ph**** |
| ImageId |
string |
Não |
O ID da imagem a ser usada ao redefinir o disco do sistema. Este parâmetro é obrigatório. |
m-bp67acfmxazb4ph**** |
| SystemDisk.Size |
integer |
Não |
A nova capacidade do disco do sistema. Unidade: GiB. Valores válidos:
Valor padrão: Max{40, tamanho da imagem especificado pelo parâmetro ImageId}. Nota
A capacidade do disco que excede Max{20, capacidade original do disco do sistema} incorre em cobranças adicionais. |
80 |
| ClientToken |
string |
Não |
O token de cliente usado para garantir a idempotência da solicitação. Você pode usar o cliente para gerar o token, mas deve garantir que o token seja único entre diferentes solicitações. O ClientToken pode conter apenas caracteres ASCII e não pode exceder 64 caracteres de comprimento. Para mais informações, consulte Como garantir a idempotência. |
123e4567-e89b-12d3-a456-426655440000 |
| UseAdditionalService |
boolean |
Não |
Especifica se devem ser usadas as configurações do sistema da máquina virtual fornecidas pelo Alibaba Cloud (Windows: NTP e KMS. Linux: NTP e YUM). Nota
Este parâmetro só entra em vigor quando o disco do sistema está anexado (ou seja, o nome do dispositivo é /dev/xvda). |
true |
| Password |
string |
Não |
Especifica se a senha da instância ECS deve ser redefinida. A senha deve ter de 8 a 30 caracteres e deve conter pelo menos três dos seguintes tipos de caracteres: letras maiúsculas, letras minúsculas, dígitos e caracteres especiais. Os seguintes caracteres especiais são suportados:
Para instâncias Windows, a senha não pode começar com uma barra (/). Valor padrão: A senha permanece inalterada. Nota
Se você especificar o parâmetro Password, use HTTPS para enviar a solicitação e evitar vazamentos de senha. |
EcsV587! |
| PasswordInherit |
boolean |
Não |
Especifica se a senha predefinida da imagem deve ser usada. Valor padrão: false. Nota
Se você usar este parâmetro, o parâmetro Password deve estar vazio. Certifique-se de que a imagem usada tenha uma senha predefinida. |
false |
| KeyPairName |
string |
Não |
O nome do par de chaves. Nota
Este parâmetro se aplica apenas a instâncias ECS Linux. Você pode vincular um par de chaves SSH a uma instância ECS como credencial de login. Após a vinculação de um par de chaves SSH, o login baseado em nome de usuário e senha é desativado. |
testKeyPairName |
| DiskId |
string |
Não |
Nota
[Deprecated] Este parâmetro foi descontinuado. Para melhorar a compatibilidade, use ImageId em seu lugar. |
d-bp67acfmxazb4ph**** |
| Platform |
string |
Não |
Nota
[Deprecated] Este parâmetro foi descontinuado. |
CentOS |
| Architecture |
string |
Não |
Nota
[Deprecated] Este parâmetro foi descontinuado. |
i386 |
| SecurityEnhancementStrategy |
string |
Não |
Especifica se o Security Center deve ser usado gratuitamente após a substituição do disco do sistema. Valores válidos:
Valor padrão: Deactive. |
Active |
| Encrypted |
boolean |
Não |
Especifica se o disco deve ser criptografado. Valores válidos:
Valor padrão: false. Importante Ao usar uma imagem criptografada compartilhada para criar um disco com base em um snapshot criptografado, você deve definir o parâmetro de solicitação Encrypted=true para o disco, a fim de garantir que o disco use a chave da conta que recebe a imagem compartilhada. |
false |
| KMSKeyId |
string |
Não |
O ID da chave KMS do disco do sistema. |
e522b26d-abf6-4e0d-b5da-04b7******3c |
| EncryptAlgorithm |
string |
Não |
Nota
Este parâmetro não está disponível para uso. |
hide |
| Arn |
array<object> |
Não |
Este parâmetro não está disponível para uso. |
|
|
object |
Não |
|||
| AssumeRoleFor |
integer |
Não |
Nota
Este parâmetro não está disponível para uso. |
0 |
| RoleType |
string |
Não |
Nota
Este parâmetro não está disponível para uso. |
null |
| Rolearn |
string |
Não |
Nota
Este parâmetro não está disponível para uso. |
null |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| DiskId |
string |
O ID do novo disco do sistema. |
d-bp67acfmxazb4ph**** |
| RequestId |
string |
O ID da solicitação. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Exemplos
Resposta de sucesso
JSON formato
{
"DiskId": "d-bp67acfmxazb4ph****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | LoginAsNonRoot.ImageNotSupport | The specified image does not support login as non-root. | Esta imagem não oferece suporte a logon não root. |
| 400 | InvalidSystemDiskSize.ValueNotSupported | The specified parameter SystemDisk.Size is invalid. | |
| 400 | InvalidParameter.Conflict | The specified image does not support the specified instance type. | Os parâmetros estão em conflito. |
| 400 | InvalidSystemDiskSize.ImageNotSupportResize | The specified image does not support resize. | A imagem especificada não oferece suporte a redimensionamento. |
| 400 | InvalidSystemDiskSize | The specified parameter SystemDisk.Size is invalid. | |
| 400 | InvalidPassword.Malformed | The specified parameter "Password" is not valid. | O parâmetro Password especificado é inválido. |
| 400 | InvalidPasswordParam.Mismatch | The input password should be null when passwdInherit is true. | Quando o PasswdInherit está ativado, o nome de usuário e a senha devem estar vazios. |
| 400 | OperationDenied | The specified image contains the snapshot of the data disk. This operation is not supported. | |
| 400 | InvalidDiskCategory.ValueNotSupported | The specified parameter "DiskCategory" is not valid. | O tipo de disco do sistema e o tipo de disco de dados especificados não são suportados. |
| 400 | InvalidKeyPairName.NotFound | The specified KeyPairName does not exist. | O KeyPairName especificado não existe. |
| 400 | DependencyViolation.IoOptimize | The specified parameter InstanceId is not valid. | O ID da instância especificado é inválido ou a configuração de otimização de E/S da instância especificada é inválida. |
| 400 | MissingParameter.Architecture | Architecture should not be null. | O parâmetro Architecture não pode estar vazio. |
| 400 | InvalidArchitecture.Malformed | Architecture is not valid. | O formato do parâmetro Architecture é inválido. |
| 400 | MissingParameter.Platform | Platform should not be null. | O parâmetro Platform não pode estar vazio. |
| 400 | InvalidPlatform.Malformed | Platform is not valid. | A distribuição do sistema operacional da imagem especificada é inválida. |
| 400 | InvalidDiskId.NotFound | The specified disk do not exist. | O disco especificado não existe. Verifique se o ID do disco está correto. |
| 400 | InvalidDatadisk.DiskStatusViolation | The operation is not permitted due to status of the Datadisk. | O estado atual do disco de dados em nuvem não oferece suporte a esta operação. |
| 400 | InvalidDatadisk.DiskCategoryViolation | The operation is not permitted due to category of the Datadisk. | O tipo de disco de dados em nuvem não oferece suporte a esta operação. |
| 400 | InvalidDatadisk.ChargeTypeViolation | The operation is not permitted due to charge type of the Datadisk. | |
| 400 | MissingParameter | The input parameter "ImageId" that is mandatory for processing this request is not supplied. | |
| 400 | InvalidInstance.NotFoundSystemDisk | The specified instance has no system disk. | A instância especificada não possui um disco do sistema anexado. Certifique-se de que a instância especificada tenha um disco do sistema anexado. Você pode chamar DescribeInstances para consultar as informações da instância especificada. |
| 400 | InvalidParameter.DiskType | The specified disk type which has kms key can't convert to system disk. | |
| 400 | DISK_IN_DEDICATED_BLOCK_STORAGE_CLUSTER | The disk in dedicated block storage cluster is not allowed to do this operation. | |
| 400 | IncorrectDiskStatus.ReplicationStatusNotFound | Disk replication status not found. | |
| 400 | IncorrectDiskStatus.InReplication | Disk already in replication. | |
| 400 | InvalidInstanceType.NotSupported | The specified instanceType is not supported by the image architecture. | O tipo de instância especificado não é suportado. |
| 400 | InvalidRegionId.NotSupportReplaceEncryptedSystemDisk | The specified region not support replace encrypted system disk. | |
| 400 | InvalidStorageClusterId.CapacityNotEnough | The remaining capacity of the current dedicated storage cluster is less than the size of disk. | A capacidade disponível do cluster de armazenamento dedicado no qual o disco reside é insuficiente. |
| 400 | QuotaExceed.DiskCapacity | The used capacity of disk type has exceeded the quota in the zone, %s. | A capacidade utilizada do tipo de disco especificado excede o limite de cota da zona. Acesse o Quota Center para consultar e solicitar um aumento na cota de capacidade do disco. |
| 400 | AccountForbidden.ProductCreationLimited | The commodity must be officially operated by Aliyun and in pay-as-you-go billing method. | Os clientes de migração de nuvem corporativa podem comprar apenas instâncias ECS pagas conforme o uso e não podem comprar produtos de terceiros, como imagens fornecidas pelo Alibaba Cloud Marketplace. Verifique os parâmetros e tente novamente com parâmetros válidos. |
| 400 | InternalError | The requested services is not available now. Please try again later. | Ocorreu um erro interno. Tente novamente. |
| 400 | InvalidDiskName.Malformed | The specified parameter "SyatemDisk.DiskName or DataDisk.n.DiskName" is not valid. | O formato do nome do disco é inválido. O nome deve ter de 2 a 128 caracteres e deve começar com uma letra ou um caractere chinês. Pode conter dígitos, pontos (.), sublinhados (_) ou hifens (-). Não pode começar com http:// ou https://. |
| 400 | InvalidParameter.Encrypted | Creating non-encrypted disks from encrypted snapshots is not allowed. Please set Encrypted to true or use an unencrypted snapshot. | |
| 400 | InvalidParam.EncryptedMismatch | Creating a disk from a shared encrypted image requires encryption with your own KMS key. Please set the Encrypted parameter to true. | |
| 500 | OperationDenied | Internal Error. | |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | LoginAsNonRoot.RegionNotSupport | The specified region does not support login as non-root. | |
| 403 | InvalidSystemDiskStatus.IsTransfering | The current status of the resource does not support this operation. The system disk is transferring. | |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 403 | IncorrectInstanceStatus | The instance must be in the Stopped state when you replace the system disk. Please stop the instance and try again. | |
| 403 | InstanceLockedForSecurity | The instance is locked due to security. | A instância à qual o disco está anexado está bloqueada por motivos de segurança. |
| 403 | ImageNotSubscribed | The specified image has not be subscribed. | |
| 403 | ImageRemovedInMarket | The specified marketplace image is not available. Or the specified user-defined image includes a product code because it is based on an image subscribed from the marketplace; and that marketplace image including the exact same product code has been removed. | |
| 403 | InstanceExpiredOrInArrears | The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). | |
| 403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | |
| 403 | DiskCreatingSnapshot | The operation is denied due to a snapshot of the specified disk is not completed yet. | |
| 403 | IoOptimized.NotSupported | The specified image does not support IoOptimized instances. | |
| 403 | OperationDenied.ImageNotValid | The specified marketplace image is not authorized. Please verify the marketplace image authorization and try again. | |
| 403 | ImageNotSupportInstanceType | The specified image don not support the InstanceType instance. | |
| 403 | QuotaExceed.BuyImage | The specified image is from the image market. You have not bought it or your quota has been exceeded. | |
| 403 | INST_HAS_UNPAID_ORDER | The instance has unpaid order. | |
| 403 | OperationDenied.InstanceCreating | The specified instance is creating. | |
| 403 | DependencyViolation.WindowsInstance | The instance runs Windows and does not support SSH key pair login. | |
| 403 | InvalidParameter.NotMatch | %s | O parâmetro especificado é inválido. Verifique se os parâmetros estão em conflito entre si. |
| 403 | ResourcesNotInSameZone | The specified instance and disk are not in the same zone. | |
| 403 | OperationDenied.UnpaidOrder | The specified instance has unpaid order. | Já existe um pedido não pago para o ID da instância especificado. Você pode fazer login no console do ECS para concluir o pagamento. |
| 403 | InvalidHostname.MismatchImage | The hostname of the current instance can not be applied to the image you choose. | |
| 403 | HibernationConfigured.InstanceOperationForbidden | The operation is not permitted due to limit of the hibernation configured instance. | A operação não é permitida porque a instância não atende aos requisitos para ativar a opção de hibernação. |
| 403 | InvalidOperation.MultiAttachDisk | Multi attach disk does not support this operation. | Esta operação não é suportada para discos com multi-attach ativado. |
| 403 | InvalidRegionId.NotSupportEncryptAlgorithm | The current region does not support creating encrypted disks with EncryptAlgorithm. | |
| 403 | InvalidRegionId.NotExists | The region not exists. | |
| 403 | InvalidEncryptAlgorithm | The specified EncryptAlgorithm is not valid. Ensure the value is a supported encryption algorithm such as AES-256. | |
| 403 | InvalidEncrypted.NotMatchKmsKeyId | The Encrypted parameter must be set to true when KMSKeyId is specified. Please adjust the parameters and try again. | |
| 403 | InvalidEncrypted.NotMatchEncryptAlgorithm | The Encrypted parameter must be set to true when EncryptAlgorithm is specified. Please adjust the parameters and try again. | |
| 403 | InvalidParameter.KmsNotEnabled | The specified operation need enable KMS. | |
| 403 | InvalidParameter.DataEncryptedKeyCreateFailed | The ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again. | |
| 403 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service. | |
| 403 | InvalidKMSKeyId.NotSymmetric | The specified KMSKeyId must be a symmetric key. Please use a symmetric KMS key such as an AES-256 key. | |
| 403 | InvalidDiskId.NotSupportReplaceEncryptedSystemDisk | The specified diskId not support replace encrypted system disk. | |
| 403 | NotSupportSnapshotEncrypted.DiskCategory | The specified disk category does not support re-encrypting a disk with a new KMSKeyId from a snapshot. Please use a disk category that supports encryption such as cloud_essd. | |
| 403 | InvalidParameter.AllEmpty | The current operation does not allow both diskId and imageId to be empty. Make sure that either diskId or imageId is not empty. | Nenhum parâmetro foi especificado. Especifique os parâmetros obrigatórios. |
| 403 | InvalidParameter.Conflict | The current operation does not allow both diskId and imageId to be set. Make sure that either diskId or imageId is not empty. | Os parâmetros estão em conflito. |
| 403 | OperationDenied | The current region does not support changing the image type. | O snapshot especificado não permite a criação de volumes de dados. |
| 403 | OperationDenied.DiskNoStock | The requested disk category is sold out in the specified zone. Please try a different disk category or another zone. | O tipo de disco especificado está esgotado na zona especificada. Use um tipo de disco ou zona diferente e tente novamente. |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The specified KMS key must be in an enabled state. Please enable the key in the KMS console and try again. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The specified KMS key is not authorized for the ECS service. Please grant the ECS service permission to use the key in the KMS console and try again. | |
| 403 | InvalidEncrypted.NotMatchSnapshot | The Encrypted parameter must be set to true when creating disks from encrypted snapshots. Please set Encrypted to true or use an unencrypted snapshot. | |
| 403 | InvalidEncrypted.NotMatchDiskDefaultEncryption | The operation failed because default disk encryption is enforced on your account. Please set the Encrypted parameter to true. | |
| 403 | InvalidPayMethod.SyncPaymentNotSupport | Synchronous payment is not supported. Use another payment method. | O pagamento automático não é suportado no status atual. Defina o parâmetro AutoPay para um método de pagamento diferente. |
| 403 | InvalidOperation.ImageSecureBootUnsupported | The image does not support secure boot. | A imagem não oferece suporte ao Secure Boot. |
| 403 | InvalidDiskCategory.NotSupported | The disk category is not supported in the current zone. Please call DescribeAvailableResource to check supported categories. | |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 403 | InvalidOperation.TargetImageIncompatible | The source image cannot be replaced by the target image. | A imagem de destino especificada não pode substituir a imagem atual. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | A instância especificada não existe. Verifique se o ID da instância está correto. |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | A imagem especificada não existe nesta conta. Verifique se o ID da imagem está correto. |
| 404 | InvalidSystemDiskSize.MoreThanMaxSize | The specified SystemDisk.Size parameter exceeds the maximum size. | |
| 404 | InvalidSystemDiskSize.LessThanImageSize | The specified parameter SystemDisk.Size is less than the image size. | |
| 404 | InvalidSystemDiskSize.LessThanMinSize | The specified parameter SystemDisk.Size is less than the min size. | |
| 404 | NoSuchResource | The specified resource is not found. | O recurso especificado não existe. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.