All Products
Search
Document Center

Elastic Compute Service:Modify the attributes of an instance

Last Updated:Dec 13, 2023

You can modify the attributes of an Elastic Compute Service (ECS) instance, such as the name, hostname (HostName), and description of the instance, to make instance resources easier to identify. This facilitates the management and automatic O&M of instance resources and improves the security of the resources. This topic describes how to modify the attributes of an instance.

Procedure

Modify the attributes of an instance in the ECS console

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the upper-left corner of the top navigation bar, select a region. 地域

  4. Find the instance whose attributes you want to modify and choose image.png > Instance Attributes > Modify Instance Attribute in the Actions column.

  5. In the Modify Instance Attributes dialog box, modify the instance attributes as prompted and click Confirm.

  6. (Optional) Restart the instance.

    If you change the hostname of the instance, you must restart the instance for the new hostname to take effect. Restart the instance in the ECS console or by calling the RebootInstance operation. The new hostname does not take effect if you restart the instance from within the operating system. For more information, see Restart instances.

    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 instances during off-peak hours.

Modify the attributes of an instance by calling API operations

  • When you create an instance by calling the RunInstances operation, configure the InstanceName, HostName, and Description parameters to specify the instance attributes.

  • To modify the attributes for an existing instance, call the ModifyInstanceAttribute operation and configure the InstanceName, HostName, and Description parameters to specify the instance attributes.