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 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
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.
(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 instances during off-peak hours.
References
You can also call the following API operations to specify or modify the attributes of an instance:
When you create an instance by calling the RunInstances operation, configure the
InstanceName
,HostName
, andDescription
parameters to specify the instance attributes.To modify the attributes for an existing instance, call the ModifyInstanceAttribute operation and configure the
InstanceName
,HostName
, andDescription
parameters to specify the instance attributes.