All Products
Search
Document Center

Elastic Compute Service:Modify the attributes of an instance

Last Updated:Feb 27, 2026

You can modify the instance name, hostname, and description of an Elastic Compute Service (ECS) instance to organize and identify your instance resources.

AttributeTakes effectRestart required
Instance nameImmediatelyNo
DescriptionImmediatelyNo
HostnameImmediately in the console; after restart at the OS levelYes (restart through the ECS console or API only)

Prerequisites

Before you begin, make sure that you have:

  • An ECS instance

  • Permissions to modify instance attributes

Modify instance attributes in the ECS console

  1. Open the ECS console.

  2. In the top navigation bar, select the region and resource group of the instance. 地域

  3. Click the instance ID to open its details. On the Instance Details tab, click All Actions in the upper-right corner, then search for and click Modify Instance Attribute.

  4. In the Modify Instance Attributes dialog box, update the attributes and click Confirm.

    Note

    The hostname of a Windows instance cannot exceed 15 characters. If you plan to replace the operating system from Linux to Windows, make sure the hostname meets this requirement before the replacement.

  5. (Conditional) If you changed the hostname, restart the instance from the ECS console or by calling the RebootInstance operation.

    Warning

    The restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the instance during off-peak hours.

    Important

    Restarting the instance from within the operating system does not apply the new hostname. Restart through the ECS console or the RebootInstance API.

API reference

Use these API operations to query or modify instance attributes programmatically:

OperationDescription
DescribeInstanceAttributeQuery the attributes of an ECS instance
ModifyInstanceAttributeChange the InstanceName, HostName, or Description of an existing instance
RunInstancesSet InstanceName, HostName, and Description when creating an instance