Tüm Ürünler
Search
Belge Merkezi

:StopInstance

Son Güncelleme:Oct 02, 2026

Bir ECS örneğini durdurur. Örneği durdurmak için farklı kapatma yöntemleri, durdurma modları ve toplu işlem modları seçebilirsiniz.

Operation description

Bu işlem eşzamansızdır. Örnek hemen durdurulmaz. Başarılı bir çağrının ardından örnek önce Stopping durumuna geçer. Örnek durumunu sorgulamak için DescribeInstanceStatus API'sini çağırabilirsiniz. Döndürülen durum Stopped olduğunda, örnek başarıyla durdurulmuş olur.

Başlamadan önce

  • Güvenlik nedenleriyle kilitlenen örnekler bu işlem çağrılarak durdurulamaz. Daha fazla bilgi için Kaynak güvenlik kilidinin API çağrıları üzerindeki etkileri konusuna bakın.

  • VPC'deki örnekler için ekonomik modu etkinleştirdikten sonra, standart durdurma modunu etkinleştirmek üzere Ayarlar'da StoppedMode=KeepCharging yapılandırmasını yapabilirsiniz. ECS örneği durdurulduktan sonra faturalandırma devam eder ve ECS örnek türü stoku ile İnternet IP adresi korunur.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:StopInstance

update

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

Örnek kimliği.

i-bp67acfmxazb4ph****

ConfirmStop

boolean

No

Bu parametre kullanımdan kaldırılmıştır ve yalnızca uyumluluk amacıyla korunmuştur. Bu işlemi çağırırken bu parametreyi dikkate almayın.

true

ForceStop

boolean

No

Örneğin zorla durdurulup durdurulmayacağını belirtir. Geçerli değerler:

  • true: Örneği zorla durdurur. Bu, tipik bir güç kapatma işlemine eşdeğerdir. Depolama aygıtına yazılmamış tüm önbelleğe alınmış veriler kaybolur.

  • false: Örneği normal şekilde durdurur.

Varsayılan değer: false.

false

StoppedMode

string

No

Kullandıkça öde usulüne tabi bir ECS örneği için durdurma modu. Geçerli değerler:

  • StopCharging: Ekonomik mod. Ekonomik mod etkinleştirildikten sonra:

    • İşlem kaynakları (vCPU'lar, bellek ve GPU'lar), görüntü lisans ücretleri ve statik genel IP adresleri için bant genişliğine göre ödeme modu için faturalandırma askıya alınır.

    • Sistem diskleri, veri diskleri ve esnek IP adresleri (EIP'ler) için bant genişliğine göre ödeme modu için faturalandırma devam eder.

    • İşlem kaynakları geri alındığından, yetersiz stok nedeniyle örnek başlatılamayabilir. Bu durumda, daha sonra tekrar deneyin veya örnek türünü değiştirin.

    • Örnek durdurulmadan önce örnekle bir EIP ilişkilendirilmişse, örnek yeniden başlatıldıktan sonra IP adresi değişmeden kalır. Aksi takdirde, statik genel IP adresi değişebilir, ancak özel IP adresi değişmeden kalır.

    Daha fazla bilgi için Ekonomik mod konusuna bakın.

    Önemli Örnek ekonomik modu desteklemiyorsa, API bir hata döndürmez. Örnek öncelikli olarak durdurulur. Ekonomik modu desteklemeyen örnek türleri arasında yerel diskli örnekler ve abonelik örnekleri bulunur.

  • KeepCharging: Standart durdurma modu. Örnek durdurulduktan sonra faturalandırma devam eder.

Varsayılan değer: ECS konsolunda VPC'deki örnekler için ekonomik modu etkinleştirirseniz (daha fazla bilgi için Ekonomik modu varsayılan olarak etkinleştirme konusuna bakın) ve koşullar sağlanıyorsa, varsayılan değer StopCharging olur. Aksi takdirde, varsayılan değer KeepCharging olur.

KeepCharging

DryRun

boolean

No

Deneme çalıştırması yapılıp yapılmayacağını belirtir. Geçerli değerler:

  • true: Örneği durdurmadan bir deneme çalıştırması yapar. Sistem, gerekli parametrelerin belirtilip belirtilmediğini, istek biçiminin geçerli olup olmadığını, hizmet limitlerinin karşılanıp karşılanmadığını ve ECS stoğunun yeterli olup olmadığını kontrol eder. Kontrol başarısız olursa, ilgili hata döndürülür. Kontrol başarılı olursa, DryRunOperation hata kodu döndürülür.

  • false: Normal bir istek gerçekleştirir. Kontrol başarılı olduktan sonra örnek durdurulur.

Varsayılan değer: false.

true

Hibernate

boolean

No

Not

Bu parametre davetli önizlemesi aşamasındadır ve kullanıma sunulmamıştır.

hide

Response elements

Element

Type

Description

Example

object

RequestId

string

İstek kimliği.

1C488B66-B819-4D14-8711-C4EAAA13AC01

Examples

Success response

JSON format

{
  "RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.Encrypted.KmsNotEnable The operation failed because KMS is not activated. Please activate KMS in the KMS console and try again.
400 DiskError IncorrectDiskStatus.
500 InternalError The request processing has failed due to some unknown error.
403 IncorrectInstanceStatus The current status of the resource does not support this operation.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons.
403 InstanceType.ParameterMismatch The input parameter ConfirmStop must be true when an instance have localstorage.
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403 InvalidInstanceId.NotSupport Classic network Instance does not support this operation.
403 InvalidParameter.KMSKeyId.CMKUnauthorized The CMK needs to be added ECS tag
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK needs to be enabled.
403 InvalidParameter.KMSKeyId.KMSUnauthorized 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 HibernationConfigured.InstanceOperationForbidden The operation is not permitted due to limit of the hibernation configured instance.
403 HibernationConfigured.NotEnabled The instance hibernation configured option is not enabled.
403 InvalidOperation.KMSKeyIdNotFound The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region.
403 InvalidOperation.KMSServiceNotOpen KMS service is currently not open.
403 OperationDenied.SystemInstanceNotSupport The system instance does not support the %s operation because %s.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist.
503 LimitedOperation.ServiceUnavailable The service is currently unavailable. Please try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.