You can modify the name, hostname (HostName), and description attributes of an Elastic Compute Service (ECS) instance to identify instance resources in an efficient manner. This topic describes how to modify the attributes of an ECS instance.
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the instance whose attributes you want to modify and choose in the Actions column.
In the Modify Instance Attributes dialog box, modify the instance attributes as prompted and click Confirm.
NoteThe hostname of an instance that runs a Windows operating system cannot exceed 15 characters in length. When you replace a Linux operating system with a Windows operating system, make sure that the hostname of the instance meets the preceding requirement. For more information, see Replace the operating system (system disk) of an instance.
(Conditionally required) 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. If you restart the instance from within the operating system, the new hostname does not take effect. For more information, see Restart an instance.
WarningThe 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.
References
You can also call the following API operations to specify or modify the attributes of an instance:
To query the attribute information of an ECS instance, you can call the DescribeInstanceAttribute operation.
When you create an instance by calling the RunInstances operation, configure the
InstanceName
,HostName
, andDescription
parameters to specify the instance attributes.When you modify the attributes of an instance by calling the ModifyInstanceAttribute operation, you can change the
InstanceName
,HostName
, orDescription
parameter.