All Products
Search
Document Center

Elastic Compute Service:Modify the attributes of an instance

Last Updated:Apr 01, 2026

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

Attribute Takes effect Restart required
Instance name Immediately No
Description Immediately No
Hostname Immediately in the console; after restart at the OS level Yes (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 Properties.

  4. In the Modify Instance Properties dialog box, update the attributes and click OK.

    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:

Operation Description
DescribeInstanceAttribute Query the attributes of an ECS instance
ModifyInstanceAttribute Change the InstanceName, HostName, or Description of an existing instance
RunInstances Set InstanceName, HostName, and Description when creating an instance