You can modify the attributes of an Elastic Compute Service (ECS) instance, such as its instance name, hostname, and description, to organize and manage your resources.
Procedure
Go to ECS console - Instances.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
-
Click the target instance's ID to open the Instance Details page. Click All Operations to expand the actions panel, and then search for and click Modify Instance Properties.
-
In the Modify Instance Properties dialog box, modify the attributes, and then click OK.
NoteThe hostname of a Windows operating system cannot exceed 15 characters. If you replace a Linux operating system with a Windows operating system, make sure the instance hostname does not exceed 15 characters. For more information, see Replace the operating system (replace the system disk).
-
(Conditional) Restart the instance.
If you modify the hostname, the change takes effect only after you restart the instance from the ECS console or by calling the RebootInstance API. A restart from within the operating system is ineffective. For detailed instructions, 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.
Related topics
-
Query ECS instance attributes: Call the DescribeInstanceAttribute API to query the attributes of an instance.
-
Set attributes when creating an ECS instance: When you call the RunInstances API to create an instance, set the
InstanceName,HostName, andDescriptionparameters. -
Modify attributes of an existing instance: Call theModifyInstanceAttribute API and set the
InstanceName,HostName, andDescriptionparameters.